Skip to content

Commit 5d1519b

Browse files
DanielNoordPierre-Sassoulas
authored andcommitted
Only run spelling checks in CI with manual hook
1 parent 9b4d466 commit 5d1519b

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.github/workflows/checks.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,18 @@ jobs:
114114
run: |
115115
echo "Failed to restore pre-commit environment from cache"
116116
exit 1
117+
- name: Install enchant and aspell
118+
run: |
119+
sudo apt-get update
120+
sudo apt-get install enchant aspell-en
117121
- name: Run pylint checks
118122
run: |
119123
. venv/bin/activate
120124
pip install -e .
121-
pre-commit run pylint --all-files
125+
pre-commit run --hook-stage manual pylint-with-spelling --all-files
122126
123127
spelling:
124-
name: spelling
128+
name: spelling tests
125129
runs-on: ubuntu-latest
126130
timeout-minutes: 5
127131
needs: prepare-base

.pre-commit-config.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ repos:
6363
types: [python]
6464
args: ["-rn", "-sn", "--rcfile=pylintrc", "--fail-on=I"]
6565
exclude: tests/functional/|tests/input|tests(/\w*)*data/|doc/
66+
# We define an additional manual step to allow running pylint with a spelling
67+
# checker in CI.
68+
- id: pylint
69+
alias: pylint-with-spelling
70+
name: pylint
71+
entry: pylint
72+
language: system
73+
types: [python]
74+
args: ["-rn", "-sn", "--rcfile=pylintrc", "--fail-on=I", "--spelling-dict=en"]
75+
exclude: tests/functional/|tests/input|tests(/\w*)*data/|doc/
76+
stages: [manual]
6677
- id: fix-documentation
6778
name: Fix documentation
6879
entry: python3 -m script.fix_documentation

pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ missing-member-max-choices=1
392392

393393
# Spelling dictionary name. Available dictionaries: none. To make it working
394394
# install python-enchant package.
395-
spelling-dict=en_US
395+
spelling-dict=
396396

397397
# List of comma separated words that should not be checked.
398398
spelling-ignore-words=

0 commit comments

Comments
 (0)