Added pre-commit notes to the knowledge base

This commit is contained in:
Michele Cereda
2022-04-17 23:01:10 +02:00
parent c52ed0990d
commit c6bcd19d0c

View File

@@ -0,0 +1,33 @@
# Pre-commit
## TL;DR
```shell
# generate a very basic configuration
pre-commit sample-config > .pre-commit-config.yaml
# manually run checks
pre-commit run --all-files # all checks
pre-commit run ansible-lint # ansible-lint only
# automatically run checks at every commit
pre-commit install
# update all hooks to the latest version
pre-commit autoupdate
# skip check on commit
SKIP=flake8 git commit -m "foo"
```
## Further readings
- List of [supported hooks]
[supported hooks]: https://pre-commit.com/hooks.html
## Sources
- [Website]
[website]: https://pre-commit.com