Skip to content

Commit

Permalink
Update check-spelling to v0.0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Aug 31, 2022
1 parent fb982db commit f4ba173
Show file tree
Hide file tree
Showing 9 changed files with 220 additions and 17 deletions.
16 changes: 16 additions & 0 deletions .github/actions/spelling-data/README.md
Original file line number Diff line number Diff line change
@@ -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.
25 changes: 25 additions & 0 deletions .github/actions/spelling-data/advice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice --> <!-- markdownlint-disable MD033 MD041 -->
<details><summary>If the flagged items are false positives</summary>

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.

</details>
4 changes: 4 additions & 0 deletions .github/actions/spelling-data/allow.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github
https
ssh
ubuntu
50 changes: 49 additions & 1 deletion .github/actions/spelling-data/excludes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
(?:^|/)(?i)COPYRIGHT
(?:^|/)(?i)LICEN[CS]E
(?:^|/)go\.sum$
(?:^|/)package(?:-lock|)\.json$
(?:^|/)vendor/
ignore$
\.a$
\.ai$
\.avi$
\.bmp$
\.bz2$
\.crt$
\.dll$
\.DS_Store$
\.eot$
\.exe$
\.gif$
\.gitattributes$
\.graffle$
\.gz$
\.icns$
\.ico$
\.jar$
\.jpe?g$
\.key$
\.lib$
\.lock$
\.map$
\.min\..
\.mod$
\.mp[34]$
\.o$
\.ocf$
\.otf$
\.pdf$
\.pem$
\.png$
\.psd$
\.s$
\.svg$
\.tiff?$
\.ttf$
\.wav$
\.webm$
\.webp$
\.woff2?$
\.zip$
/values\.yaml$
\.[^./]*ignore$
^\.github/actions/spelling-data/
^\Q.github/workflows/spelling.yml\E$
4 changes: 1 addition & 3 deletions .github/actions/spelling-data/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ args
config
configmap
Cron
Envs
filetype
fthomas
fullname
garnercorp
github
githubusercontent
helmv
http
kube
kubectl
Expand All @@ -29,7 +28,6 @@ scalafix
stefanprodan
tpl
trunc
ubuntu
unshallow
Workflow
www
Expand Down
56 changes: 56 additions & 0 deletions .github/actions/spelling-data/line_forbidden.patterns
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere
# \bm_data\b

# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test,
# you might not want to check in code where you were debugging w/ `fit()`, in which case, you might want
# to use this:
#\bfit\(

# 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. into
\bin to\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
24 changes: 23 additions & 1 deletion .github/actions/spelling-data/patterns.txt
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
\b([A-Za-z])\1{3,}\b
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns

# Automatically suggested patterns
# hit-count: 2 file-count: 2
# version suffix <word>v#
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))

# 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

# Commit message -- Signed-off-by and friends
^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$

# Autogenerated revert commit message
^This reverts commit [0-9a-f]{40}\.$

# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b
10 changes: 10 additions & 0 deletions .github/actions/spelling-data/reject.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
^attache$
benefitting
occurences?
^dependan.*
^oer$
Sorce
^[Ss]pae.*
^untill$
^untilling$
^wether.*
48 changes: 36 additions & 12 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,46 @@ name: Spell checking

on:
push:
branches:
- "**"
tags-ignore:
- "**"
branches: ["**"]
tags-ignore: ["**"]

jobs:
build:
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:
- uses: actions/[email protected]
- name: check-spelling
id: spelling
uses: check-spelling/[email protected]
with:
fetch-depth: 2
- uses: check-spelling/[email protected]
env:
bucket: .github/actions
project: spelling-data
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
config: .github/actions/spelling-data
checkout: true
check_extra_dictionaries: ''
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/[email protected]
with:
config: .github/actions/spelling-data
checkout: true
task: ${{ needs.spelling.outputs.followup }}

0 comments on commit f4ba173

Please sign in to comment.