]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Upgrade check-spelling to v0.0.21
authorJosh Soref <2119212+jsoref@users.noreply.github.com>
Fri, 22 Jul 2022 09:07:12 +0000 (05:07 -0400)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 8 Mar 2023 13:32:04 +0000 (14:32 +0100)
Using check-spelling/spell-check-this@main
https://github.com/check-spelling/spell-check-this/commit/7adef917a33f6b1032e7f8c617b5e71cefd6f101

---

Expect isn't being updated by this commit in order to enable the
previous version of check-spelling to report it's happy before it rides
off into the sunset.

The next person to trigger an update to expect will have the chance to
remove the stale items.

.github/actions/spell-check/README.md [new file with mode: 0644]
.github/actions/spell-check/advice.md
.github/actions/spell-check/allow.txt
.github/actions/spell-check/excludes.txt
.github/actions/spell-check/line_forbidden.patterns [new file with mode: 0644]
.github/actions/spell-check/patterns.txt
.github/actions/spell-check/reject.txt
.github/workflows/spelling2.yml [deleted file]
.github/workflows/spelling3.yml [new file with mode: 0644]

diff --git a/.github/actions/spell-check/README.md b/.github/actions/spell-check/README.md
new file mode 100644 (file)
index 0000000..ca5ca67
--- /dev/null
@@ -0,0 +1,15 @@
+# check-spelling/check-spelling configuration
+
+File | Purpose | Format | Info
+-|-|-|-
+[allow.txt](allow.txt) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow)
+[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject)
+[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes)
+[only.txt](only.txt) | Only check matching files (applied after excludes) | perl regular expression | [only](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-only)
+[patterns.txt](patterns.txt) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
+[line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
+[expect.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect)
+[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice)
+
+Note: you can replace any of these files with a directory by the same name (minus the suffix)
+and then include multiple files inside that directory (with that suffix) to merge multiple files together.
index c83423a8ef6109ede98d9a44ecbc47c6a5d972c5..54f0c9b5e5edbdb696d29e6d25bf931941414f0a 100644 (file)
@@ -1,7 +1,17 @@
 <!-- See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice --> <!-- markdownlint-disable MD033 MD041 -->
-<details><summary>If the flagged items do not appear to be text</summary>
+<details><summary>If the flagged items are false positives</summary>
 
 If items relate to a ...
+* binary file (or some other file you wouldn't want to check at all).
+
+  Please add a file path to the `excludes.txt` file matching the containing file.
+
+  File paths are Perl 5 Regular Expressions - you can [test](
+https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files.
+
+  `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md](
+../tree/HEAD/README.md) (on whichever branch you're using).
+
 * well-formed pattern.
 
   If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it,
@@ -12,14 +22,4 @@ https://www.regexplanet.com/advanced/perl/) yours before committing to verify it
 
   Note that patterns can't match multiline strings.
 
-* binary file.
-
-  Please add a file path to the `excludes.txt` file matching the containing file.
-
-  File paths are Perl 5 Regular Expressions - you can [test](
-https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files.
-
-  `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md](
-../tree/HEAD/README.md) (on whichever branch you're using).
-
 </details>
index 28db49a9a5b80fc1eab0130eb76bcd7c0a88c4da..5f9dca547646fe57643d8cd7d727f9284309cd7d 100644 (file)
@@ -175,6 +175,7 @@ authconfdir
 authdir
 authdirs
 authdomain
+authip
 authlog
 authname
 authoritatives
@@ -428,6 +429,7 @@ childstat
 chkconfig
 chr
 chrono
+cidr
 cin
 cinttypes
 ciphersuites
@@ -750,6 +752,7 @@ dnsdistrules
 dnsdisttcp
 dnsdisttests
 dnserrors
+DNSHEADER
 DNSID
 DNSIP
 dnskeyr
@@ -3387,7 +3390,6 @@ SSLRSADNS
 sslsock
 SSLTLS
 SSLTLSIO
-SSLv
 SSocket
 ssql
 ssqlite
index 54d92a7cdb60a32a91697da053a3f6ef8684509f..dee8fd39eea35e742d3c0763520ce6165ae6fae7 100644 (file)
@@ -19,6 +19,7 @@ SUMS$
 \.asc$
 \.avi$
 \.bmp$
+\.bz2$
 \.cer$
 \.class$
 \.crl$
@@ -30,13 +31,13 @@ SUMS$
 \.eps$
 \.exe$
 \.gif$
+\.gitattributes$
 \.graffle$
 \.gz$
 \.icns$
 \.ico$
 \.jar$
-\.jpeg$
-\.jpg$
+\.jpe?g$
 \.keys?$
 \.lib$
 \.lock$
@@ -48,6 +49,7 @@ SUMS$
 \.mp4$
 \.mp[34]$
 \.nsec3(?:-optout|)$
+\.ocf$
 \.otf$
 \.pdf$
 \.pem$
@@ -63,6 +65,7 @@ SUMS$
 \.ttf$
 \.wav$
 \.woff
+\.woff2?$
 \.xcf$
 \.xls
 \.xpm$
@@ -78,3 +81,4 @@ SUMS$
 ^pdns/recursordist/html/js/
 ^regression-tests\.recursor-dnssec/test_ReadTrustAnchorsFromFile\.py$
 ^\.github/actions/spell-check/
+^\.github/workflows/spelling\.yml$
diff --git a/.github/actions/spell-check/line_forbidden.patterns b/.github/actions/spell-check/line_forbidden.patterns
new file mode 100644 (file)
index 0000000..4ca1583
--- /dev/null
@@ -0,0 +1,39 @@
+# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere
+# \bm_data\b
+
+# s.b. GitHub
+\bGithub\b
+
+# s.b. GitLab
+\bGitlab\b
+
+# s.b. JavaScript
+\bJavascript\b
+
+# s.b. Microsoft
+\bMicroSoft\b
+
+# s.b. another
+\ban[- ]other\b
+
+# s.b. greater than
+\bgreater then\b
+
+# s.b. less than
+\bless then\b
+
+# s.b. otherwise
+\bother[- ]wise\b
+
+# s.b. nonexistent
+\bnon existing\b
+\b[Nn]o[nt][- ]existent\b
+
+# s.b. preexisting
+[Pp]re-existing
+
+# s.b. preemptively
+[Pp]re-emptively
+
+# Reject duplicate words
+\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s
index 56aad71fd268ce63454ef91e029d1243ad81e2be..051626be04a249f5ea20244749dd2e4cfa9bf6e7 100644 (file)
@@ -26,6 +26,14 @@ addNSECRecordToLW.*DNSName.*powerdnt.com.*QType::NS.*res->d_records
 data:[a-zA-Z=;,/0-9+]+
 BOOST_CHECK_EQUAL\(b64, "[a-zA-Z=;,/0-9+]+"
 
+# acceptable duplicates
+# ls directory listings
+[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+
+# C types
+\s(long|LONG) \g{-1}\s
+# javadoc / .net
+(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s
+
 # ignore long runs of a single character:
 \b([A-Za-z])\g{-1}{3,}\b
 
index a5ba6f6390ef0b7d463ffcbe85ce24d57819c729..b5a6d36809fbb01c074c1ca47aaf76183896432c 100644 (file)
@@ -1,7 +1,10 @@
 ^attache$
 benefitting
-occurence
+occurences?
+^dependan.*
+^oer$
 Sorce
-^[Ss]pae
-^untill
-^wether
+^[Ss]pae.*
+^untill$
+^untilling$
+^wether.*
diff --git a/.github/workflows/spelling2.yml b/.github/workflows/spelling2.yml
deleted file mode 100644 (file)
index d22f967..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# spelling.yml is blocked per https://github.com/check-spelling/check-spelling/security/advisories/GHSA-g86g-chm8-7r2p
-name: Spell checking
-on:
-  push:
-    branches:
-      - "**"
-    tags-ignore:
-      - "**"
-  pull_request_target:
-    branches:
-      - "**"
-    tags-ignore:
-      - "**"
-    types: ['opened', 'reopened', 'synchronize']
-
-jobs:
-  spelling:
-    name: Spell checking
-    runs-on: ubuntu-latest
-    steps:
-    - name: checkout-merge
-      if: "contains(github.event_name, 'pull_request')"
-      uses: actions/checkout@v3.1.0
-      with:
-        ref: refs/pull/${{github.event.pull_request.number}}/merge
-    - name: checkout
-      if: ${{ github.event_name == 'push' }}
-      uses: actions/checkout@v3.1.0
-    - uses: check-spelling/check-spelling@v0.0.19
-      id: spelling
-      with:
-        config: .github/actions/spell-check
diff --git a/.github/workflows/spelling3.yml b/.github/workflows/spelling3.yml
new file mode 100644 (file)
index 0000000..d9c7575
--- /dev/null
@@ -0,0 +1,92 @@
+# spelling.yml is blocked per https://github.com/check-spelling/check-spelling/security/advisories/GHSA-g86g-chm8-7r2p
+name: Spell checking
+
+# Comment management is handled through a secondary job, for details see:
+# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions
+#
+# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment
+#   (in odd cases, it might actually run just to collapse a comment, but that's fairly rare)
+#   it needs `contents: write` in order to add a comment.
+#
+# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment
+#   or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment)
+#   it needs `pull-requests: write` in order to manipulate those comments.
+
+on:
+  push:
+    branches:
+      - "**"
+    tags-ignore:
+      - "**"
+  pull_request_target:
+    branches:
+      - "**"
+    tags-ignore:
+      - "**"
+    types:
+      - 'opened'
+      - 'reopened'
+      - 'synchronize'
+
+jobs:
+  spelling:
+    name: Spell checking
+    permissions:
+      contents: read
+      pull-requests: read
+      actions: read
+      security-events: write
+    outputs:
+      followup: ${{ steps.spelling.outputs.followup }}
+    runs-on: ubuntu-latest
+    if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
+    concurrency:
+      group: spelling-${{ github.event.pull_request.number || github.ref }}
+      # note: If you use only_check_changed_files, you do not want cancel-in-progress
+      cancel-in-progress: true
+    steps:
+    - name: check-spelling
+      id: spelling
+      uses: check-spelling/check-spelling@v0.0.21
+      with:
+        config: .github/actions/spell-check
+        suppress_push_for_open_pull_request: 1
+        checkout: true
+        spell_check_this: check-spelling/spell-check-this@prerelease
+        post_comment: 0
+        use_sarif: 1
+        check_extra_dictionaries: ''
+
+  comment-push:
+    name: Report (Push)
+    # If your workflow isn't running on push, you can remove this job
+    runs-on: ubuntu-latest
+    needs: spelling
+    permissions:
+      contents: write
+    if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
+    steps:
+    - name: comment
+      uses: check-spelling/check-spelling@v0.0.21
+      with:
+        config: .github/actions/spell-check
+        checkout: true
+        spell_check_this: check-spelling/spell-check-this@prerelease
+        task: ${{ needs.spelling.outputs.followup }}
+
+  comment-pr:
+    name: Report (PR)
+    # If you workflow isn't running on pull_request*, you can remove this job
+    runs-on: ubuntu-latest
+    needs: spelling
+    permissions:
+      pull-requests: write
+    if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
+    steps:
+    - name: comment
+      uses: check-spelling/check-spelling@prerelease
+      with:
+        config: .github/actions/spell-check
+        checkout: true
+        spell_check_this: check-spelling/spell-check-this@prerelease
+        task: ${{ needs.spelling.outputs.followup }}