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