A collection of fast, cheap, regex based pre-commit hooks.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.gitignore
.pre-commit-config.yaml
.pre-commit-hooks.yaml
.travis.yml
README.md
generate-readme

README.md

Build Status

pygrep-hooks

A collection of fast, cheap, regex based pre-commit hooks.

Adding to your .pre-commit-config.yaml

-   repo: https://github.com/pre-commit/pygrep-hooks
    rev: v1.2.0  # Use the ref you want to point at
    hooks:
    -   id: python-use-type-annotations
    # ...

Naming conventions

Where possible, these hooks will be prefixed with the file types they target. For example, a hook which targest python will be called python-....

Provided hooks

  • python-check-blanket-noqa: Enforce that noqa annotations always occur with specific codes
  • python-check-mock-methods: Prevent a common mistake of assert mck.not_called() or assert mck.called_once_with(...)
  • 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