@@ -30,12 +30,14 @@ repos:
3030 - id : requirements-txt-fixer
3131 - id : trailing-whitespace
3232
33+ # Upgrade old Python syntax
3334- repo : https://github.com/asottile/pyupgrade
3435 rev : v2.31.0
3536 hooks :
3637 - id : pyupgrade
3738 args : [--py3-plus]
3839
40+ # Nicely sort includes
3941- repo : https://github.com/PyCQA/isort
4042 rev : 5.10.1
4143 hooks :
4749 hooks :
4850 - id : black
4951
52+ # Also code format the docs
5053- repo : https://github.com/asottile/blacken-docs
5154 rev : v1.12.1
5255 hooks :
@@ -66,12 +69,15 @@ repos:
6669 hooks :
6770 - id : pycln
6871
72+ # Checking for common mistakes
6973- repo : https://github.com/pre-commit/pygrep-hooks
7074 rev : v1.9.0
7175 hooks :
7276 - id : python-check-blanket-noqa
7377 - id : python-check-blanket-type-ignore
7478 - id : python-no-log-warn
79+ # Python 3.6
80+ # - id: python-use-type-annotations
7581 - id : rst-backticks
7682 - id : rst-directive-colons
7783 - id : rst-inline-touching-normal
8692 - pep8-naming
8793 exclude : ^(docs/.*|tools/.*)$
8894
95+ # Automatically remove noqa that are not used
8996- repo : https://github.com/asottile/yesqa
9097 rev : v1.3.0
9198 hooks :
@@ -106,9 +113,9 @@ repos:
106113 rev : v0.931
107114 hooks :
108115 - id : mypy
109- # Running per-file misbehaves a bit, so just run on all files, it's fast
110- pass_filenames : false
111- additional_dependencies : [typed_ast ]
116+ args : [--show-error-codes]
117+ exclude : ^(tests|docs)/
118+ additional_dependencies : [nox, rich ]
112119
113120# Checks the manifest for missing files (native support)
114121- repo : https://github.com/mgedmin/check-manifest
@@ -119,27 +126,30 @@ repos:
119126 stages : [manual]
120127 additional_dependencies : [cmake, ninja]
121128
129+ # Check for spelling
122130- repo : https://github.com/codespell-project/codespell
123131 rev : v2.1.0
124132 hooks :
125133 - id : codespell
126134 exclude : " .supp$"
127135 args : ["-L", "nd,ot,thist"]
128136
137+ # Check for common shell mistakes
129138- repo : https://github.com/shellcheck-py/shellcheck-py
130139 rev : v0.8.0.4
131140 hooks :
132141 - id : shellcheck
133142
134- # The original pybind11 checks for a few C++ style items
143+ # Disallow some common capitalization mistakes
135144- repo : local
136145 hooks :
137146 - id : disallow-caps
138147 name : Disallow improper capitalization
139148 language : pygrep
140149 entry : PyBind|Numpy|Cmake|CCache|PyTest
141- exclude : .pre-commit-config.yaml
150+ exclude : ^\ .pre-commit-config.yaml$
142151
152+ # The original pybind11 checks for a few C++ style items
143153- repo : local
144154 hooks :
145155 - id : check-style
0 commit comments