diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md index 1f699f3de3..da6f2e9d9b 100644 --- a/.github/actions/spelling/README.md +++ b/.github/actions/spelling/README.md @@ -12,6 +12,7 @@ File | Purpose | Format | Info [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) +[block-delimiters.list](block-delimiters.list) | Define block begin/end markers to ignore lines of text | line with _literal string_ for **start** followed by line with _literal string_ for **end** | [block ignore](https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Block-Ignore#status) 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/spelling/block-delimiters.list b/.github/actions/spelling/block-delimiters.list new file mode 100644 index 0000000000..a7817de612 --- /dev/null +++ b/.github/actions/spelling/block-delimiters.list @@ -0,0 +1,15 @@ +# Public Keys +-----BEGIN PUBLIC KEY----- +-----END PUBLIC KEY----- + +# RSA Private Key +-----BEGIN RSA PRIVATE KEY----- +-----END RSA PRIVATE KEY----- + +# GPG Public Key +-----BEGIN PGP PUBLIC KEY BLOCK----- +-----END PGP PUBLIC KEY BLOCK----- + +# Certificates +-----BEGIN CERTIFICATE----- +- diff --git a/.github/actions/spelling/candidate.patterns b/.github/actions/spelling/candidate.patterns index 3d8178ce79..8c9607bb76 100644 --- a/.github/actions/spelling/candidate.patterns +++ b/.github/actions/spelling/candidate.patterns @@ -8,7 +8,7 @@ ^.*\b[Cc][Ss][Pp][Ee][Ll]{2}:\s*[Dd][Ii][Ss][Aa][Bb][Ll][Ee]-[Ll][Ii][Nn][Ee]\b # patch hunk comments -^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .* +^@@ -\d+(?:,\d+|) \+\d+(?:,\d+|) @@ .* # git index header index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40} @@ -26,7 +26,7 @@ index (?:[0-9a-z]{7,40},|)[0-9a-z]{7,40}\.\.[0-9a-z]{7,40} # data url in quotes ([`'"])data:(?:[^ `'"].*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} # data url -data:[-a-zA-Z=;:/0-9+]*,\S* +\bdata:[-a-zA-Z=;:/0-9+]*,\S* # https/http/file urls (?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|] @@ -74,7 +74,7 @@ magnet:[?=:\w]+ # AWS SNS \bsns\.[-0-9a-z]+.amazonaws\.com/[-\w/&#%_?:=]* # AWS VPC -#vpc-\w+ +vpc-\w+ # While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there # YouTube url @@ -152,6 +152,9 @@ themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. # GHSA GHSA(?:-[0-9a-z]{4}){3} +# GitHub actions +\buses:\s+[-\w.]+/[-\w./]+@[-\w.]+ + # GitLab commit \bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b # GitLab merge requests @@ -210,7 +213,7 @@ accounts\.binance\.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* # medium link \blink\.medium\.com/[a-zA-Z0-9]+ # medium -\bmedium\.com/\@?[^/\s"]+/[-\w]+ +\bmedium\.com/@?[^/\s"]+/[-\w]+ # microsoft \b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]* @@ -275,7 +278,7 @@ slack://[a-zA-Z0-9?&=]+ [0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b # Twitter markdown -\[\@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) +\[@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) # Twitter hashtag \btwitter\.com/hashtag/[\w?_=&]* # Twitter status @@ -330,7 +333,7 @@ ipfs://[0-9a-zA-Z]{3,} [^"\s]+/gitweb/\S+;h=[0-9a-f]+ # HyperKitty lists -/archives/list/[^@/]+\@[^/\s"]*/message/[^/\s"]*/ +/archives/list/[^@/]+@[^/\s"]*/message/[^/\s"]*/ # lists /thread\.html/[^"\s]+ @@ -348,7 +351,7 @@ ipfs://[0-9a-zA-Z]{3,} \bopen\.spotify\.com/embed/playlist/\w+ # Mastodon -\bmastodon\.[-a-z.]*/(?:media/|\@)[?&=0-9a-zA-Z_]* +\bmastodon\.[-a-z.]*/(?:media/|@)[?&=0-9a-zA-Z_]* # scastie \bscastie\.scala-lang\.org/[^/]+/\w+ @@ -390,13 +393,13 @@ ipfs://[0-9a-zA-Z]{3,} (?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m # URL escaped characters -\%[0-9A-F][A-F](?=[A-Za-z]) +%[0-9A-F][A-F](?=[A-Za-z]) # lower URL escaped characters -\%[0-9a-f][a-f](?=[a-z]{2,}) +%[0-9a-f][a-f](?=[a-z]{2,}) # IPv6 \b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b # c99 hex digits (not the full format, just one I've seen) -#0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] +0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] # Punycode \bxn--[-0-9a-z]+ # sha @@ -423,7 +426,7 @@ sha\d+:[0-9]*[a-f]{3,}[0-9a-f]* # uuid: \b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b # hex digits including css/html color classes: -(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b +(?:[\\0][xX]|\\u|[uU]\+|#x?|%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b # integrity integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1} @@ -441,7 +444,7 @@ integrity=(['"])(?:\s*sha\d+-[-a-zA-Z=;:/0-9+]{40,})+\g{-1} Name\[[^\]]+\]=.* # IServiceProvider / isAThing -#\b(?:I|isA)(?=(?:[A-Z][a-z]{2,})+\b) +\b(?:I|isA)(?=(?:[A-Z][a-z]{2,})+(?:[A-Z]|\b)) # crypt (['"])\$2[ayb]\$.{56}\g{-1} @@ -455,6 +458,9 @@ Name\[[^\]]+\]=.* # scala modules ("[^"]+"\s*%%?\s*){2,3}"[^"]+" +# Intel intrinsics +_mm_\w+ + # Input to GitHub JSON content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1} @@ -462,11 +468,15 @@ content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1} # you'll want to remove the `(?=.*?")` suffix. # The `(?=.*?")` suffix should limit the false positives rate # printf -%(?:(?:(?:hh?|ll?|[jzt])?[diuoxn]|l?[cs]|L?[fega]|p)(?=[a-z]{2,})|(?:X|L?[FEGA]|p)(?=[a-zA-Z]{2,}))(?=[_a-zA-Z]+\b)(?!%)(?=.*?['"]) +%(?:(?:(?:hh?|ll?|[jzt])?[diuoxn]|l?[cs]|L?[fega]|p)(?=[a-z]{2,})|(?:X|L?[FEGA]|p)(?=[a-zA-Z]{2,}))(?!%)(?=[_a-zA-Z]+(?!%)\b)(?=.*?['"]) + +# Alternative printf +# %s +%(?:s(?=[a-z]{2,}))(?!%)(?=[_a-zA-Z]+(?!%)\b)(?=.*?['"]) # Python string prefix / binary prefix # Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings -(?|m([|!/@#,;']).*?\g{-1}) @@ -493,6 +503,9 @@ content: (['"])[-a-zA-Z=;:/0-9+]*=\g{-1} # perl run perl(?:\s+-[a-zA-Z]\w*)+ +# C network byte conversions +(?:\d|\bh)to(?!ken)(?=[a-z])|to(?=[adhiklpun]\() + # Go regular expressions regexp?\.MustCompile\(`[^`]*`\) @@ -506,7 +519,7 @@ regexp?\.MustCompile\(`[^`]*`\) sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2} # node packages -(["'])\@[^/'" ]+/[^/'" ]+\g{-1} +(["'])@[^/'" ]+/[^/'" ]+\g{-1} # go install go install(?:\s+[a-z]+\.[-@\w/.]+)+ @@ -542,17 +555,20 @@ customObjectInstantitationMethod \.fa-[-a-z0-9]+ # bearer auth -(['"])Bear[e][r] .*?\g{-1} +(['"])[Bb]ear[e][r] .*?\g{-1} + +# bearer auth +\b[Bb]ear[e][r]:? [-a-zA-Z=;:/0-9+.]+ # basic auth -(['"])Basic [-a-zA-Z=;:/0-9+]{3,}\g{-1} +(['"])[Bb]asic [-a-zA-Z=;:/0-9+]{3,}\g{-1} # base64 encoded content -([`'"])[-a-zA-Z=;:/0-9+]+=\g{-1} +#([`'"])[-a-zA-Z=;:/0-9+]{3,}=\g{-1} # base64 encoded content in xml/sgml ->[-a-zA-Z=;:/0-9+]+=[-a-zA-Z=;:/0-9+]{3,}== 0.0.22) #\\\w{2,}\{ +# American Mathematical Society (AMS) / Doxygen +TeX/AMS + +# File extensions +\*\.[+\w]+, + # eslint "varsIgnorePattern": ".+" # Windows short paths [/\\][^/\\]{5,6}~\d{1,2}[/\\] +# cygwin paths +/cygdrive/[a-zA-Z]/(?:Program Files(?: \(.*?\)| ?)(?:/[-+.~\\/()\w ]+)*|[-+.~\\/()\w])+ + # in check-spelling@v0.0.22+, printf markers aren't automatically consumed # printf markers #(? Don't use `can not` when you mean `cannot`. The only time you're likely to see `can not` written as separate words is when the word `can` happens to precede some other phrase that happens to start with `not`. +# > `Can't` is a contraction of `cannot`, and it's best suited for informal writing. +# > In formal writing and where contractions are frowned upon, use `cannot`. +# > It is possible to write `can not`, but you generally find it only as part of some other construction, such as `not only . . . but also.` +# - if you encounter such a case, add a pattern for that case to patterns.txt. \b[Cc]an not\b -# s.b. GitHub +# Should be `GitHub` (?v# (?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) -# hit-count: 905 file-count: 878 +# hit-count: 962 file-count: 935 # node packages -(["'])\@[^/'" ]+/[^/'" ]+\g{-1} +(["'])@[^/'" ]+/[^/'" ]+\g{-1} -# hit-count: 581 file-count: 126 +# hit-count: 539 file-count: 113 +# hex runs +\b[0-9a-fA-F]{16,}\b + +# hit-count: 537 file-count: 123 # kubernetes pod status lists # https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-phase \w+(?:-\w+)+\s+\d+/\d+\s+(?:Running|Pending|Succeeded|Failed|Unknown)\s+ -# hit-count: 515 file-count: 105 -# hex runs -\b[0-9a-fA-F]{16,}\b - -# hit-count: 307 file-count: 120 +# hit-count: 321 file-count: 125 # IPv6 \b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b -# hit-count: 284 file-count: 93 +# hit-count: 288 file-count: 96 # kubernetes object suffix -[0-9a-f]{10}-\w{5}\s -# hit-count: 280 file-count: 102 +# hit-count: 272 file-count: 96 # uuid: \b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b -# hit-count: 257 file-count: 92 +# hit-count: 269 file-count: 97 # hex digits including css/html color classes: -(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b +(?:[\\0][xX]|\\u|[uU]\+|#x?|%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b -# hit-count: 240 file-count: 98 -# base64 encoded content, possibly wrapped in mime -(?:^|[\s=;:?])[-a-zA-Z=;:/0-9+]{50,}(?:[\s=;:?]|$) +# hit-count: 234 file-count: 89 +# libraries +\blib(?!rar(?:ies|y))(?=[a-z]) -# hit-count: 179 file-count: 35 +# hit-count: 200 file-count: 49 # IServiceProvider / isAThing -\b(?:I(?!Ps)|isA)(?=(?:[A-Z][a-z]{2,})+\b) +\b(?:IP(?=[a-z])|(?:I|isA)(?=(?:[A-Z][a-z]{2,})+(?:[A-Z]|\b))) -# hit-count: 56 file-count: 13 +# hit-count: 174 file-count: 70 +# AWS VPC +vpc-\w+ + +# hit-count: 60 file-count: 17 # URL escaped characters -\%[0-9A-F][A-F](?=[A-Za-z]) +%[0-9A-F][A-F](?=[A-Za-z]) -# hit-count: 45 file-count: 33 +# hit-count: 48 file-count: 36 # tar arguments \b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ # hit-count: 20 file-count: 16 # curl arguments -\b(?:\\n|)curl(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* +\b(?:\\n|)curl(?:\.exe|)(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* # hit-count: 13 file-count: 2 # css url wrappings \burl\([^)]+\) +# hit-count: 9 file-count: 5 +# C network byte conversions +(?:\d|\bh)to(?!ken)(?=[a-z])|to(?=[adhiklpun]\() + # hit-count: 7 file-count: 7 # sed regular expressions sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2} -# hit-count: 4 file-count: 2 +# hit-count: 6 file-count: 3 # Contributor \[[^\]]+\]\(https://github\.com/[^/\s"]+/?\) -# hit-count: 3 file-count: 2 +# hit-count: 2 file-count: 1 +# data url in quotes +([`'"])data:(?:[^ `'"].*?|)(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} + +# hit-count: 2 file-count: 1 # assign regex -= /[^*]*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/ += /[^*].*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/[gi]?(?=\W|$) # hit-count: 1 file-count: 1 -# GitHub SHA refs -\[([0-9a-f]+)\]\(https://(?:www\.|)github.com/[-\w]+/[-\w]+/commit/\g{-1}[0-9a-f]* +# GitHub actions +\buses:\s+[-\w.]+/[-\w./]+@[-\w.]+ # hit-count: 1 file-count: 1 # javascript match regex @@ -89,8 +101,11 @@ sed 's/(?:[^/]*?[a-zA-Z]{3,}[^/]*?/){2} token:\s+[-.\w]+ \bget pods -n(?=\w) +/\\s(?=[a-z]) -/\\s.*/ +certificate-authority-data: .*$ + +\bcss-\w{6,7}\b(?=[ "](?!")) # Questionably acceptable forms of `in to` # Personally, I prefer `log into`, but people object @@ -112,7 +127,10 @@ token:\s+[-.\w]+ # go templates \s(\w+)\s+\g{-1}\s+\`(?:graphql|inject|json|yaml): # doxygen / javadoc / .net -(?:[\\@](?:brief|groupname|t?param|return|retval)|(?:public|private|\[Parameter(?:\(.+\)|)\])(?:\s+static|\s+override|\s+readonly)*)(?:\s+\{\w+\}|)\s+(\w+)\s+\g{-1}\s +(?:[\\@](?:brief|groupname|link|t?param|return|retval)|(?:public|private|\[Parameter(?:\(.+\)|)\])(?:\s+(?:static|override|readonly|required|virtual))*)(?:\s+\{\w+\}|)\s+(\w+)\s+\g{-1}\s + +# Python package registry has incorrect spelling for macOS / Mac OS X +"Operating System :: MacOS :: MacOS X" # Commit message -- Signed-off-by and friends ^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$ diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index 007160756d..7e01c2dcee 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -59,19 +59,19 @@ name: Check Spelling on: push: branches: - - "**" + - "**" tags-ignore: - - "**" + - "**" pull_request_target: branches: - - "**" + - "**" types: - - 'opened' - - 'reopened' - - 'synchronize' + - 'opened' + - 'reopened' + - 'synchronize' issue_comment: types: - - 'created' + - 'created' jobs: spelling: @@ -90,39 +90,43 @@ jobs: # 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@prerelease - with: - suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }} - checkout: true - check_file_names: 1 - spell_check_this: check-spelling/spell-check-this@prerelease - post_comment: 0 - use_magic_file: 1 - report-timing: 1 - warnings: bad-regex,binary-file,deprecated-feature,ignored-expect-variant,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check - experimental_apply_changes_via_bot: 1 - use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }} - extra_dictionary_limit: 20 - extra_dictionaries: - cspell:software-terms/dict/softwareTerms.txt - cspell:aws/aws.txt - cspell:npm/dict/npm.txt - cspell:k8s/dict/k8s.txt - cspell:node/dict/node.txt - cspell:php/dict/php.txt - cspell:python/src/python/python-lib.txt - cspell:python/src/common/extra.txt - cspell:html/dict/html.txt - cspell:django/dict/django.txt - cspell:typescript/dict/typescript.txt - cspell:golang/dict/go.txt - cspell:fullstack/dict/fullstack.txt - cspell:dotnet/dict/dotnet.txt - cspell:filetypes/filetypes.txt - cspell:java/src/java.txt - check_extra_dictionaries: '' + - name: check-spelling + id: spelling + uses: check-spelling/check-spelling@prerelease + with: + suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }} + checkout: true + check_file_names: 1 + spell_check_this: check-spelling/spell-check-this@prerelease + post_comment: 0 + use_magic_file: 1 + report-timing: 1 + warnings: bad-regex,binary-file,deprecated-feature,ignored-expect-variant,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check,unclosed-block-ignore-begin,unclosed-block-ignore-end + experimental_apply_changes_via_bot: 1 + use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }} + check_extra_dictionaries: '' + extra_dictionaries: | + cspell:software-terms/dict/softwareTerms.txt + cspell:aws/aws.txt + cspell:npm/dict/npm.txt + cspell:k8s/dict/k8s.txt + cspell:html/dict/html.txt + cspell:node/dict/node.txt + cspell:php/dict/php.txt + cspell:python/src/python/python-lib.txt + cspell:python/src/common/extra.txt + cspell:django/dict/django.txt + cspell:typescript/dict/typescript.txt + cspell:golang/dict/go.txt + cspell:fullstack/dict/fullstack.txt + cspell:dotnet/dict/dotnet.txt + cspell:filetypes/filetypes.txt + cspell:java/src/java.txt + cspell:python/src/python/python.txt + cspell:java/src/java-terms.txt + cspell:css/dict/css.txt + cspell:r/src/r.txt + cspell:powershell/dict/powershell.txt update: name: Update PR @@ -140,9 +144,9 @@ jobs: group: spelling-update-${{ github.event.issue.number }} cancel-in-progress: false steps: - - name: apply spelling updates - uses: check-spelling/check-spelling@prerelease - with: - experimental_apply_changes_via_bot: 1 - checkout: true - ssh_key: "${{ secrets.CHECK_SPELLING }}" + - name: apply spelling updates + uses: check-spelling/check-spelling@prerelease + with: + experimental_apply_changes_via_bot: 1 + checkout: true + ssh_key: "${{ secrets.CHECK_SPELLING }}"