diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..ff6f5138 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +--- +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: check-added-large-files + - id: check-merge-conflict + - id: check-symlinks + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace diff --git a/README.md b/README.md index a9daa917..8b13c4eb 100644 --- a/README.md +++ b/README.md @@ -33,3 +33,22 @@ mkdocs.yml) - TBD or TODO is visible on website There should be no TBD or TODO visible on website. + +# pre-commit hooks + +* [Install pre-commit](https://pre-commit.com/index.html#install) + +* Install hooks into repo: + +``` +pre-commit install +``` + +* Enjoy automatic checks on each `git commit` action! + +* (Optional) Run hooks on all files (for example, when adding new hooks or + configuring existing ones): + +```bash +pre-commit run --all-files +```