| 1 |
--- |
| 2 |
|
| 3 |
|
| 4 |
ci: |
| 5 |
autoupdate_commit_msg: "ci: pre-commit autoupdate" |
| 6 |
skip: [pyright] |
| 7 |
files: ^(anta|docs|scripts|tests|asynceapi|tools|\.github)/ |
| 8 |
|
| 9 |
repos: |
| 10 |
- repo: https://github.com/pre-commit/pre-commit-hooks |
| 11 |
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c |
| 12 |
hooks: |
| 13 |
- id: trailing-whitespace |
| 14 |
exclude: docs/.*.svg |
| 15 |
- id: end-of-file-fixer |
| 16 |
- id: check-added-large-files |
| 17 |
exclude: tests/data/.*$ |
| 18 |
- id: check-merge-conflict |
| 19 |
|
| 20 |
- repo: https://github.com/Lucas-C/pre-commit-hooks |
| 21 |
rev: ad1b27d73581aa16cca06fc4a0761fc563ffe8e8 |
| 22 |
hooks: |
| 23 |
- name: Check and insert license on Python files |
| 24 |
id: insert-license |
| 25 |
|
| 26 |
files: .*\.py$ |
| 27 |
args: |
| 28 |
- --license-filepath |
| 29 |
- .github/license-short.txt |
| 30 |
- --use-current-year |
| 31 |
- --allow-past-years |
| 32 |
- --fuzzy-match-generates-todo |
| 33 |
- --no-extra-eol |
| 34 |
|
| 35 |
- name: Check and insert license on Markdown files |
| 36 |
id: insert-license |
| 37 |
files: .*\.md$ |
| 38 |
exclude: ^(tests/data/.*\.md|\.github/pull_request_template\.md)$ |
| 39 |
args: |
| 40 |
- --license-filepath |
| 41 |
- .github/license-short.txt |
| 42 |
- --use-current-year |
| 43 |
- --allow-past-years |
| 44 |
- --fuzzy-match-generates-todo |
| 45 |
- --detect-license-in-X-top-lines |
| 46 |
- "30" |
| 47 |
- --comment-style |
| 48 |
- "<!--| ~| -->" |
| 49 |
|
| 50 |
- repo: https://github.com/astral-sh/ruff-pre-commit |
| 51 |
rev: 01a675ea018f2fb714478a5ffb83fcea8374bb06 |
| 52 |
hooks: |
| 53 |
- id: ruff |
| 54 |
name: Run Ruff linter |
| 55 |
args: [--fix] |
| 56 |
- id: ruff-format |
| 57 |
name: Run Ruff formatter |
| 58 |
|
| 59 |
- repo: https://github.com/pycqa/pylint |
| 60 |
rev: "8a396357098337ba8be714fffdf2d00947a9778c" |
| 61 |
hooks: |
| 62 |
- id: pylint |
| 63 |
name: Check code style with pylint |
| 64 |
description: This hook runs pylint. |
| 65 |
types: [python] |
| 66 |
args: |
| 67 |
- -rn |
| 68 |
- -sn |
| 69 |
- --rcfile=pyproject.toml |
| 70 |
additional_dependencies: |
| 71 |
- anta[cli] |
| 72 |
- types-PyYAML |
| 73 |
- types-requests |
| 74 |
- types-pyOpenSSL |
| 75 |
- pylint_pydantic |
| 76 |
- pytest |
| 77 |
- pytest-codspeed!=4.1.0 |
| 78 |
- respx |
| 79 |
- pydantic-settings |
| 80 |
- zensical==0.0.46 |
| 81 |
|
| 82 |
- repo: https://github.com/codespell-project/codespell |
| 83 |
rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a |
| 84 |
hooks: |
| 85 |
- id: codespell |
| 86 |
name: Checks for common misspellings in text files. |
| 87 |
entry: codespell |
| 88 |
language: python |
| 89 |
types: [text] |
| 90 |
args: ["--ignore-words", ".codespellignore"] |
| 91 |
|
| 92 |
- repo: https://github.com/RobertCraigie/pyright-python |
| 93 |
rev: 392b6ba8e54be6d603e02e9f8d601d27b7a48d12 |
| 94 |
hooks: |
| 95 |
- id: pyright |
| 96 |
name: PyRight static type checker |
| 97 |
types: [python] |
| 98 |
additional_dependencies: |
| 99 |
- anta[cli] |
| 100 |
- pytest>=8.2.0 |
| 101 |
- respx |
| 102 |
- pytest-httpx>=0.30.0 |
| 103 |
- pytest-codspeed>=2.2.0,!=4.1.0 |
| 104 |
- types-PyYAML |
| 105 |
- types-requests |
| 106 |
- types-pyOpenSSL |
| 107 |
- zensical==0.0.46 |
| 108 |
files: ^(anta|tests|asynceapi|tools/zensical_extensions)/ |
| 109 |
|
| 110 |
- repo: https://github.com/DavidAnson/markdownlint-cli2 |
| 111 |
rev: 534166213006ec869b773b7ed8c6ebeaad1165d0 |
| 112 |
hooks: |
| 113 |
- id: markdownlint-cli2 |
| 114 |
name: Check for Linting errors on Markdown files. |
| 115 |
args: |
| 116 |
- --config |
| 117 |
- .github/.markdownlint-cli2.yaml |
| 118 |
|
| 119 |
- repo: https://github.com/zizmorcore/zizmor-pre-commit |
| 120 |
rev: e3eebf65325ccc992422292cb7a4baee967cf815 |
| 121 |
hooks: |
| 122 |
- id: zizmor |
| 123 |
name: Check GitHub Actions with zizmor |
| 124 |
files: ^\.github/ |
| 125 |
pass_filenames: false |
| 126 |
args: ["--fix", ".github"] |
| 127 |
|
| 128 |
- repo: local |
| 129 |
hooks: |
| 130 |
- id: examples-test |
| 131 |
name: Generate examples/tests.yaml |
| 132 |
entry: >- |
| 133 |
sh -c "docs/scripts/generate_examples_tests.py" |
| 134 |
language: python |
| 135 |
types: [python] |
| 136 |
files: anta/ |
| 137 |
verbose: true |
| 138 |
pass_filenames: false |
| 139 |
additional_dependencies: |
| 140 |
- anta[cli] |
| 141 |
- pydantic-settings |
| 142 |
- id: doc-snippets |
| 143 |
name: Generate doc snippets |
| 144 |
entry: >- |
| 145 |
sh -c "docs/scripts/generate_doc_snippets.py" |
| 146 |
language: python |
| 147 |
types: [python] |
| 148 |
files: anta/cli/ |
| 149 |
verbose: true |
| 150 |
pass_filenames: false |
| 151 |
additional_dependencies: |
| 152 |
- anta[cli] |
| 153 |
|
| 154 |
- click~=8.4.2 |
| 155 |
- pydantic-settings |