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