8000 DEV: Add codespell to pre-commit hooks · matplotlib/matplotlib@711b307 · GitHub
[go: up one dir, main page]

Skip to content

Commit 711b307

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, .h, .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 9caa261 commit 711b307

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.pre-commit-config.yaml

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

ci/codespell-ignore-words.txt

Lines changed: 17 additions & 0 deletions
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)
0