Skip to content

Commit 55c4082

Browse files
DEV: Add codespell to pre-commit hooks
Add https://github.com/codespell-project/codespell as a pre-commit hook that checks for common misspellings of English words in files with the following extensions: .py, .c, .cpp, .h, .m, .md, .rst, .yml. Ignore instances of: * 'ans', 'axises', 'curvelinear', 'hist', 'nd', 'oly', 'thisy', 'wit' * 'ba' for bound axis and bound args * 'cannotation' for centered annotation * 'coo' for COO (Coordinate list) * 'flate' for Flate compression * 'inout' for lib/matplotlib/rcsetup.py * 'ment' for alignment with formatting * 'whis' for whikser plot * 'sur' for Big Sur * 'TE' for triangle elements and skip checking doc/users/project/credits.rst as the list of names of contributors isn't worth adding in to the ignore file to avoid false positives.
1 parent 6997192 commit 55c4082

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.pre-commit-config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,14 @@ repos:
2828
- id: flake8
2929
additional_dependencies: [pydocstyle>5.1.0, flake8-docstrings>1.4.0]
3030
args: ["--docstring-convention=all"]
31+
- repo: https://github.com/codespell-project/codespell
32+
rev: v2.1.0
33+
hooks:
34+
- id: codespell
35+
files: ^.*\.(py|c|cpp|h|m|md|rst|yml)$
36+
args: [
37+
"--ignore-words",
38+
"ci/codespell-ignore-words.txt",
39+
"--skip",
40+
"doc/users/project/credits.rst"
41+
]

ci/codespell-ignore-words.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ans
2+
axises
3+
ba
4+
cannotation
5+
coo
6+
curvelinear
7+
flate
8+
hist
9+
inout
10+
ment
11+
nd
12+
oly
13+
sur
14+
te
15+
thisy
16+
whis
17+
wit

0 commit comments

Comments
 (0)