Skip to content

Commit 8e231bb

Browse files
committed
Add check-spelling
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
1 parent b50ce59 commit 8e231bb

8 files changed

Lines changed: 131 additions & 0 deletions

File tree

.github/actions/spelling/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# check-spelling/check-spelling configuration
2+
3+
File | Purpose | Format | Info
4+
-|-|-|-
5+
[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)
6+
[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)
7+
[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)
8+
[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes)
9+
[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)
10+
[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)
11+
[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)
12+
[advice.txt](advice.txt) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice)
13+
14+
Note: you can replace any of these files with a directory by the same name (minus the suffix)
15+
and then include multiple files inside that directory (with that suffix) to merge multiple files together.

.github/actions/spelling/advice.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!-- See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice --> <!-- markdownlint-disable MD033 MD041 -->
2+
<details><summary>If you see a bunch of garbage</summary>
3+
4+
If it relates to a ...
5+
<details><summary>well-formed pattern</summary>
6+
7+
See if there's a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it.
8+
9+
If not, try writing one and adding it to the `patterns.txt` file.
10+
11+
Patterns are Perl 5 Regular Expressions - you can [test](
12+
https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines.
13+
14+
Note that patterns can't match multiline strings.
15+
</details>
16+
<details><summary>binary-ish string</summary>
17+
18+
Please add a file path to the `excludes.txt` file instead of just accepting the garbage.
19+
20+
File paths are Perl 5 Regular Expressions - you can [test](
21+
https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files.
22+
23+
`^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md](
24+
../tree/HEAD/README.md) (on whichever branch you're using).
25+
</details>
26+
27+
</details>

.github/actions/spelling/allow.txt

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
2+
(?:^|/)(?i)COPYRIGHT
3+
(?:^|/)(?i)LICEN[CS]E
4+
(?:^|/)package(?:-lock|)\.json$
5+
(?:^|/)vendor/
6+
ignore$
7+
\.avi$
8+
\.ico$
9+
\.jpe?g$
10+
\.lock$
11+
\.map$
12+
\.min\.
13+
\.mod$
14+
\.mp[34]$
15+
\.png$
16+
\.wav$
17+
^pack/font/opendyslexic-regular\.otf$
18+
^pack/font/opendyslexic-regular\.svg$
19+
^pack/font/opendyslexic-regular\.ttf$
20+
^pack/font/opendyslexic-regular\.woff$
21+
^pack/font/stylesheetBase64\.css$
22+
^pack/font/stylesheet\.css$
23+
^\.github/
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
comepic
2+
concat
3+
Cornsilk
4+
css
5+
cssbeautify
6+
dest
7+
Dyslexie
8+
Gainsboro
9+
html
10+
https
11+
javascript
12+
json
13+
lstat
14+
mkdir
15+
nodejs
16+
npm
17+
npmjs
18+
opendyslexicregular
19+
png
20+
readdir
21+
readibility
22+
redefinable
23+
rmdir
24+
src
25+
stylesheet
26+
url
27+
utf
28+
webkit
29+
www
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns
2+
3+
# hex digits including css/html color classes:
4+
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9a-fA-FgGrR_]{2,}(?:[uU]?[lL]{0,2}|u\d+)\b
5+
'[0-9a-f]{6}'
6+
7+
# ignore long runs of a single character:
8+
\b([A-Za-z])\g{-1}{3,}\b
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
^attache$
2+
benefitting
3+
occurence
4+
Sorce
5+
^[Ss]pae
6+
^untill
7+
^wether

.github/workflows/spelling.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Spell checking
2+
on:
3+
pull_request_target:
4+
push:
5+
issue_comment:
6+
7+
jobs:
8+
spelling:
9+
name: Spell checking
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout-merge
13+
if: "contains(github.event_name, 'pull_request')"
14+
uses: actions/checkout@v2.0.0
15+
with:
16+
ref: refs/pull/${{github.event.pull_request.number}}/merge
17+
- name: checkout
18+
if: "!contains(github.event_name, 'pull_request')"
19+
uses: actions/checkout@v2.0.0
20+
- uses: check-spelling/check-spelling@prerelease
21+
with:
22+
experimental_apply_changes_via_bot: 1

0 commit comments

Comments
 (0)