Skip to content

Commit db9c123

Browse files
committed
lint: add codespell to lint for typos
Supports both `reformat` and `lint`. Signed-off-by: Mike Fiedler <[email protected]>
1 parent 52b9fd0 commit db9c123

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

bin/lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ sphinx-lint --enable=all --disable=line-too-long README.rst CONTRIBUTING.rst doc
1010
python -m djlint --check --lint ./warehouse/templates ./docs/blog
1111
python -m mypy -p warehouse
1212
./bin/flushes
13+
codespell

bin/reformat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
set -ex
33

4+
# Fix typos before other changes, as they may affect formatting.
5+
codespell --write
46
find . -name '*.py' -exec python -m pyupgrade --py313-plus {} +
57
python -m isort *.py warehouse/ tests/
68
python -m black *.py warehouse/ tests/

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,20 @@ filterwarnings = [
129129
# TODO: This can be removed once it becomes the default.
130130
# See: https://github.com/jazzband/pip-tools/issues/989
131131
allow-unsafe = true
132+
133+
[tool.codespell]
134+
ignore-words-list = "deriver"
135+
skip = [
136+
'*.po',
137+
'./dev/.mypy_cache/*',
138+
'./dev/.pytest_cache/*',
139+
'./docs/blog-site/*',
140+
'./docs/dev/_build/*',
141+
'./docs/user-site/*',
142+
'./htmlcov/*',
143+
'./node_modules/**',
144+
'./package-lock.json',
145+
'./warehouse/admin/static/dist/*',
146+
'./warehouse/static/dist/*',
147+
'./warehouse/static/js/vendor/zxcvbn.js',
148+
]

requirements/lint.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
codespell
12
djlint
23
flake8
34
flake8-pytest-style

requirements/lint.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ click==8.2.1 \
115115
# via
116116
# black
117117
# djlint
118+
codespell==2.4.1 \
119+
--hash=sha256:299fcdcb09d23e81e35a671bbe746d5ad7e8385972e65dbb833a2eaac33c01e5 \
120+
--hash=sha256:3dadafa67df7e4a3dbf51e0d7315061b80d265f9552ebd699b3dd6834b47e425
121+
# via -r requirements/lint.in
118122
colorama==0.4.6 \
119123
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
120124
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6

0 commit comments

Comments
 (0)