--- # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks ci: autoupdate_commit_msg: "ci: pre-commit autoupdate" skip: [pyright] files: ^(anta|docs|scripts|tests|asynceapi|tools|\.github)/ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 hooks: - id: trailing-whitespace exclude: docs/.*.svg - id: end-of-file-fixer - id: check-added-large-files exclude: tests/data/.*$ - id: check-merge-conflict - repo: https://github.com/Lucas-C/pre-commit-hooks rev: ad1b27d73581aa16cca06fc4a0761fc563ffe8e8 # frozen: v1.5.6 hooks: - name: Check and insert license on Python files id: insert-license # exclude: files: .*\.py$ args: - --license-filepath - .github/license-short.txt - --use-current-year - --allow-past-years - --fuzzy-match-generates-todo - --no-extra-eol - name: Check and insert license on Markdown files id: insert-license files: .*\.md$ exclude: ^(tests/data/.*\.md|\.github/pull_request_template\.md)$ args: - --license-filepath - .github/license-short.txt - --use-current-year - --allow-past-years - --fuzzy-match-generates-todo - --detect-license-in-X-top-lines - "30" - --comment-style - "" - repo: https://github.com/astral-sh/ruff-pre-commit rev: 01a675ea018f2fb714478a5ffb83fcea8374bb06 # frozen: v0.15.21 hooks: - id: ruff name: Run Ruff linter args: [--fix] - id: ruff-format name: Run Ruff formatter - repo: https://github.com/pycqa/pylint rev: "8a396357098337ba8be714fffdf2d00947a9778c" # frozen: v4.0.6 hooks: - id: pylint name: Check code style with pylint description: This hook runs pylint. types: [python] args: - -rn # Only display messages - -sn # Don't display the score - --rcfile=pyproject.toml # Link to config file additional_dependencies: - anta[cli] - types-PyYAML - types-requests - types-pyOpenSSL - pylint_pydantic - pytest - pytest-codspeed!=4.1.0 - respx - pydantic-settings - zensical==0.0.46 - repo: https://github.com/codespell-project/codespell rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2 hooks: - id: codespell name: Checks for common misspellings in text files. entry: codespell language: python types: [text] args: ["--ignore-words", ".codespellignore"] - repo: https://github.com/RobertCraigie/pyright-python rev: 392b6ba8e54be6d603e02e9f8d601d27b7a48d12 # frozen: v1.1.411 hooks: - id: pyright name: PyRight static type checker types: [python] additional_dependencies: - anta[cli] - pytest>=8.2.0 - respx - pytest-httpx>=0.30.0 - pytest-codspeed>=2.2.0,!=4.1.0 - types-PyYAML - types-requests - types-pyOpenSSL - zensical==0.0.46 files: ^(anta|tests|asynceapi|tools/zensical_extensions)/ - repo: https://github.com/DavidAnson/markdownlint-cli2 rev: 534166213006ec869b773b7ed8c6ebeaad1165d0 # frozen: v0.23.0 hooks: - id: markdownlint-cli2 name: Check for Linting errors on Markdown files. args: - --config - .github/.markdownlint-cli2.yaml - repo: https://github.com/zizmorcore/zizmor-pre-commit rev: e3eebf65325ccc992422292cb7a4baee967cf815 # frozen: v1.26.1 hooks: - id: zizmor name: Check GitHub Actions with zizmor files: ^\.github/ pass_filenames: false args: ["--fix", ".github"] - repo: local hooks: - id: examples-test name: Generate examples/tests.yaml entry: >- sh -c "docs/scripts/generate_examples_tests.py" language: python types: [python] files: anta/ verbose: true pass_filenames: false additional_dependencies: - anta[cli] - pydantic-settings - id: doc-snippets name: Generate doc snippets entry: >- sh -c "docs/scripts/generate_doc_snippets.py" language: python types: [python] files: anta/cli/ verbose: true pass_filenames: false additional_dependencies: - anta[cli] # Keep generated CLI snippets stable with Click's optional subcommand rendering. - click~=8.4.2 - pydantic-settings