A collection of fast, cheap, regex based pre-commit hooks.
Adding to your
- repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 # Use the ref you want to point at hooks: - id: python-use-type-annotations # ...
Where possible, these hooks will be prefixed with the file types they target.
For example, a hook which targets python will be called
python-check-blanket-noqa: Enforce that
noqaannotations always occur with specific codes. Sample annotations:
# noqa: F401,
# noqa: F401,W203
python-check-blanket-type-ignore: Enforce that
# type: ignoreannotations always occur with specific codes. Sample annotations:
# type: ignore[attr-defined],
# type: ignore[attr-defined, name-defined]
python-check-mock-methods: Prevent common mistakes of
python-no-eval: A quick check for the
python-no-log-warn: A quick check for the deprecated
.warn()method of python loggers
python-use-type-annotations: Enforce that python3.6+ type annotations are used instead of type comments
rst-backticks: Detect common mistake of using single backticks when writing rst
rst-directive-colons: Detect mistake of rst directive not ending with double colon
rst-inline-touching-normal: Detect mistake of inline code touching normal text in rst
text-unicode-replacement-char: Forbid files which have a UTF-8 Unicode replacement character