From 686177ee953e666c6c9cbf22a1547d83eff33a6c Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 22 Aug 2022 14:10:53 -0400 Subject: [PATCH] Use check-spelling/check-spelling@v0.0.20 Refreshes the workflow based on https://github.com/check-spelling/spell-check-this/blob/744c66e2140fd8acaf5388efd0db3727d010d6e9/.github/workflows/spelling.yml --- .github/actions/spelling/README.md | 16 ++++++ .github/actions/spelling/advice.md | 25 +++++++++ .github/actions/spelling/allow.txt | 22 -------- .github/actions/spelling/excludes.txt | 36 +++++++++++- .github/actions/spelling/expect.txt | 36 +++--------- .../actions/spelling/line_forbidden.patterns | 48 ++++++++++++++++ .github/actions/spelling/patterns.txt | 55 ++++++++++++++++++- .github/actions/spelling/reject.txt | 11 ++-- .github/workflows/spelling2.yml | 41 ++++++++++---- 9 files changed, 221 insertions(+), 69 deletions(-) create mode 100644 .github/actions/spelling/README.md create mode 100644 .github/actions/spelling/advice.md create mode 100644 .github/actions/spelling/line_forbidden.patterns diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md new file mode 100644 index 0000000000..d82bed75cc --- /dev/null +++ b/.github/actions/spelling/README.md @@ -0,0 +1,16 @@ +# check-spelling/check-spelling configuration + +File | Purpose | Format | Info +-|-|-|- +[dictionary.txt](dictionary.txt) | Replacement dictionary (creating this file will override the default dictionary) | one word per line | [dictionary](https://github.com/check-spelling/check-spelling/wiki/Configuration#dictionary) +[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/spelling/advice.md b/.github/actions/spelling/advice.md new file mode 100644 index 0000000000..54f0c9b5e5 --- /dev/null +++ b/.github/actions/spelling/advice.md @@ -0,0 +1,25 @@ + +
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, + try adding it to the `patterns.txt` file. + + Patterns are Perl 5 Regular Expressions - you can [test]( +https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines. + + Note that patterns can't match multiline strings. + +
diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index e4859350fb..76c58be8d4 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -216,33 +216,19 @@ http https HWND Hyperlink -IActivation -IApplication IAppx -IAsync -IBuffer icu -IDeserializer -IDisposable IDX -IEnumerable -IEquatable -IEquitable IFACEMETHOD ifdef ifndef ifstream -IInput -IInspectable IIS -ILogger -IManifest impl inapplicabilities Inet inheritdoc inno -INotify INPROC Inq installertype @@ -254,21 +240,13 @@ INSTALLPATH INSTALLUILEVEL interop INVALIDARG -IObservable iomanip iostream -IOutput -IProgress -IRandom -IRest ISAPPROVEDFOROUTPUT -ISet -ISource isspace istream istringstream isxdigit -ITest IUnknown json junit diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt index 48c78edee4..f792e0f357 100644 --- a/.github/actions/spelling/excludes.txt +++ b/.github/actions/spelling/excludes.txt @@ -1,15 +1,32 @@ # See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes (?:^|/)(?i)COPYRIGHT (?:^|/)(?i)LICEN[CS]E +(?:^|/)go\.sum$ (?:^|/)package(?:-lock|)\.json$ (?:^|/)vendor/ /shared\.manifest$ ignore$ +\.a$ +\.ai$ \.avi$ +\.bmp$ +\.bz2$ \.cer$ +\.crt$ +\.dll$ +\.DS_Store$ +\.eot$ +\.exe$ \.gif$ +\.gitattributes$ +\.graffle$ +\.gz$ +\.icns$ \.ico$ +\.jar$ \.jpe?g$ +\.key$ +\.lib$ \.lock$ \.map$ \.min\. @@ -17,24 +34,38 @@ ignore$ \.mp[34]$ \.msix$ \.msixbundle$ +\.o$ +\.ocf$ +\.otf$ +\.pdf$ +\.pem$ \.png$ +\.psd$ +\.s$ \.sln$ +\.svg$ +\.tiff?$ +\.ttf$ \.vcxitems$ \.vcxproj$ \.vcxproj\.filters$ \.vdproj$ \.wapproj$ \.wav$ +\.webm$ +\.webp$ \.winmd$ +\.woff2?$ +\.zip$ ^cgmanifest\.json$ ^Localization/ ^NOTICE$ ^src/AppInstallerCLICore/Commands/ExperimentalCommand\.cpp$ +^src/AppInstallerCLIE2ETests/TestData/AppInstallerTestMsiInstaller.msi$ ^src/AppInstallerCLITests/TestData/InputARPData.txt$ ^src/AppInstallerCLITests/TestData/InputNames.txt$ ^src/AppInstallerCLITests/TestData/InputPublishers.txt$ ^src/AppInstallerCLITests/TestData/NormalizationInitialIds.txt$ -^src/AppInstallerCLIE2ETests/TestData/AppInstallerTestMsiInstaller.msi$ ^src/AppInstallerCommonCore/external/do.h$ ^src/catch2/ ^src/cpprestsdk/ @@ -44,4 +75,5 @@ ignore$ ^src/YamlCppLib/ # Because it doesn't handle argument -Words well ^tools/CorrelationTestbed/.*\.ps1$ -^\.github/ +^\.github/actions/spelling/ +^\Q.github/workflows/spelling.yml\E$ diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 75d1c18de9..87162fefe3 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -41,8 +41,6 @@ badbit Baz bcp BEFACEF -BEFACEFE -Beigi bfd BFirst bght @@ -57,6 +55,7 @@ BOMs boundparms brk Browsable +BSODs Buf buildtransitive BUILTINS @@ -105,6 +104,7 @@ desktopappinstaller dirs diskfull dllimport +DMPAs dnld Dobbeleer Dsc @@ -125,10 +125,9 @@ etest execustom EXEHASH experimentalfeatures -fcb -FECAFEB fd fdw +FECAFEB fedorapeople fileinuse Filtercriteria @@ -170,44 +169,23 @@ hresults htm IARP IAttachment -IConfiguration -ICreate idx IEnum IFACEMETHODIMP -IFile -IFind -IGlobal IHelp -IHost iid -IInstall -IInstance IISOn img -IMutable -IName inet inor installinprogress installshield insufficientmemory Intelli -IPackage -IPersist -IRead -IService -ISettings -IShell ishelp ISQ -issuecomment ISVs itr -IUninstall -IVector -IWeb -IZone jdk jfearn JObject @@ -216,8 +194,6 @@ jpalardy JREs jrsoftware jsoncpp -kayone -Keivan KF KNOWNFOLDERID Kp @@ -239,7 +215,6 @@ localizationpriority LPBYTE LPDWORD lpitemidlist -LPITEMIDLIST LPWCH LPWSTR LSTATUS @@ -289,7 +264,6 @@ normer NOSEPARATOR NOTAPROPERTY notmatch -npp nsis nuffing nullopt @@ -403,14 +377,17 @@ SUSE swervy SYD SYG +Syncy sysrefcomp Tagit TCpp Templating temppath testexampleinstaller +textarea thiscouldbeapc threehundred +timezone Tlg tombstoned TOptions @@ -423,6 +400,7 @@ TState TStatus typeof typeparam +ubuntu UCase ucasemap UChars diff --git a/.github/actions/spelling/line_forbidden.patterns b/.github/actions/spelling/line_forbidden.patterns new file mode 100644 index 0000000000..254230547a --- /dev/null +++ b/.github/actions/spelling/line_forbidden.patterns @@ -0,0 +1,48 @@ +# 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. preempt +[Pp]re-empt\b + +# s.b. preemptively +[Pp]re-emptively + +# s.b. reentrancy +[Rr]e-entrancy + +# s.b. reentrant +[Rr]e-entrant + +# Reject duplicate words +\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt index 1adeefe415..03e0f88b48 100644 --- a/.github/actions/spelling/patterns.txt +++ b/.github/actions/spelling/patterns.txt @@ -15,8 +15,6 @@ data:[a-zA-Z=;,/0-9+-]+ "[0-9a-f]{64}" # sha-1 \b[0-9a-f]{40}\b -# ignore long runs of a single character: -\b([A-Za-z])\g{-1}{3,}\b El proyecto .* diferentes # Package family names \b[-.A-Za-z0-9]+_[a-z0-9]{13}\b @@ -45,8 +43,61 @@ http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer # Ignore test patterns REQUIRE\(RestHelper::GetRestAPIBaseUri\(".*"\) == L".*" +# fabricbot.json +"(?:id|user)": "[-A-Za-z0-9_]*" + # URL escaped characters \%[0-9A-F]{2} # Sample store product id for App Installer 9nblggh4nns1 + +# Automatically suggested patterns +# hit-count: 407 file-count: 78 +# IServiceProvider +\bI(?=(?:[A-Z][a-z]{2,})+\b) + +# hit-count: 13 file-count: 9 +# GitHub SHAs (markdown) +(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|) + +# Compiler flags +(?:^|[\t ,"'`=(])-[D](?!ependency|esktop|estination|ev|irectory) +(?:^|[\t ,"'`=(])-[W](?!ait|in|orking) +(?:^|[\t ,"'`=(])-[l](?!og) +(?:^|[\t ,"'`=(])-[f](?!ind|eatures) + +# hit-count: 4 file-count: 2 +# w3 +\bw3\.org/[-0-9a-zA-Z/#.]+ + +# hit-count: 2 file-count: 2 +# hex runs +\b[0-9a-fA-F]{16,}\b + +# hit-count: 1 file-count: 1 +# Contributor +\[[^\]]+\]\(https://github\.com/[^/\s"]+\) + +# hit-count: 1 file-count: 1 +# GHSA +GHSA(?:-[0-9a-z]{4}){3} + +# hit-count: 1 file-count: 1 +# hex in url queries +=[0-9a-fA-F]*?(?:[A-F]{3,}|[a-f]{3,})[0-9a-fA-F]*?& + +# hit-count: 1 file-count: 1 +# hex digits including css/html color classes: +(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9a-fA-FgGrR_]{2,}(?:[uUlL]{0,3}|u\d+)\b + +# acceptable duplicates +# ls directory listings +[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+ +# C types +\s(Architecture|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/spelling/reject.txt b/.github/actions/spelling/reject.txt index a5ba6f6390..b5a6d36809 100644 --- a/.github/actions/spelling/reject.txt +++ b/.github/actions/spelling/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 index 02b6ea3232..0c923d21aa 100644 --- a/.github/workflows/spelling2.yml +++ b/.github/workflows/spelling2.yml @@ -11,17 +11,38 @@ on: jobs: spelling: name: Spell checking + permissions: + contents: read + pull-requests: read + actions: read + 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: checkout-merge - if: "contains(github.event_name, 'pull_request')" - uses: actions/checkout@v2 - with: - ref: refs/pull/${{github.event.pull_request.number}}/merge - - name: checkout - if: ${{ github.event_name == 'push' }} - uses: actions/checkout@v2 - - uses: check-spelling/check-spelling@v0.0.19 + - name: check-spelling id: spelling + uses: check-spelling/check-spelling@v0.0.20 + with: + suppress_push_for_open_pull_request: 1 + checkout: true + post_comment: 0 + + comment: + name: Report + runs-on: ubuntu-latest + needs: spelling + permissions: + contents: write + pull-requests: write + if: (success() || failure()) && needs.spelling.outputs.followup + steps: + - name: comment + uses: check-spelling/check-spelling@v0.0.20 with: - shortest_word: 2 + checkout: true + task: ${{ needs.spelling.outputs.followup }}