Add pre-commit configuration for linters.

This patch adds another lever of linter checking for ansible-freeipa
by enabling linters to run on the developer machine, before pushing
changes to be evaluated on the CI, allowing code fixes without
wating for CI to run the linters on the repository.

To enable pre-commit hooks, `pre-commit` is used, and was added to
requirements-dev.txt, and can be installed with pip
(`pip install -r requirements-dev.txt`). Once installed, on every
commit, YAML and python files on the commit will be evaluated.

If one needs to bypass the pre-commit linters, `git commit` can be
issued with `--no-verify`.

The linters will not be removed from the CI, as a commit can be
performed without running the checks.
This commit is contained in:
Rafael Guterres Jeffman
2020-09-11 17:46:54 -03:00
parent 93cf008429
commit 8c7d57e98f
2 changed files with 32 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
-r requirements-tests.txt
ipdb
pre-commit