2019-07-30 23:59:12 +00:00
|
|
|
repos:
|
2023-07-01 10:12:24 +00:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
2025-01-14 10:46:12 +00:00
|
|
|
rev: v0.9.1
|
2023-01-24 11:15:16 +00:00
|
|
|
hooks:
|
|
|
|
- id: ruff
|
|
|
|
args:
|
|
|
|
- --fix
|
2023-11-27 13:38:59 +00:00
|
|
|
- id: ruff-format
|
2024-04-07 23:28:24 +00:00
|
|
|
files: ^((homeassistant|pylint|script|tests)/.+)?[^/]+\.(py|pyi)$
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2024-05-24 06:22:29 +00:00
|
|
|
rev: v2.3.0
|
2020-01-31 16:33:00 +00:00
|
|
|
hooks:
|
2020-02-20 17:34:30 +00:00
|
|
|
- id: codespell
|
2020-01-31 16:33:00 +00:00
|
|
|
args:
|
2024-12-19 18:18:21 +00:00
|
|
|
- --ignore-words-list=aiport,astroid,checkin,currenty,hass,iif,incomfort,lookin,nam,NotIn
|
2023-07-24 16:46:54 +00:00
|
|
|
- --skip="./.*,*.csv,*.json,*.ambr"
|
2020-01-31 16:33:00 +00:00
|
|
|
- --quiet-level=2
|
2024-04-12 21:35:59 +00:00
|
|
|
exclude_types: [csv, json, html]
|
2023-09-15 18:39:14 +00:00
|
|
|
exclude: ^tests/fixtures/|homeassistant/generated/|tests/components/.*/snapshots/
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2024-11-19 06:47:38 +00:00
|
|
|
rev: v5.0.0
|
2019-12-16 10:06:17 +00:00
|
|
|
hooks:
|
2020-04-05 16:45:43 +00:00
|
|
|
- id: check-executables-have-shebangs
|
2020-08-17 20:50:00 +00:00
|
|
|
stages: [manual]
|
2020-02-20 17:34:30 +00:00
|
|
|
- id: check-json
|
2020-11-13 15:03:40 +00:00
|
|
|
exclude: (.vscode|.devcontainer)
|
2020-02-20 17:34:30 +00:00
|
|
|
- id: no-commit-to-branch
|
|
|
|
args:
|
|
|
|
- --branch=dev
|
|
|
|
- --branch=master
|
|
|
|
- --branch=rc
|
2020-04-05 08:33:45 +00:00
|
|
|
- repo: https://github.com/adrienverge/yamllint.git
|
2024-03-25 10:22:55 +00:00
|
|
|
rev: v1.35.1
|
2020-04-05 08:33:45 +00:00
|
|
|
hooks:
|
|
|
|
- id: yamllint
|
2021-02-04 09:41:28 +00:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
2023-10-28 13:56:26 +00:00
|
|
|
rev: v3.0.3
|
2020-04-05 15:27:16 +00:00
|
|
|
hooks:
|
|
|
|
- id: prettier
|
2021-03-18 22:20:25 +00:00
|
|
|
- repo: https://github.com/cdce8p/python-typing-update
|
2023-07-31 15:59:40 +00:00
|
|
|
rev: v0.6.0
|
2021-03-18 22:20:25 +00:00
|
|
|
hooks:
|
|
|
|
# Run `python-typing-update` hook manually from time to time
|
|
|
|
# to update python typing syntax.
|
|
|
|
# Will require manual work, before submitting changes!
|
2022-10-14 11:21:37 +00:00
|
|
|
# pre-commit run --hook-stage manual python-typing-update --all-files
|
2021-03-18 22:20:25 +00:00
|
|
|
- id: python-typing-update
|
|
|
|
stages: [manual]
|
|
|
|
args:
|
2023-07-31 15:59:40 +00:00
|
|
|
- --py311-plus
|
2021-03-18 22:20:25 +00:00
|
|
|
- --force
|
|
|
|
- --keep-updates
|
|
|
|
files: ^(homeassistant|tests|script)/.+\.py$
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: local
|
2020-02-01 15:12:46 +00:00
|
|
|
hooks:
|
2020-02-20 17:34:30 +00:00
|
|
|
# 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
|
2020-02-01 15:12:46 +00:00
|
|
|
name: mypy
|
|
|
|
entry: script/run-in-env.sh mypy
|
|
|
|
language: script
|
|
|
|
require_serial: true
|
2025-01-20 14:00:32 +00:00
|
|
|
types_or: [python, pyi]
|
2024-04-07 23:28:24 +00:00
|
|
|
files: ^(homeassistant|pylint)/.+\.(py|pyi)$
|
2022-01-24 11:00:49 +00:00
|
|
|
- id: pylint
|
|
|
|
name: pylint
|
2025-01-20 14:00:32 +00:00
|
|
|
entry: script/run-in-env.sh pylint --ignore-missing-annotations=y
|
2022-01-24 11:00:49 +00:00
|
|
|
language: script
|
2025-01-20 14:00:32 +00:00
|
|
|
require_serial: true
|
2024-05-22 11:58:37 +00:00
|
|
|
types_or: [python, pyi]
|
2024-06-20 14:02:49 +00:00
|
|
|
files: ^(homeassistant|tests)/.+\.(py|pyi)$
|
2020-03-17 20:03:43 +00:00
|
|
|
- id: gen_requirements_all
|
|
|
|
name: gen_requirements_all
|
2020-03-25 07:47:01 +00:00
|
|
|
entry: script/run-in-env.sh python3 -m script.gen_requirements_all
|
2020-03-17 20:03:43 +00:00
|
|
|
pass_filenames: false
|
2020-03-25 07:47:01 +00:00
|
|
|
language: script
|
2020-05-14 05:24:27 +00:00
|
|
|
types: [text]
|
2022-09-28 20:21:09 +00:00
|
|
|
files: ^(homeassistant/.+/manifest\.json|homeassistant/brands/.+\.json|pyproject\.toml|\.pre-commit-config\.yaml|script/gen_requirements_all\.py)$
|
2020-03-17 20:03:43 +00:00
|
|
|
- id: hassfest
|
|
|
|
name: hassfest
|
2020-03-25 07:47:01 +00:00
|
|
|
entry: script/run-in-env.sh python3 -m script.hassfest
|
2020-03-17 20:03:43 +00:00
|
|
|
pass_filenames: false
|
2020-03-25 07:47:01 +00:00
|
|
|
language: script
|
2020-10-16 07:57:11 +00:00
|
|
|
types: [text]
|
2024-11-24 10:28:37 +00:00
|
|
|
files: ^(homeassistant/.+/(icons|manifest|strings)\.json|homeassistant/.+/(quality_scale)\.yaml|homeassistant/brands/.*\.json|homeassistant/.+/services\.yaml|script/hassfest/(?!metadata|mypy_config).+\.py|requirements.+\.txt)$
|
2022-01-28 12:36:20 +00:00
|
|
|
- id: hassfest-metadata
|
|
|
|
name: hassfest-metadata
|
2024-10-01 13:56:18 +00:00
|
|
|
entry: script/run-in-env.sh python3 -m script.hassfest -p metadata,docker
|
2022-01-28 12:36:20 +00:00
|
|
|
pass_filenames: false
|
|
|
|
language: script
|
|
|
|
types: [text]
|
2024-11-13 10:01:05 +00:00
|
|
|
files: ^(script/hassfest/metadata\.py|homeassistant/const\.py$|pyproject\.toml|homeassistant/components/go2rtc/const\.py)$
|
2022-01-28 18:46:17 +00:00
|
|
|
- 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)$
|