| 1 |
--- |
| 2 |
minimum_pre_commit_version: "2.17" |
| 3 |
default_stages: [commit] |
| 4 |
|
| 5 |
ci: |
| 6 |
skip: [mypy] |
| 7 |
|
| 8 |
repos: |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
- repo: meta |
| 14 |
hooks: |
| 15 |
- id: identity |
| 16 |
stages: [commit, manual] |
| 17 |
- id: check-hooks-apply |
| 18 |
stages: [manual] |
| 19 |
- id: check-useless-excludes |
| 20 |
stages: [manual] |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 28 |
rev: c4a0b883114b00d8d76b479c820ce7950211c99b |
| 29 |
hooks: |
| 30 |
- id: check-case-conflict |
| 31 |
- id: check-shebang-scripts-are-executable |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
- repo: https://github.com/astral-sh/ruff-pre-commit |
| 45 |
rev: c22645f6b45188216151a407c040a9eec1795ab0 |
| 46 |
hooks: |
| 47 |
- id: ruff |
| 48 |
name: ruff (fix) |
| 49 |
args: ["--fix-only", "--exit-non-zero-on-fix", "--config=pyproject.toml"] |
| 50 |
|
| 51 |
|
| 52 |
- repo: https://github.com/psf/black |
| 53 |
rev: 552baf822992936134cbd31a38f69c8cfe7c0f05 |
| 54 |
hooks: |
| 55 |
- id: black |
| 56 |
args: ["--safe"] |
| 57 |
|
| 58 |
|
| 59 |
- repo: https://github.com/asottile/blacken-docs |
| 60 |
rev: 960ead214cd1184149d366c6d27ca6c369ce46b6 |
| 61 |
hooks: |
| 62 |
- id: blacken-docs |
| 63 |
exclude: testing|tests |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
- repo: https://github.com/pre-commit/mirrors-prettier |
| 71 |
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea |
| 72 |
hooks: |
| 73 |
- id: prettier |
| 74 |
additional_dependencies: |
| 75 |
- "prettier@^3.2.4" |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
- repo: local |
| 83 |
hooks: |
| 84 |
- id: sort-spelling-dicts |
| 85 |
name: Sort spelling_dict.txt files |
| 86 |
description: Sort spelling_dict.txt files |
| 87 |
language: python |
| 88 |
entry: python |
| 89 |
args: |
| 90 |
- "-c" |
| 91 |
- | |
| 92 |
import pathlib; |
| 93 |
import sys; |
| 94 |
p = pathlib.Path(sys.argv[1]); |
| 95 |
p.write_text("\n".join(sorted(set(p.read_text("utf-8").splitlines()))) + "\n", "utf-8") |
| 96 |
files: "spelling_dict.txt" |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 104 |
rev: c4a0b883114b00d8d76b479c820ce7950211c99b |
| 105 |
hooks: |
| 106 |
- id: end-of-file-fixer |
| 107 |
stages: [commit] |
| 108 |
- id: trailing-whitespace |
| 109 |
stages: [commit] |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
- repo: local |
| 122 |
hooks: |
| 123 |
|
| 124 |
|
| 125 |
- id: find-todos |
| 126 |
name: "Find TODO:|FIXME:|BUG: comments" |
| 127 |
description: "Check for TODO:|FIXME:|BUG: comments in all files" |
| 128 |
language: pygrep |
| 129 |
entry: '(^|//!?|#|<!--|;|/\*(\*|!)?|\.\.)\s*(TODO:|FIXME:|BUG:)(?!#i#)' |
| 130 |
exclude: TODO |
| 131 |
|
| 132 |
|
| 133 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 134 |
rev: c4a0b883114b00d8d76b479c820ce7950211c99b |
| 135 |
hooks: |
| 136 |
- id: check-merge-conflict |
| 137 |
- id: detect-private-key |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
- repo: https://github.com/astral-sh/ruff-pre-commit |
| 145 |
rev: c22645f6b45188216151a407c040a9eec1795ab0 |
| 146 |
hooks: |
| 147 |
- id: ruff |
| 148 |
name: ruff (lint) |
| 149 |
args: ["--config=pyproject.toml"] |
| 150 |
|
| 151 |
|
| 152 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 153 |
rev: c4a0b883114b00d8d76b479c820ce7950211c99b |
| 154 |
hooks: |
| 155 |
- id: debug-statements |
| 156 |
- id: fix-encoding-pragma |
| 157 |
args: ["--remove"] |
| 158 |
- id: name-tests-test |
| 159 |
|
| 160 |
|
| 161 |
- repo: https://github.com/pre-commit/pygrep-hooks |
| 162 |
rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 |
| 163 |
hooks: |
| 164 |
- id: python-check-blanket-noqa |
| 165 |
- id: python-check-blanket-type-ignore |
| 166 |
- id: python-check-mock-methods |
| 167 |
- id: python-no-eval |
| 168 |
- id: python-no-log-warn |
| 169 |
|
| 170 |
|
| 171 |
- repo: local |
| 172 |
hooks: |
| 173 |
|
| 174 |
- id: mypy |
| 175 |
name: mypy |
| 176 |
description: run mypy over the installed package via tox |
| 177 |
entry: tox |
| 178 |
args: ["-e", "mypy"] |
| 179 |
language: python |
| 180 |
additional_dependencies: [tox] |
| 181 |
types: [python] |
| 182 |
pass_filenames: false |
| 183 |
require_serial: true |
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
- repo: https://github.com/shellcheck-py/shellcheck-py |
| 191 |
rev: a23f6b85d0fdd5bb9d564e2579e678033debbdff |
| 192 |
hooks: |
| 193 |
- id: shellcheck |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
- repo: https://github.com/rstcheck/rstcheck |
| 201 |
rev: 445861c31d8134562e723d77115721038de2e687 |
| 202 |
hooks: |
| 203 |
- id: rstcheck |
| 204 |
additional_dependencies: [sphinx] |
| 205 |
exclude: testing |
| 206 |
args: ["--config", ".rstcheck.project.cfg"] |
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
- repo: https://github.com/DavidAnson/markdownlint-cli2 |
| 214 |
rev: 82c791e94c2e2ab2119437d61c722c8e0c20d6c9 |
| 215 |
hooks: |
| 216 |
- id: markdownlint-cli2 |
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 224 |
rev: c4a0b883114b00d8d76b479c820ce7950211c99b |
| 225 |
hooks: |
| 226 |
- id: check-toml |
| 227 |
- id: check-yaml |
| 228 |
|
| 229 |
|
| 230 |
- repo: https://github.com/adrienverge/yamllint |
| 231 |
rev: 81e9f98ffd059efe8aa9c1b1a42e5cce61b640c6 |
| 232 |
hooks: |
| 233 |
- id: yamllint |