Files
core/.pre-commit-config.yaml
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

120 lines
4.5 KiB
YAML
Raw Normal View History

2019-07-30 16:59:12 -07:00
repos:
2023-07-01 12:12:24 +02:00
- repo: https://github.com/astral-sh/ruff-pre-commit
2026-07-29 12:21:18 +02:00
rev: v0.16.0
hooks:
2025-06-02 16:01:10 +02:00
- id: ruff-check
args:
- --fix
- id: ruff-format
files: ^((homeassistant|pylint|script|tests)/.+)?[^/]+\.(py|pyi)$
- repo: https://github.com/codespell-project/codespell
2026-07-23 12:34:37 +02:00
rev: v2.4.3
2020-01-31 17:33:00 +01:00
hooks:
- id: codespell
2020-01-31 17:33:00 +01:00
args:
- --ignore-words-list=aiport,astroid,checkin,currenty,hass,iif,incomfort,lookin,nam,NotIn
2023-07-24 18:46:54 +02:00
- --skip="./.*,*.csv,*.json,*.ambr"
2020-01-31 17:33:00 +01:00
- --quiet-level=2
exclude_types: [csv, json, html]
2023-09-15 20:39:14 +02:00
exclude: ^tests/fixtures/|homeassistant/generated/|tests/components/.*/snapshots/
- repo: https://github.com/zizmorcore/zizmor-pre-commit
2026-07-30 09:58:24 +02:00
rev: v1.28.0
hooks:
- id: zizmor
args:
- --pedantic
exclude: ^\.github/workflows/.*\.lock\.yml$
- repo: https://github.com/pre-commit/pre-commit-hooks
2025-08-13 19:23:26 +02:00
rev: v6.0.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: check-json
exclude: (.vscode|.devcontainer)
- id: no-commit-to-branch
args:
- --branch=dev
- --branch=master
- --branch=rc
- repo: https://github.com/adrienverge/yamllint.git
2026-04-14 21:49:02 +02:00
rev: v1.38.0
hooks:
- id: yamllint
2025-10-27 18:16:13 +01:00
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.6.2
hooks:
- id: prettier
2025-10-28 10:33:10 +01:00
additional_dependencies:
- prettier@3.6.2
- prettier-plugin-sort-json@4.2.0
exclude: ^\.github/workflows/.*\.lock\.yml$
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.6.0
hooks:
# Run `python-typing-update` hook manually from time to time
# to update python typing syntax.
# Will require manual work, before submitting changes!
2026-01-13 15:09:02 +01:00
# prek run --hook-stage manual python-typing-update --all-files
- id: python-typing-update
stages: [manual]
args:
- --py311-plus
- --force
- --keep-updates
files: ^(homeassistant|tests|script)/.+\.py$
- repo: local
hooks:
# Run mypy through our wrapper script in order to get the possible
# pyenv and/or virtualenv activated; it may not have been e.g. if
# committing from a GUI tool that was not launched from an activated
# shell.
- id: mypy
name: mypy
entry: script/run-in-env.sh mypy
language: script
require_serial: true
types_or: [python, pyi]
files: ^(homeassistant|pylint)/.+\.(py|pyi)$
2022-01-24 12:00:49 +01:00
- id: pylint
name: pylint
entry: script/run-in-env.sh pylint --ignore-missing-annotations=y
2022-01-24 12:00:49 +01:00
language: script
require_serial: true
types_or: [python, pyi]
2024-06-20 16:02:49 +02:00
files: ^(homeassistant|tests)/.+\.(py|pyi)$
- id: gen_requirements_all
name: gen_requirements_all
entry: script/run-in-env.sh python3 -m script.gen_requirements_all
pass_filenames: false
language: script
types: [text]
2022-09-28 16:21:09 -04:00
files: ^(homeassistant/.+/manifest\.json|homeassistant/brands/.+\.json|pyproject\.toml|\.pre-commit-config\.yaml|script/gen_requirements_all\.py)$
- id: gen_copilot_instructions
name: gen_copilot_instructions
entry: script/run-in-env.sh python3 -m script.gen_copilot_instructions
pass_filenames: false
language: script
types: [text]
files: ^(AGENTS\.md|\.claude/skills/(?!github-pr-reviewer/).+/SKILL\.md|\.github/copilot-instructions\.md|script/gen_copilot_instructions\.py)$
- id: hassfest
name: hassfest
entry: script/run-in-env.sh python3 -m script.hassfest
pass_filenames: false
language: script
types: [text]
files: ^(homeassistant/.+/(icons|manifest|strings)\.json|homeassistant/.+/(conditions|quality_scale|services|triggers)\.yaml|homeassistant/brands/.*\.json|script/hassfest/(?!metadata|mypy_config).+\.py|homeassistant/components/sensor/const\.py|requirements.+\.txt)$
- id: hassfest-metadata
name: hassfest-metadata
2024-10-01 15:56:18 +02:00
entry: script/run-in-env.sh python3 -m script.hassfest -p metadata,docker
pass_filenames: false
language: script
types: [text]
2025-11-24 12:52:58 +01:00
files: ^(script/hassfest/(metadata|docker)\.py|homeassistant/const\.py$|pyproject\.toml)$
- id: hassfest-mypy-config
name: hassfest-mypy-config
entry: script/run-in-env.sh python3 -m script.hassfest -p mypy_config
pass_filenames: false
language: script
types: [text]
files: ^(script/hassfest/mypy_config\.py|\.strict-typing|mypy\.ini)$