A collection of useful pre-commit hooks
Detect auto-named migrations eg. 0000_auto_202012251330.py
Detect any URL paths in urls.py
without a trailing slash
Detect has_perm
or @permission_required
usage with an invalid perm (eg. has_perm("core:add_user")
)
- Update regex for
permission_required
to account for multiple permissions eg. detect@permission_required(["user.change_user", "user:add_user"])
Create a virtual env and install the requirements:
pip install -r requirements/test.txt
Run the tests:
pytest