Skip to content

Commit e5de01a

Browse files
Add configuration for running codespell locally (python#2151)
Co-authored-by: CAM Gerlach <[email protected]>
1 parent 3eeb003 commit e5de01a

File tree

5 files changed

+45
-3
lines changed

5 files changed

+45
-3
lines changed

.codespell/exclude-file.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
of scoped seem allright. I still think there is not enough need
2+
3+
da de dum, hmm, hmm, dum de dum.
4+
5+
output=`dmesg | grep hda`
6+
p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
7+
8+
Error-de_DE=Wenn ist das Nunstück git und Slotermeyer?
9+
Ja! Beiherhund das Oder die Virtualenvironment gersput!

.codespell/ignore-words.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
adaptee
2+
ans
3+
arithmetics
4+
asend
5+
ba
6+
clos
7+
complies
8+
crate
9+
extraversion
10+
fo
11+
iif
12+
nd
13+
ned
14+
recuse
15+
reenable
16+
therefor
17+
warmup

.codespellrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[codespell]
2+
skip = ./.git
3+
ignore-words = .codespell/ignore-words.txt
4+
exclude-file = .codespell/exclude-file.txt
5+
uri-ignore-words-list = daa,ist,searchin,theses

.pre-commit-config.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
33
rev: v3.4.0
44
hooks:
5-
- id: mixed-line-ending
6-
name: Normalize mixed line endings
7-
args: [--fix=lf]
5+
- id: mixed-line-ending
6+
name: Normalize mixed line endings
7+
args: [--fix=lf]
88

99
- repo: https://github.com/pre-commit/pygrep-hooks
1010
rev: v1.8.0
@@ -17,6 +17,13 @@ repos:
1717
files: '^pep-\d+\.txt|\.rst$'
1818
types: [text]
1919

20+
- repo: https://github.com/codespell-project/codespell
21+
rev: v2.1.0
22+
hooks:
23+
- id: codespell
24+
name: Check for common misspellings in text files
25+
stages: [manual]
26+
2027
- repo: local
2128
hooks:
2229
- id: check-required-fields

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ lint:
5555
pre-commit --version > /dev/null || python3 -m pip install pre-commit
5656
pre-commit run --all-files
5757

58+
spellcheck:
59+
pre-commit --version > /dev/null || python3 -m pip install pre-commit
60+
pre-commit run --all-files --hook-stage manual codespell
61+
5862
# New Sphinx targets:
5963

6064
SPHINX_JOBS=8

0 commit comments

Comments
 (0)