To try the package, simply install it (in a virtualenv or globally) and run flake8 on a project with at least one Python (
$ cd /path/to/my/python/project # Install using pip: $ pip install -U nitpick # Or using Poetry: $ poetry add --dev nitpick $ flake8 .
You can use it as a template to Configure your own style.
Run as a pre-commit hook (recommended)¶
If you use pre-commit on your project (you should), add this to the
.pre-commit-config.yaml in your repository:
repos: - repo: https://github.com/andreoliwa/nitpick rev: v0.23.1 hooks: - id: nitpick
To install the
commit-msg Git hooks:
pre-commit install --install-hooks pre-commit install -t commit-msg
To start checking all your code against the default rules:
pre-commit run --all-files