Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add spellchecking to pre-commit hooks and linting workflow #92

Merged
merged 28 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
88a5dc8
Configure cspell and fix typos
eliykat Apr 20, 2023
9964f51
Install cspell as dev dependency
eliykat Apr 20, 2023
d54aee8
Add spellcheck to lint-staged and github workflow
eliykat Apr 20, 2023
5c46003
Use yaml for cspell config
eliykat Apr 20, 2023
8f7018f
Run prettier
eliykat Apr 20, 2023
251989b
Fix in-line code regex
eliykat Apr 21, 2023
8f7e1fe
Add documentation
eliykat Apr 21, 2023
3770814
Merge branch 'master' into cspell
eliykat Apr 21, 2023
0fde9ab
Fix typos in mdx files and fix regexes
eliykat Apr 21, 2023
adca424
Use named patterns, update package.json
eliykat Apr 21, 2023
59c0e43
Run prettier and update lint-staged
eliykat Apr 21, 2023
dc52414
Fix indentation
eliykat Apr 21, 2023
fb7f9d2
Merge branch 'master' into cspell
eliykat May 30, 2023
362a76a
Reinstall cspell after merge
eliykat May 30, 2023
f82600c
Install additional cspell dependencies
eliykat May 30, 2023
7069203
Remove cspell
eliykat May 30, 2023
ceb334f
Revert "Remove cspell"
eliykat May 30, 2023
f140b0e
Remove extra line break
eliykat May 30, 2023
d9977be
Merge branch 'fix-typos' into cspell
eliykat May 30, 2023
2d97ca1
Fix typo
eliykat May 30, 2023
9439c9a
Merge branch 'fix-typos' into cspell
eliykat May 30, 2023
6fda68e
Merge branch 'master' into cspell
eliykat Jun 2, 2023
b287202
Merge branch 'master' into cspell
eliykat Jul 17, 2023
5fcd34b
re-install cspell after merge
eliykat Jul 17, 2023
f384469
Add quotes around spellcheck glob pattern
eliykat Jul 17, 2023
5d20622
Update custom words
eliykat Jul 17, 2023
a2e4586
Merge branch 'master' into cspell
eliykat Jul 17, 2023
d45de8c
Reinstall cspell after merge
eliykat Jul 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ jobs:
cache-dependency-path: "**/package-lock.json"
node-version: "18"

- name: Run linter
- name: Run linter and spellcheck
run: |
npm ci
npm run lint
npm run spellcheck
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ Please follow the following (very brief) style guide:
- Use code blocks for all commands. Don't write them in-line.
- Avoid long paragraphs - this documentation should be to-the-point and instructional.

### Spellchecker

We use `cspell` for spellchecking. It will run as a pre-commit hook and in the CI pipeline.
Spellchecking ignores single and multi-line code snippets. If required, you can add custom words
(e.g. proper nouns and technical terms) to `custom-words.txt`.

### Conditional Content

The Contributing Docs site is used both for internal and external contributors. To this end we've
Expand Down
36 changes: 36 additions & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
dictionaries:
- custom-words
dictionaryDefinitions:
- name: custom-words
path: ./custom-words.txt
addWords: true
patterns:
# Ignore multi-line code blocks
# Ref: https://cspell.org/configuration/patterns/
# Modified to avoid matching line breaks before/after which had unexpected results
- name: markdown_code_block
pattern: |
/
^[ \t]* # match optional whitespace before the ```
(`{3}).* # match the ``` and any optional language specification afterwards
[\s\S]*? # the block of code
^[ \t]* # match optional whitespace before the ```
\1 # end of the block
/gmx

# Ignore inline code blocks
- name: markdown_code_inline
pattern: |
/
` # match the opening `
.*? # match any characters, lazily (so that we stop at the next tilde)
` # match the closing `
/gx
languageSettings:
- languageId:
- markdown
- mdx
ignoreRegExpList:
- markdown_code_block
- markdown_code_inline
54 changes: 54 additions & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Custom dictionary for spellchecking
# Before adding a word here, consider whether you can put it in a single (`) or multiline (```) code snippet instead,
# as they are automatically ignored by the spellchecker

Bitwarden
bytemark
CQRS
dockerized
hotfix
hotfixes
hotfixed
inet
Iterm
jslib
jumpcloud
keychain
keyserver
LDIF
LLDB
Mailcatcher
minio
MVVM
NGRX
Omnisharp
opid
passcode
passwordless
PNSs
proxied
roadmap
roadmaps
SCIM
SDET
signtool
signup
sqlcmd
TOTP
Yellowpages
CODEOWNERS
SDLC
subprocessor
Gitter
IntelliJ
WCAG
pinentry
refactorings
toolset
keypair
onboarded
OIDCS
oktapreview
Xcodes.app
YubiKey
Yubico
Loading