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
|
2023-07-23 20:00:26 +00:00
|
|
|
rev: v0.0.280
|
2023-01-24 11:15:16 +00:00
|
|
|
hooks:
|
|
|
|
- id: ruff
|
|
|
|
args:
|
|
|
|
- --fix
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: https://github.com/psf/black
|
2023-07-19 12:42:35 +00:00
|
|
|
rev: 23.7.0
|
2019-07-30 23:59:12 +00:00
|
|
|
hooks:
|
2020-02-20 17:34:30 +00:00
|
|
|
- id: black
|
2019-07-30 23:59:12 +00:00
|
|
|
args:
|
|
|
|
- --quiet
|
2022-09-08 07:14:58 +00:00
|
|
|
files: ^((homeassistant|pylint|script|tests)/.+)?[^/]+\.py$
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2022-11-28 16:52:15 +00:00
|
|
|
rev: v2.2.2
|
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:
|
2023-02-07 19:44:02 +00:00
|
|
|
- --ignore-words-list=additionals,alle,alot,ba,bre,bund,currenty,datas,dof,dur,ether,farenheit,falsy,fo,haa,hass,hist,iam,iff,iif,incomfort,ines,ist,lightsensor,mut,nam,nd,pres,pullrequests,referer,resset,rime,ser,serie,sur,te,technik,ue,uint,unsecure,visability,wan,wanna,withing,zar
|
2023-07-24 16:46:54 +00:00
|
|
|
- --skip="./.*,*.csv,*.json,*.ambr"
|
2020-01-31 16:33:00 +00:00
|
|
|
- --quiet-level=2
|
2020-05-03 00:54:16 +00:00
|
|
|
exclude_types: [csv, json]
|
2022-07-12 20:49:54 +00:00
|
|
|
exclude: ^tests/fixtures/|homeassistant/generated/
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2023-01-23 07:43:51 +00:00
|
|
|
rev: v4.4.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
|
2023-07-10 08:13:48 +00:00
|
|
|
rev: v1.32.0
|
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
|
2022-11-07 08:09:47 +00:00
|
|
|
rev: v2.7.1
|
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
|
2022-10-14 11:21:37 +00:00
|
|
|
rev: v0.5.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-01-23 08:59:44 +00:00
|
|
|
- --py310-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
|
|
|
|
types: [python]
|
|
|
|
require_serial: true
|
2022-06-01 22:06:19 +00:00
|
|
|
files: ^(homeassistant|pylint)/.+\.py$
|
2022-01-24 11:00:49 +00:00
|
|
|
- id: pylint
|
|
|
|
name: pylint
|
2022-06-30 18:49:41 +00:00
|
|
|
entry: script/run-in-env.sh pylint -j 0 --ignore-missing-annotations=y
|
2022-01-24 11:00:49 +00:00
|
|
|
language: script
|
|
|
|
types: [python]
|
|
|
|
files: ^homeassistant/.+\.py$
|
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]
|
2022-10-04 14:41:11 +00:00
|
|
|
files: ^(homeassistant/.+/(manifest|strings)\.json|homeassistant/brands/.*\.json|\.coveragerc|homeassistant/.+/services\.yaml|script/hassfest/(?!metadata|mypy_config).+\.py)$
|
2022-01-28 12:36:20 +00:00
|
|
|
- id: hassfest-metadata
|
|
|
|
name: hassfest-metadata
|
|
|
|
entry: script/run-in-env.sh python3 -m script.hassfest -p metadata
|
|
|
|
pass_filenames: false
|
|
|
|
language: script
|
|
|
|
types: [text]
|
2022-05-26 00:54:49 +00:00
|
|
|
files: ^(script/hassfest/metadata\.py|homeassistant/const\.py$|pyproject\.toml)$
|
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)$
|