| 1 |
--- |
| 2 |
|
| 3 |
ci: |
| 4 |
autoupdate_schedule: quarterly |
| 5 |
skip: |
| 6 |
- nitpick-check # can't run on pre-commit.ci while using gh:// |
| 7 |
|
| 8 |
repos: |
| 9 |
- repo: local |
| 10 |
hooks: |
| 11 |
- id: immutable-setup-py |
| 12 |
name: Verify that setup.py stays immutable |
| 13 |
description: >- |
| 14 |
This is a sanity check that makes sure that |
| 15 |
the `setup.py` file isn't changed. |
| 16 |
# Using Python here because using |
| 17 |
# shell test does not seem to work in CIs: |
| 18 |
entry: >- |
| 19 |
sh -c 'git hash-object setup.py |
| 20 |
| |
| 21 |
python -c raise\ |
| 22 |
SystemExit\(input\(\)\ !=\ \"38cc2638672e1f6ca56e4d5ceaf16451dd702b67\"\) |
| 23 |
' |
| 24 |
pass_filenames: false |
| 25 |
language: system |
| 26 |
files: >- |
| 27 |
^setup\.py$ |
| 28 |
- id: immutable-tests-init-py |
| 29 |
name: Verify that tests/__init__.py stays immutable |
| 30 |
description: >- |
| 31 |
This is a sanity check that makes sure that |
| 32 |
the `tests/__init__.py` file isn't changed. |
| 33 |
# Using Python here because using |
| 34 |
# shell test does not seem to work in CIs: |
| 35 |
entry: >- |
| 36 |
sh -c 'git hash-object tests/__init__.py |
| 37 |
| |
| 38 |
python -c raise\ |
| 39 |
SystemExit\(input\(\)\ !=\ \"674d7b907efe86dafcd2b8ddc5655fc55ddf5395\"\) |
| 40 |
' |
| 41 |
pass_filenames: false |
| 42 |
language: system |
| 43 |
files: >- |
| 44 |
^tests/__init__\.py$ |
| 45 |
- id: enforced-flake8-version |
| 46 |
name: Verify that enforced flake8 version stays unchanged |
| 47 |
description: >- |
| 48 |
This is a sanity check and fixer that makes sure that |
| 49 |
the `flake8` version in this file remains matching the |
| 50 |
corresponding request in the `# enforce-version` comment. |
| 51 |
# Using Python here because using |
| 52 |
# shell test does not always work in CIs: |
| 53 |
entry: >- |
| 54 |
python -c 'import pathlib, re, sys; |
| 55 |
pre_commit_config = pathlib.Path(sys.argv[1]); |
| 56 |
cfg_txt = pre_commit_config.read_text(); |
| 57 |
new_cfg_txt = re.sub( |
| 58 |
r"(?P<spaces>\s+)rev:\s(?:\d+\.\d+\.\d+)\s{0,2}" |
| 59 |
r"#\senforce-version:\s(?P<enforced_version>\d+\.\d+\.\d+)" |
| 60 |
r"[ \t\f\v]*", |
| 61 |
r"\g<spaces>rev: \g<enforced_version> " |
| 62 |
r"# enforce-version: \g<enforced_version>", |
| 63 |
cfg_txt, |
| 64 |
); |
| 65 |
cfg_txt != new_cfg_txt and |
| 66 |
pre_commit_config.write_text(new_cfg_txt) |
| 67 |
' |
| 68 |
pass_filenames: true |
| 69 |
language: system |
| 70 |
files: >- |
| 71 |
^\.pre-commit-config\.ya?ml$ |
| 72 |
types: |
| 73 |
- yaml |
| 74 |
|
| 75 |
- repo: https://github.com/asottile/add-trailing-comma.git |
| 76 |
rev: v3.1.0 |
| 77 |
hooks: |
| 78 |
- id: add-trailing-comma |
| 79 |
|
| 80 |
- repo: https://github.com/asottile/pyupgrade.git |
| 81 |
rev: v3.14.0 |
| 82 |
hooks: |
| 83 |
- id: pyupgrade |
| 84 |
args: |
| 85 |
- --py36-plus |
| 86 |
|
| 87 |
- repo: https://github.com/PyCQA/isort.git |
| 88 |
rev: 5.12.0 |
| 89 |
hooks: |
| 90 |
- id: isort |
| 91 |
args: |
| 92 |
- --honor-noqa |
| 93 |
|
| 94 |
- repo: https://github.com/Lucas-C/pre-commit-hooks.git |
| 95 |
rev: v1.5.4 |
| 96 |
hooks: |
| 97 |
- id: remove-tabs |
| 98 |
|
| 99 |
- repo: https://github.com/python-jsonschema/check-jsonschema.git |
| 100 |
rev: 0.27.0 |
| 101 |
hooks: |
| 102 |
- id: check-github-workflows |
| 103 |
files: ^\.github/workflows/[^/]+$ |
| 104 |
types: |
| 105 |
- yaml |
| 106 |
# yamllint disable rule:comments-indentation |
| 107 |
# - id: check-jsonschema |
| 108 |
# name: Check GitHub Workflows set timeout-minutes |
| 109 |
# args: |
| 110 |
# - --builtin-schema |
| 111 |
# - github-workflows-require-timeout |
| 112 |
# files: ^\.github/workflows/[^/]+$ |
| 113 |
# types: |
| 114 |
# - yaml |
| 115 |
# - id: check-readthedocs |
| 116 |
# yamllint enable rule:comments-indentation |
| 117 |
|
| 118 |
- repo: https://github.com/andreoliwa/nitpick.git |
| 119 |
rev: v0.34.0 |
| 120 |
hooks: |
| 121 |
- id: nitpick-check |
| 122 |
args: |
| 123 |
- -v |
| 124 |
stages: [] |
| 125 |
|
| 126 |
- repo: https://github.com/pre-commit/pygrep-hooks.git |
| 127 |
rev: v1.10.0 |
| 128 |
hooks: |
| 129 |
- id: python-check-blanket-noqa |
| 130 |
- id: python-check-mock-methods |
| 131 |
- id: python-no-eval |
| 132 |
- id: python-no-log-warn |
| 133 |
- id: rst-backticks |
| 134 |
|
| 135 |
- repo: https://github.com/pre-commit/pre-commit-hooks.git |
| 136 |
rev: v4.4.0 |
| 137 |
hooks: |
| 138 |
# Side-effects: |
| 139 |
- id: trailing-whitespace |
| 140 |
- id: check-merge-conflict |
| 141 |
- id: double-quote-string-fixer |
| 142 |
- id: end-of-file-fixer |
| 143 |
- id: requirements-txt-fixer |
| 144 |
exclude: >- |
| 145 |
^(docs/requirements|requirements-build)\.txt$ |
| 146 |
# Non-modifying checks: |
| 147 |
- id: name-tests-test |
| 148 |
files: >- |
| 149 |
^tests/[^_].*\.py$ |
| 150 |
- id: check-added-large-files |
| 151 |
- id: check-byte-order-marker |
| 152 |
- id: check-case-conflict |
| 153 |
# disabled due to pre-commit/pre-commit-hooks#159 |
| 154 |
# - id: check-docstring-first |
| 155 |
- id: check-json |
| 156 |
- id: check-symlinks |
| 157 |
- id: check-yaml |
| 158 |
# args: |
| 159 |
# - --unsafe |
| 160 |
- id: detect-private-key |
| 161 |
|
| 162 |
# Heavy checks: |
| 163 |
- id: check-ast |
| 164 |
- id: debug-statements |
| 165 |
|
| 166 |
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup.git |
| 167 |
rev: v1.0.1 |
| 168 |
hooks: |
| 169 |
- id: rst-linter |
| 170 |
files: >- |
| 171 |
^README\.rst$ |
| 172 |
|
| 173 |
- repo: https://github.com/PyCQA/pydocstyle.git |
| 174 |
rev: 6.3.0 |
| 175 |
hooks: |
| 176 |
- id: pydocstyle |
| 177 |
|
| 178 |
- repo: https://github.com/codespell-project/codespell.git |
| 179 |
rev: v2.2.6 |
| 180 |
hooks: |
| 181 |
- id: codespell |
| 182 |
exclude: >- |
| 183 |
^\.github/\.json-schemas/.*\.json$ |
| 184 |
|
| 185 |
- repo: https://github.com/adrienverge/yamllint.git |
| 186 |
rev: v1.32.0 |
| 187 |
hooks: |
| 188 |
- id: yamllint |
| 189 |
files: \.(yaml|yml)$ |
| 190 |
types: [file, yaml] |
| 191 |
args: |
| 192 |
- --strict |
| 193 |
|
| 194 |
- repo: https://github.com/openstack/bashate.git |
| 195 |
rev: 2.1.1 |
| 196 |
hooks: |
| 197 |
- id: bashate |
| 198 |
args: |
| 199 |
- -i |
| 200 |
- E006 |
| 201 |
|
| 202 |
- repo: https://github.com/shellcheck-py/shellcheck-py.git |
| 203 |
rev: v0.9.0.6 |
| 204 |
hooks: |
| 205 |
- id: shellcheck |
| 206 |
|
| 207 |
- repo: https://github.com/PyCQA/flake8.git |
| 208 |
rev: 6.1.0 |
| 209 |
hooks: |
| 210 |
- id: flake8 |
| 211 |
alias: flake8-no-wps |
| 212 |
name: flake8 WPS-excluded |
| 213 |
additional_dependencies: |
| 214 |
- flake8-2020 ~= 1.7.0 |
| 215 |
- flake8-length ~= 0.3.0 |
| 216 |
- flake8-pytest-style ~= 1.6.0 |
| 217 |
language_version: python3 |
| 218 |
|
| 219 |
- repo: https://github.com/PyCQA/flake8.git |
| 220 |
# NOTE: This is kept at v4 for until WPS starts supporting flake v5. |
| 221 |
rev: 4.0.1 # enforce-version: 4.0.1 |
| 222 |
hooks: |
| 223 |
- id: flake8 |
| 224 |
alias: flake8-only-wps |
| 225 |
name: flake8 WPS-only |
| 226 |
args: |
| 227 |
- --select |
| 228 |
- WPS |
| 229 |
additional_dependencies: |
| 230 |
- wemake-python-styleguide ~= 0.16.1 |
| 231 |
language_version: python3 |
| 232 |
|
| 233 |
- repo: local |
| 234 |
hooks: |
| 235 |
- id: pylint |
| 236 |
language: system |
| 237 |
name: PyLint |
| 238 |
files: \.py$ |
| 239 |
entry: python -m pylint |
| 240 |
args: |
| 241 |
- --rcfile |
| 242 |
- .pylintrc |
| 243 |
stages: |
| 244 |
- manual |
| 245 |
|
| 246 |
- repo: https://github.com/pre-commit/mirrors-mypy.git |
| 247 |
rev: v1.5.1 |
| 248 |
hooks: |
| 249 |
- id: mypy |
| 250 |
alias: mypy-py312 |
| 251 |
name: MyPy, for Python 3.12 |
| 252 |
additional_dependencies: |
| 253 |
- lxml # requirement of `--txt-report` |
| 254 |
- pytest |
| 255 |
- Sphinx >= 3.1.2 |
| 256 |
- types-colorama |
| 257 |
- types-Pillow |
| 258 |
- types-Pygments |
| 259 |
- types-pytz |
| 260 |
- types-setuptools |
| 261 |
args: |
| 262 |
- --namespace-packages |
| 263 |
- --install-types |
| 264 |
- --non-interactive |
| 265 |
- --python-version=3.12 |
| 266 |
- --txt-report=.tox/.tmp/.mypy/python-3.12 |
| 267 |
- src/sphinxcontrib/ |
| 268 |
- tests/ |
| 269 |
pass_filenames: false |
| 270 |
- id: mypy |
| 271 |
alias: mypy-py310 |
| 272 |
name: MyPy, for Python 3.10 |
| 273 |
additional_dependencies: |
| 274 |
- lxml # requirement of `--txt-report` |
| 275 |
- pytest |
| 276 |
- Sphinx >= 3.1.2 |
| 277 |
- types-colorama |
| 278 |
- types-Pillow |
| 279 |
- types-Pygments |
| 280 |
- types-pytz |
| 281 |
- types-setuptools |
| 282 |
args: |
| 283 |
- --namespace-packages |
| 284 |
- --install-types |
| 285 |
- --non-interactive |
| 286 |
- --python-version=3.10 |
| 287 |
- --txt-report=.tox/.tmp/.mypy/python-3.10 |
| 288 |
- src/sphinxcontrib/ |
| 289 |
- tests/ |
| 290 |
pass_filenames: false |
| 291 |
- id: mypy |
| 292 |
alias: mypy-py38 |
| 293 |
name: MyPy, for Python 3.8 |
| 294 |
additional_dependencies: |
| 295 |
- lxml # requirement of `--txt-report` |
| 296 |
- pytest |
| 297 |
- Sphinx >= 3.1.2 |
| 298 |
- types-colorama |
| 299 |
- types-Pillow |
| 300 |
- types-Pygments |
| 301 |
- types-pytz |
| 302 |
- types-setuptools |
| 303 |
args: |
| 304 |
- --namespace-packages |
| 305 |
- --install-types |
| 306 |
- --non-interactive |
| 307 |
- --python-version=3.8 |
| 308 |
- --txt-report=.tox/.tmp/.mypy/python-3.8 |
| 309 |
- src/sphinxcontrib/ |
| 310 |
- tests/ |
| 311 |
pass_filenames: false |
| 312 |
- id: mypy |
| 313 |
alias: mypy-py36 |
| 314 |
name: MyPy, for Python 3.6 |
| 315 |
additional_dependencies: |
| 316 |
- importlib_metadata |
| 317 |
- lxml # requirement of `--txt-report` |
| 318 |
- pytest |
| 319 |
- Sphinx >= 3.1.2, < 6 |
| 320 |
- types-colorama |
| 321 |
- types-Pillow |
| 322 |
- types-Pygments |
| 323 |
- types-pytz |
| 324 |
- types-setuptools |
| 325 |
- types-typed-ast |
| 326 |
args: |
| 327 |
- --namespace-packages |
| 328 |
- --install-types |
| 329 |
- --non-interactive |
| 330 |
- --python-version=3.6 |
| 331 |
- --txt-report=.tox/.tmp/.mypy/python-3.6 |
| 332 |
- src/sphinxcontrib/ |
| 333 |
- tests/ |
| 334 |
pass_filenames: false |
| 335 |
|
| 336 |
... |