diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcfdb7209a5b..04f8a02cb980 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,3 +28,14 @@ repos: - id: flake8 additional_dependencies: [pydocstyle>5.1.0, flake8-docstrings>1.4.0] args: ["--docstring-convention=all"] + - repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + files: ^.*\.(py|c|cpp|h|m|md|rst|yml)$ + args: [ + "--ignore-words", + "ci/codespell-ignore-words.txt", + "--skip", + "doc/users/project/credits.rst" + ] diff --git a/ci/codespell-ignore-words.txt b/ci/codespell-ignore-words.txt new file mode 100644 index 000000000000..70366f6b3552 --- /dev/null +++ b/ci/codespell-ignore-words.txt @@ -0,0 +1,17 @@ +ans +axises +ba +cannotation +coo +curvelinear +flate +hist +inout +ment +nd +oly +sur +te +thisy +whis +wit diff --git a/lib/matplotlib/tests/test_cbook.py b/lib/matplotlib/tests/test_cbook.py index cf2009c5a44a..872e9b9c39d9 100644 --- a/lib/matplotlib/tests/test_cbook.py +++ b/lib/matplotlib/tests/test_cbook.py @@ -420,7 +420,7 @@ def test_func2(): ('# only comment "with quotes" xx', ''), ]) def test_strip_comment(line, result): - """Strip everything from the first unqouted #.""" + """Strip everything from the first unquoted #.""" assert cbook._strip_comment(line) == result