Using Pre-commit

In addition to running the style check yourself, it is possible to configure a precommit-hook, which will run the style check before committing (git commit). The pre-commit is configured in the .pre-commit-config.yaml configuration file.

  1. You will need to install the dependency pre-commit and set up the hook:

    pip3 install pre-commit
    pre-commit install
    
  2. Check the hook (or do git commit):

    pre-commit run --all
    

See also

If you want to commit without checking the tests, you need to add the option –no-verify

git commit -m "your message" --no-verify