Skip to content

Commit

Permalink
Add actions/spelling config
Browse files Browse the repository at this point in the history
.github/actions/spelling configuration was added for the
@check-spelling/check-spelling action.

Changelist:
- .github/actions/spelling
  - Add allow.txt with new allowed words
  - Add excludes.txt to exclude files based on common glob patterns
  - Add patterns.txt to ignore URLs, paths, configs, etc.

Additional Notes:
Spelling (minor):
An additional expect.txt file will have to be added in order to
accommodate incorrect words found in files or comments will have to be
added to those lines.
  • Loading branch information
quantum9Innovation committed Jul 20, 2021
1 parent bf8cb61 commit fd01c8f
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codebase
codecov
codefactor
codeowner
CODEOWNERS
codeql
conda
config
Expand All @@ -25,6 +26,7 @@ deepsource
dirname
Django
docstring
docstrings
doi
epidemiologists
epispot
Expand All @@ -41,6 +43,7 @@ google
homepage
html
http
https
ICU
img
infecteds
Expand Down Expand Up @@ -99,6 +102,7 @@ sys
timerange
timespans
timestep
timesteps
toml
towardsdatascience
ubuntu
Expand All @@ -112,6 +116,7 @@ versionadded
vscode
Website
workflow
workflows
www
xml
yml
Expand Down
21 changes: 21 additions & 0 deletions .github/actions/spelling/excludes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Ignore directories named `third_party`
(?:^|/)third_party/
# Ignore npm files
(?:^|/)package(?:-lock|)\.json$
# Ignore files named (yarn for Node.js) `yarn.lock`
(?:^|/)yarn\.lock$
# Ignore files or directories that case-insensitively have `LICENSE` somewhere in their path
(?:(?i)LICENSE)
# Ignore files ending in...
\.pdf$
\.png$
# Ignore Excel files (`.xsl` and `.xslx`)
\.xslx?$
# Ignore locales that aren't en / en_GB (roughly: keep en_US and drop everything else)
locales/(?!en)
locales/en_GB
# Ignore the action's configuration data
^\.github/action/spelling/
# Ignore common configuration files
*config*
*cache*
96 changes: 96 additions & 0 deletions .github/actions/spelling/patterns.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# This file contains various spellcheck patterns for @check-spelling/check-spelling
# and is used in the spellcheck workflow. See ../../workflows/spellcheck.yml for more information.

# marker to ignore all code on line
^.*/\* #no-spell-check-line \*/.*$
# marker for ignoring a comment to the end of the line
// #no-spell-check.*$

# git index header
index [0-9a-z]{7,40}\.\.[0-9a-z]{7,40}

# data urls
(['"])data:.*?\g{-1}
data:[-a-zA-Z=;:/0-9+]*,\S*

# Any `http://` or `https://` URL
https?://*

# 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/[^/]+\)

# bit.ly
\bbit\.ly/\w+

# gravatar
\bgravatar\.com/avatar/[0-9a-f]+

# medium
link\.medium\.com/[a-zA-Z0-9]+

# Slack
slack://[a-zA-Z0-9?&=]+
\bslack\.com/[-0-9a-zA-Z/_]*

# stackexchange -- https://stackexchange.com/feeds/sites
\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/questions/\d+/[a-z-]+

# URL escaped characters
\%[0-9A-F]{2}
# c99 hex digits (not the full format, just one I've seen)
0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP]
# sha256
sha256:[0-9a-f]+
# sha-... -- uses a fancy capture
(['"]|")[0-9a-f]{40,}\g{-1}
# hex in url queries
=[0-9a-fA-F]+&
# PGP
\b(?:[0-9A-F]{4} ){9}[0-9A-F]{4}\b
# 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
# uuid:
[<({"'>][0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[<'"})>]

# Input to GitHub JSON
content: "[-a-zA-Z=;:/0-9+]*="

# python f-string https://www.python.org/dev/peps/pep-0498/
\bf'

# Regular expressions for (P|p)assword
\([A-Z]\|[a-z]\)[a-z]+

# JavaScript regular expressions
/.*/[gim]*\.test\(
\.replace\(/[^/]*/[gim]*\s*,

# the negative lookahead here is to allow catching 'templatesz' as a misspelling
# but to otherwise recognize a Windows path with \templates\foo.template or similar:
\\templates(?![a-z])
# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b

# Compiler flags
[\t >"`](?:-J|)-[DPWXY]
[\t "`]-[DPWXYLl]
# curl arguments
\b(?:\\n|)curl(?:\s+-[a-zA-Z]+)+
# set arguments
\bset\s+-[abefiuox]+\b
# tar arguments
\b(?:\\n|)tar(?:\s+-[a-zA-Z]+|\s[a-z]+)+
# macOS temp folders
/var/folders/\w\w/\w+/T/

0 comments on commit fd01c8f

Please sign in to comment.