From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Fri, 22 Jul 2022 09:07:12 +0000 (-0400) Subject: Upgrade check-spelling to v0.0.21 X-Git-Tag: dnsdist-1.8.0-rc3~10^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56db195d0c31e4dd423002ccc071c18bad5db857;p=thirdparty%2Fpdns.git Upgrade check-spelling to v0.0.21 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. --- diff --git a/.github/actions/spell-check/README.md b/.github/actions/spell-check/README.md new file mode 100644 index 0000000000..ca5ca67d08 --- /dev/null +++ b/.github/actions/spell-check/README.md @@ -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. diff --git a/.github/actions/spell-check/advice.md b/.github/actions/spell-check/advice.md index c83423a8ef..54f0c9b5e5 100644 --- a/.github/actions/spell-check/advice.md +++ b/.github/actions/spell-check/advice.md @@ -1,7 +1,17 @@ -
If the flagged items do not appear to be text +
If the flagged items are false positives 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). -
diff --git a/.github/actions/spell-check/allow.txt b/.github/actions/spell-check/allow.txt index 28db49a9a5..5f9dca5476 100644 --- a/.github/actions/spell-check/allow.txt +++ b/.github/actions/spell-check/allow.txt @@ -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 diff --git a/.github/actions/spell-check/excludes.txt b/.github/actions/spell-check/excludes.txt index 54d92a7cdb..dee8fd39ee 100644 --- a/.github/actions/spell-check/excludes.txt +++ b/.github/actions/spell-check/excludes.txt @@ -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 index 0000000000..4ca15837cc --- /dev/null +++ b/.github/actions/spell-check/line_forbidden.patterns @@ -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 diff --git a/.github/actions/spell-check/patterns.txt b/.github/actions/spell-check/patterns.txt index 56aad71fd2..051626be04 100644 --- a/.github/actions/spell-check/patterns.txt +++ b/.github/actions/spell-check/patterns.txt @@ -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 diff --git a/.github/actions/spell-check/reject.txt b/.github/actions/spell-check/reject.txt index a5ba6f6390..b5a6d36809 100644 --- a/.github/actions/spell-check/reject.txt +++ b/.github/actions/spell-check/reject.txt @@ -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 index d22f96726f..0000000000 --- a/.github/workflows/spelling2.yml +++ /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 index 0000000000..d9c7575daf --- /dev/null +++ b/.github/workflows/spelling3.yml @@ -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 }}