Update hooks; Exclude markdown; Better pre-commit install command (#186)

* Update hooks; Exclude markdown; Better pre-commit install command

* Documented pre-commit more clearly

* Added warning about how pre-commit works
This commit is contained in:
Rojikku authored and GitHub committed 2022-01-09 22:45:00 -05:00
1 parent 088c1d9bcf
commit ee2f7e9a38
3 files changed
+17 -4

No files matched your search

+3 -2
View File
@@ -9,9 +9,10 @@ repos:
- .github/lint/.yamllint.yaml - .github/lint/.yamllint.yaml
id: yamllint id: yamllint
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1 rev: v4.1.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer - id: end-of-file-fixer
- id: mixed-line-ending - id: mixed-line-ending
- repo: https://github.com/Lucas-C/pre-commit-hooks - repo: https://github.com/Lucas-C/pre-commit-hooks
@@ -24,6 +25,6 @@ repos:
hooks: hooks:
- id: fix-smartquotes - id: fix-smartquotes
- repo: https://github.com/k8s-at-home/sops-pre-commit - repo: https://github.com/k8s-at-home/sops-pre-commit
rev: v2.0.3 rev: v2.1.0
hooks: hooks:
- id: forbid-secrets - id: forbid-secrets
+1 -1
View File
@@ -5,7 +5,7 @@ tasks:
init: init:
desc: Initialize pre-commit hooks desc: Initialize pre-commit hooks
cmds: cmds:
- pre-commit install-hooks - pre-commit install --install-hooks
run: run:
desc: Run pre-commit desc: Run pre-commit
cmds: cmds:
+13 -1
View File
@@ -80,7 +80,19 @@ It is advisable to install [pre-commit](https://pre-commit.com/) and the pre-com
After pre-commit is installed on your machine run: After pre-commit is installed on your machine run:
```sh ```sh
pre-commit install-hooks task pre-commit:init
```
**Remember to run this on each new clone of the repository for it to have effect.**
Commands are of interest, for learning purposes:
This command makes it so pre-commit runs on `git commit`, and also installs environments per the config file.
```
pre-commit install --install-hooks
```
This command checks for new versions of hooks, though it will occasionally make mistakes, so verify its results.
```
pre-commit autoupdate
``` ```
## :open_file_folder:  Repository structure ## :open_file_folder:  Repository structure