|
| 1 | +# Keeping the hooks versions up to date can be done by running `pre-commit autoupdate` validate that the examples still pass correctly before pushing the updated version changes |
| 2 | +repos: |
| 3 | +- repo: https://github.com/pre-commit/pre-commit-hooks |
| 4 | + rev: v5.0.0 |
| 5 | + hooks: # Available hooks https://github.com/pre-commit/pre-commit-hooks/blob/main/README.md |
| 6 | + # Git style |
| 7 | + - id: check-added-large-files # prevents giant files from being committed. |
| 8 | + - id: check-merge-conflict # checks for files that contain merge conflict strings. |
| 9 | + - id: check-vcs-permalinks # ensures that links to vcs websites are permalinks. |
| 10 | + - id: no-commit-to-branch # Protect specific branches from direct commits. |
| 11 | + args: [--branch, main] # Protected in the repo config. but this will prevent you even getting that far |
| 12 | + # Common errors |
| 13 | + - id: end-of-file-fixer # Ensures that a file is either empty, or ends with one newline. |
| 14 | + - id: trailing-whitespace # Trims trailing whitespace. |
| 15 | + args: [--markdown-linebreak-ext=md] # Preserve hard line breaks in MD files |
| 16 | + - id: check-yaml # Attempts to load all yaml files to verify syntax. |
| 17 | + - id: check-executables-have-shebangs # Checks that non-binary executables have a proper shebang. |
| 18 | + # Cross platform |
| 19 | + - id: check-case-conflict # Check for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT. |
| 20 | + - id: mixed-line-ending # Replaces or checks mixed line ending. |
| 21 | + args: [--fix=lf] # Forces to replace line ending with LF |
| 22 | + # Security |
| 23 | + - id: detect-aws-credentials # Checks for the existence of AWS secrets that you have set up with the AWS CLI. |
| 24 | + args: ['--allow-missing-credentials'] # Allow hook to pass when no credentials are detected. |
| 25 | + - id: detect-private-key # Checks for the existence of private keys. |
| 26 | + |
| 27 | +- repo: https://github.com/zricethezav/gitleaks |
| 28 | + rev: v8.23.3 |
| 29 | + hooks: |
| 30 | + - id: gitleaks |
| 31 | + |
| 32 | +- repo: https://github.com/DavidAnson/markdownlint-cli2 |
| 33 | + rev: v0.18.1 |
| 34 | + hooks: |
| 35 | + - id: markdownlint-cli2 |
0 commit comments