|
| 1 | +default_stages: [pre-commit, pre-push] |
| 2 | +minimum_prek_version: "0.2.22" |
| 3 | +default_language_version: |
| 4 | + python: python3 |
| 5 | + node: 24.13.0 |
| 6 | +exclude: | |
| 7 | + (?x)^( |
| 8 | + \.git/| |
| 9 | + _site/| |
| 10 | + node_modules/| |
| 11 | + package-lock\.json$ |
| 12 | + ) |
| 13 | +
|
| 14 | +repos: |
| 15 | + - repo: meta |
| 16 | + hooks: |
| 17 | + - id: identity |
| 18 | + name: Run identity |
| 19 | + description: Run the identity check |
| 20 | + - id: check-hooks-apply |
| 21 | + name: run check-hooks-apply |
| 22 | + description: check that all the hooks apply to the repository |
| 23 | + |
| 24 | + - repo: local |
| 25 | + hooks: |
| 26 | + - id: check-zip-file-is-not-committed |
| 27 | + name: check no zip files are committed |
| 28 | + description: Zip files are not allowed in the repository |
| 29 | + language: fail |
| 30 | + entry: | |
| 31 | + Zip files are not allowed in the repository as they are hard to |
| 32 | + track and have security implications. Please remove the zip file from the repository. |
| 33 | + files: (?i)\.zip$ |
| 34 | + - id: npm-ci |
| 35 | + name: run npm-ci |
| 36 | + description: Install Node dependencies |
| 37 | + entry: npm ci |
| 38 | + language: system |
| 39 | + pass_filenames: false |
| 40 | + - id: eleventy-build-check |
| 41 | + name: run eleventy-build-check |
| 42 | + description: Eleventy build and output check |
| 43 | + entry: npm run build |
| 44 | + language: system |
| 45 | + pass_filenames: false |
| 46 | + - id: npm-audit |
| 47 | + name: run npm-audit |
| 48 | + description: Run npm audit |
| 49 | + entry: npm audit --audit-level=high |
| 50 | + language: system |
| 51 | + pass_filenames: false |
| 52 | + |
| 53 | + # GO-based |
| 54 | + # - repo: https://github.com/gitleaks/gitleaks |
| 55 | + # rev: v8.30.0 |
| 56 | + # hooks: |
| 57 | + # - id: gitleaks |
| 58 | + # name: Run gitleaks |
| 59 | + # description: Check for secrets with gitleaks |
| 60 | + |
| 61 | + - repo: https://github.com/Lucas-C/pre-commit-hooks |
| 62 | + rev: v1.5.6 |
| 63 | + hooks: |
| 64 | + - id: chmod |
| 65 | + name: Set file permissions |
| 66 | + description: Does not run on Windows so setup as a manual hook |
| 67 | + args: ["644"] |
| 68 | + files: \.md$ |
| 69 | + stages: [manual] |
| 70 | + |
| 71 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 72 | + rev: v6.0.0 |
| 73 | + hooks: |
| 74 | + - id: trailing-whitespace |
| 75 | + name: run trailing-whitespace |
| 76 | + description: trims trailing whitespace |
| 77 | + args: [--markdown-linebreak-ext=md] |
| 78 | + - id: end-of-file-fixer |
| 79 | + name: run end-of-file-fixer |
| 80 | + description: makes sure files end in a newline and only a newline |
| 81 | + - id: fix-byte-order-marker |
| 82 | + name: run fix-byte-order-marker |
| 83 | + description: removes UTF-8 byte order marker |
| 84 | + - id: forbid-submodules |
| 85 | + name: run forbid-submodules |
| 86 | + description: forbids any submodules in the repository |
| 87 | + - id: check-yaml |
| 88 | + name: run check-yaml |
| 89 | + description: attempts to load all yaml files to verify syntax |
| 90 | + - id: check-added-large-files |
| 91 | + name: run check-added-large-files |
| 92 | + description: prevent giant files from being committed |
| 93 | + - id: check-json |
| 94 | + name: run check-json |
| 95 | + description: check JSON files for syntax errors |
| 96 | + - id: check-merge-conflict |
| 97 | + name: run check-merge-conflict |
| 98 | + description: check for merge conflict markers |
| 99 | + - id: check-case-conflict |
| 100 | + name: run check-case-conflict |
| 101 | + description: check for case conflicts in file names |
| 102 | + - id: check-vcs-permalinks |
| 103 | + name: run check-vcs-permalinks |
| 104 | + description: ensures that links to vcs websites are permalinks |
| 105 | + - id: detect-aws-credentials |
| 106 | + name: run detect-aws-credentials |
| 107 | + description: checks for the existence of AWS secrets that you have set up with the AWS CLI |
| 108 | + args: [--allow-missing-credentials] |
| 109 | + - id: detect-private-key |
| 110 | + name: run detect-private-key |
| 111 | + description: checks for the existence of private keys |
| 112 | + - id: mixed-line-ending |
| 113 | + name: run mixed-line-ending |
| 114 | + description: replaces or checks mixed line ending |
| 115 | + |
| 116 | + - repo: https://github.com/pre-commit/mirrors-prettier |
| 117 | + rev: v4.0.0-alpha.8 |
| 118 | + hooks: |
| 119 | + - id: prettier |
| 120 | + name: run prettier |
| 121 | + types_or: [css, html, javascript, json, markdown, yaml] |
| 122 | + additional_dependencies: ["prettier@3.8.1"] |
| 123 | + |
| 124 | + - repo: https://github.com/igorshubovych/markdownlint-cli |
| 125 | + rev: v0.47.0 |
| 126 | + hooks: |
| 127 | + - id: markdownlint |
| 128 | + name: run markdownlint |
| 129 | + description: check Markdown files with markdownlint |
| 130 | + args: [--config=.github/linters/.markdown-lint.yml] |
| 131 | + types: [markdown] |
| 132 | + files: \.md$ |
| 133 | + |
| 134 | + - repo: https://github.com/adrienverge/yamllint |
| 135 | + rev: v1.38.0 |
| 136 | + hooks: |
| 137 | + - id: yamllint |
| 138 | + name: run yamllint |
| 139 | + description: check YAML files with yamllint |
| 140 | + args: [--strict, -c=.github/linters/.yaml-lint.yml] |
| 141 | + types: [yaml] |
| 142 | + files: \.ya?ml$ |
0 commit comments