Skip to content

Commit

Permalink
ci!: run cspell as pre-commit hook (#76)
Browse files Browse the repository at this point in the history
* docs: update notes about cSpell on developer page
  • Loading branch information
redeboer authored Mar 28, 2021
1 parent c9db7ba commit 186ed1b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,8 @@ jobs:
python -m pip install --upgrade pip
pip install -r reqs/3.7/requirements-sty.txt
pip install .
sudo npm install -g cspell pyright
sudo npm install -g pyright
- name: Perform style checks
run: pre-commit run -a
- name: Check spelling
run: cspell --no-progress $(git ls-files)
- name: Run pyright
run: pyright
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/ComPWA/mirrors-cspell
rev: v5.3.9
hooks:
- id: cspell

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.25.0
hooks:
Expand Down
10 changes: 4 additions & 6 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ If you have Node.js (`npm`) on your system, you can run a few additional
checks. Install these packages as follows (possibly with administrator rights):

```shell
npm install -g cspell pyright
npm install -g pyright
```

:::
Expand Down Expand Up @@ -355,7 +355,8 @@ Throughout this repository, we follow American English
conventions. As a tool, we use
[cSpell](https://github.com/streetsidesoftware/cspell/blob/master/packages/cspell/README.md),
because it allows to check variable names in camel case and snake case. This
way, a spelling checker helps you avoid mistakes in the code as well!
way, a spelling checker helps you avoid mistakes in the code as well! cSpell is
enforced through pre-commit.

Accepted words are tracked through the {download}`cspell.json <../cspell.json>`
file. As with the other config files, {download}`cspell.json <../cspell.json>`
Expand All @@ -371,10 +372,7 @@ It is easiest to use cSpell in {ref}`develop:Visual Studio Code`, through the
[Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
extension: it provides linting, suggests corrections from the {code}`words`
section, and enables you to quickly add or ignore words through the
{file}`cspell.json` file. Alternatively, you can
[run cSpell](https://www.npmjs.com/package/cspell#installation) on the entire
code base (with {code}`cspell $(git ls-files)`), but for that your system
requires [npm](https://www.npmjs.com).
{file}`cspell.json` file.

## Testing

Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ allowlist_externals =
commands =
mypy src tests # run separately because of potential caching problems
pre-commit run {posargs} -a
- bash -ec "cspell --no-progress $(git ls-files)"

[flake8]
application-import-names =
Expand Down

0 comments on commit 186ed1b

Please sign in to comment.