From e1260cfb335b1d2252e452812df325629483d7e8 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 18 Aug 2021 19:56:52 -0400 Subject: [PATCH] Add check-spelling --- .github/actions/spelling/README.md | 15 + .github/actions/spelling/advice.md | 27 ++ .github/actions/spelling/allow.txt | 0 .github/actions/spelling/excludes.txt | 18 + .github/actions/spelling/expect.txt | 536 ++++++++++++++++++++++++++ .github/actions/spelling/patterns.txt | 31 ++ .github/actions/spelling/reject.txt | 7 + .github/workflows/spelling.yml | 93 +++++ 8 files changed, 727 insertions(+) create mode 100644 .github/actions/spelling/README.md create mode 100644 .github/actions/spelling/advice.md create mode 100644 .github/actions/spelling/allow.txt create mode 100644 .github/actions/spelling/excludes.txt create mode 100644 .github/actions/spelling/expect.txt create mode 100644 .github/actions/spelling/patterns.txt create mode 100644 .github/actions/spelling/reject.txt create mode 100644 .github/workflows/spelling.yml diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md new file mode 100644 index 000000000..1bd7d4412 --- /dev/null +++ b/.github/actions/spelling/README.md @@ -0,0 +1,15 @@ +# 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) | +| [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 000000000..a8c83b89d --- /dev/null +++ b/.github/actions/spelling/advice.md @@ -0,0 +1,27 @@ + +
If you see a bunch of garbage + +If it relates to a ... + +
well-formed pattern + +See if there's a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it. + +If not, try writing one and 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. + +
+
binary-ish string + +Please add a file path to the `excludes.txt` file instead of just accepting the garbage. + +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/spelling/allow.txt b/.github/actions/spelling/allow.txt new file mode 100644 index 000000000..e69de29bb diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt new file mode 100644 index 000000000..61643720c --- /dev/null +++ b/.github/actions/spelling/excludes.txt @@ -0,0 +1,18 @@ +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes +(?:^|/)(?i)COPYRIGHT +(?:^|/)(?i)LICEN[CS]E +(?:^|/)package(?:-lock|)\.json$ +(?:^|/)vendor/ +\.avi$ +\.ico$ +\.jpe?g$ +\.lock$ +\.map$ +\.min\. +\.mod$ +\.mp[34]$ +\.png$ +\.wav$ +^\.github/ +^docs/_?releases/ +ignore$ diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt new file mode 100644 index 000000000..f00ce95cb --- /dev/null +++ b/.github/actions/spelling/expect.txt @@ -0,0 +1,536 @@ +addon +amd +Andreasson +antialiased +api +apps +AProxy +args +Arial +arity +aspx +asynch +atleast +atrule +attr +autohiding +Autoprefixer +axios +AXO +backend +backface +bak +barcode +Barwell +baseclass +baseurl +baz +Beevers +bitcoin +bithound +bithoundrc +bla +blabla +blang +blockquote +blog +borked +boxmodel +Branyen +breadcrumb +briancavalier +Brostoff +Browserified +browserify +browserlistrc +browserslist +browserslistrc +btc +btn +buildstatus +Burak +camelcase +Cantarell +carbonads +Cardoso +carlerik +catpants +cdata +cdn +cdnjs +cgi +changelog +charset +chdir +checkbox +checkboxes +chiark +chris +Cinos +circleci +Cirkel +cjno +cjs +clearfix +clickability +clickable +clike +codebase +codecov +codemod +codepoints +codespell +codeutopia +colgroup +colno +colorizing +Colorstr +commitish +committers +commonjs +compat +concat +config +Consolas +contenteditable +CORS +Costan +css +Ctx +Cujo +CWeb +datetime +debounce +Delivr +Denicola +deps +deserialized +dest +destructured +Destructuring +dfn +diffs +dirname +doctype +dolby +doodleblabla +doop +dottedmag +dougo +dpi +dppx +dropdown +dropup +DSLs +duclet +ecma +editorconfig +endcomment +endfor +endif +Enem +enum +EOL +eot +errorevent +eslint'ing +eslint +eslintrc +esm +Espen +estobbart +Ettole +eur +facetime +fakeserver +Faketimers +faketimersinstallconfig +fakexhr +Falgout +falsy +Farid +favicon +fieldset +figcaption +firefox +Fischbach +Fleis +Floby +formatio +freenode +fubars +fullscreen +func +Fundraiser +gbp +Geisend +Gemfile +Geries +getbootstrap +GFM +Giannoutsos +gimyu +Giorgos +github +globals +glyphicon +gmail +gofundme +goligo +goodreads +google +googleapis +Gothdo +grayscale +greenend +Gruntfile +Gurinovich +Gvozd +Gyandeep +halflingsregular +hdd +Hempton +hgroup +highlightall +highlighter +Holowinski +homegrowns +homepage +howto +href +hrtime +hsl +hsla +html +http +hurrymaplelad +idx +iefix +ified +iframe +ignoreme +IIFE +img +impl +imuy +inbox +informit +Inlined +instanceof +Internalise +invokable +invokant +ipsum +irc +isbn +Jankily +javascript +jdgreenberger +Jmeas +jonnyreeves +jpy +jquery +JScript +JSCS +jscsrc +jsdelivr +jsdoc +jsdom +json +jsonplaceholder +jumbotron +kbackowski +kbd +kdpecker +keyframes +kken +Kopriva +Kopseng +kramdown +Krisman +kustom +len +libsass +Lienen +lijfuc +Lilleaas +lineno +linting +Litvin +localhost +lodash +lolex +lolz +lookbehind +lorem +lucasfcosta +mailto +Maldonado +margs +markdownlint +matchs +mathml +maxantoni +meh +melinath +memberof +messageerror +mherman +Microsoft +Microtask +middleware +mixin +mkdir +mocaccino +mochajs +mochify +modals +Mohayonao +Mootools +moz +mozilla +mroderick +MSXML +multiline +multipage +myarg +namespace +navbar +navs +nbsp +necolas +Neshat +Neue +newed +newversion +nexttick +nicolasgallagher +Niklas +nise +nodejs +nowrap +npm +npmjs +ntest +Nynja +Olmo +onerror +onload +onlys +onmessage +onprogress +onreadystatechange +onsuccess +opencollective +opensource +opentype +optgroup +osx +outro +overloadable +params +parseable +passs +permalink +phantomjs +Phinney +php +Phred +piamancini +plugin +pluralsight +png +polyfill +postinstall +postversion +Potashow +poweredby +prebuilt +premajor +preminor +prepatch +printf +prismjs +progid +programatically +promisify +proxyquire +pubsub +pubsubjs +pwd +qcs +qrcode +qunit +readfile +readline +readme +readonly +readystatechange +refactor +refactoring +regex +regexp +reqres +resizable +retval +retweet +rfer +rgba +rke +Roboto +roderick +Rodion +rolex +rollup +rubygems +runkit +runtimes +Ruppel +samsam +sandboxing +sandboxreplaceobject +saucelabs +scraggo +screenreaders +screenshot +scrollable +scrollbar +searchfield +Segoe +semaphoreci +semver +Serebryanskyi +serverrespond +Settimeout +sgen +sgtatham +Shakiba +shelljs +Sify +sinonjs +sinonjsorg +sisyphos +sitemap +sitepoint +smartphones +socio +Sokolowski +someemail +somefile +somepage +sorce +sourcemaps +spellcheck +sprzybylski +spycall +spycallcallback +spycallfirstarg +spycalllastarg +Spys +src +SSL +stackoverflow +standalone +stdout +stringified +stringify +stubcallsargindex +stubcallsargonindex +stubcallsargonwithindex +stubcallsargwithindex +stubmock +stuboncalln +stubyieldsarg +stubyieldsoncontext +stubyieldstoonproperty +stubyieldstoproperty +stylability +stylesheet +suffixa +suffixb +svg +Szebeni +tabbable +tarjei +tbody +tddjs +TECHS +TEHEK +Tek +textarea +textfield +Textmate +tfoot +thead +Thorup +tiemevanveen +timkadlec +tinnedfruit +todo +toolbar +tooltip +transpiled +transpiler +triaging +truetype +ttf +twbs +typeof +typicode +uage +Ubuntu +UMD +Uncollapse +Unconfigurable +uncycle +undef +unescape +Unicode +uninstall +unpkg +unref +Unstyle +url +usd +username +usr +utf +utils +utm +uuid +viewports +vitalets +Vynnychenko +Waser +WCAG +webappapis +webkit +Webpack +website +websockets +webstorm +webworker +Weinre +whatwg +wheresrhys +wiki +wikipedia +withargs +woff +workaround +wrapple +www +xbt +xdomain +xhr +Xiao +xml +XMLDOM +XMLHTTP +XObject +yaml +yml +yproject +Zcicala +zindex +zuzusik diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt new file mode 100644 index 000000000..410ce8a6e --- /dev/null +++ b/.github/actions/spelling/patterns.txt @@ -0,0 +1,31 @@ +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns + +# GitHub SHAs +\bapi.github\.com/repos/[^/]+/[^/]+/[^/]+/[0-9a-f]+\b +(?:\[[0-9a-f]+\]\(https:/|)/github\.com/[^/]+/[^/]+(?:/[^/]+/[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|) +\bgithub\.com/[^/]+/[^/]+[@#][0-9a-f]+\b +# githubusercontent +/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]* +# gist github +/gist\.github\.com/[^/]+/[0-9a-f]+ +# git.io +\bgit\.io/[0-9a-zA-Z]+ +# GitHub JSON +"node_id": "[-a-zA-Z=;:/0-9+]*" +# Contributor +\[[^\]]+]\(https://github\.com/[^/]+\) +# GHSA +GHSA(?:-[0-9a-z]{4}){3} + +# URL escaped characters +\%[0-9A-F]{2} +# uuid: +[<({"'>][0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[<'"})>] +# hex digits including css/html color classes: +(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9a-fA-FgGrR_]{2,}(?:[uU]?[lL]{0,2}|u\d+)\b + +# typo mentioned in changelog as removed +matchingAguments + +# 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 new file mode 100644 index 000000000..a5ba6f639 --- /dev/null +++ b/.github/actions/spelling/reject.txt @@ -0,0 +1,7 @@ +^attache$ +benefitting +occurence +Sorce +^[Ss]pae +^untill +^wether diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml new file mode 100644 index 000000000..9e19386cd --- /dev/null +++ b/.github/workflows/spelling.yml @@ -0,0 +1,93 @@ +name: Spell checking +on: + push: + branches: ["**"] + tags-ignore: ["**"] + pull_request_target: + issue_comment: + types: [created] + +jobs: + spelling: + name: Spell checking + permissions: + contents: read + pull-requests: read + 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 + - name: check-spelling + id: spelling + uses: check-spelling/check-spelling@prerelease + with: + experimental_apply_changes_via_bot: 1 + suppress_push_for_open_pull_request: 1 + post_comment: 0 + - name: store-comment + if: failure() + uses: actions/upload-artifact@v2 + with: + retention-days: 1 + name: "check-spelling-comment-${{ github.run_id }}" + path: | + ${{ steps.spelling.outputs.internal_state_directory }} + + comment: + name: Comment + runs-on: ubuntu-latest + needs: spelling + permissions: + contents: write + pull-requests: write + if: always() && needs.spelling.result == 'failure' + steps: + - name: checkout + uses: actions/checkout@v2 + - name: set up + run: | + mkdir /tmp/data + - name: retrieve-comment + uses: actions/download-artifact@v2 + with: + name: "check-spelling-comment-${{ github.run_id }}" + path: /tmp/data + - name: comment + uses: check-spelling/check-spelling@prerelease + with: + experimental_apply_changes_via_bot: 1 + custom_task: comment + internal_state_directory: /tmp/data + + update: + name: Update PR + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + if: ${{ + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + contains(github.event.comment.body, '@check-spelling-bot apply') + }} + concurrency: + group: spelling-update-${{ github.event.issue.number }} + cancel-in-progress: false + steps: + - name: checkout + uses: actions/checkout@v2 + - name: check-spelling + uses: check-spelling/check-spelling@prerelease + with: + experimental_apply_changes_via_bot: 1