2019-07-31 01:59:12 +02:00
|
|
|
repos:
|
2023-01-24 12:15:16 +01:00
|
|
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
2023-02-15 22:46:03 +01:00
|
|
|
rev: v0.0.247
|
2023-01-24 12:15:16 +01:00
|
|
|
hooks:
|
|
|
|
- id: ruff
|
|
|
|
args:
|
|
|
|
- --fix
|
2020-04-05 12:49:57 +02:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2022-12-17 22:10:13 +01:00
|
|
|
rev: v3.3.1
|
2020-04-05 12:49:57 +02:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
2023-01-23 09:59:44 +01:00
|
|
|
args: [--py310-plus]
|
2023-01-24 12:15:16 +01:00
|
|
|
stages: [manual]
|
2022-11-22 08:10:36 +01:00
|
|
|
- repo: https://github.com/PyCQA/autoflake
|
2022-11-28 14:49:11 +01:00
|
|
|
rev: v2.0.0
|
2022-11-22 08:10:36 +01:00
|
|
|
hooks:
|
|
|
|
- id: autoflake
|
|
|
|
args:
|
|
|
|
- --in-place
|
|
|
|
- --remove-all-unused-imports
|
2023-01-24 12:15:16 +01:00
|
|
|
stages: [manual]
|
2020-02-20 18:34:30 +01:00
|
|
|
- repo: https://github.com/psf/black
|
2023-02-02 18:35:24 +01:00
|
|
|
rev: 23.1.0
|
2019-07-31 01:59:12 +02:00
|
|
|
hooks:
|
2020-02-20 18:34:30 +01:00
|
|
|
- id: black
|
2019-07-31 01:59:12 +02:00
|
|
|
args:
|
|
|
|
- --quiet
|
2022-09-08 09:14:58 +02:00
|
|
|
files: ^((homeassistant|pylint|script|tests)/.+)?[^/]+\.py$
|
2020-02-20 18:34:30 +01:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2022-11-28 17:52:15 +01:00
|
|
|
rev: v2.2.2
|
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:
|
2023-02-07 20:44:02 +01: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
|
2020-05-03 02:54:16 +02:00
|
|
|
- --skip="./.*,*.csv,*.json"
|
2020-01-31 17:33:00 +01:00
|
|
|
- --quiet-level=2
|
2020-05-03 02:54:16 +02:00
|
|
|
exclude_types: [csv, json]
|
2022-07-12 22:49:54 +02:00
|
|
|
exclude: ^tests/fixtures/|homeassistant/generated/
|
2021-10-12 15:33:08 +02:00
|
|
|
- repo: https://github.com/PyCQA/flake8
|
2022-11-28 14:49:11 +01:00
|
|
|
rev: 6.0.0
|
2019-08-18 06:15:55 +02:00
|
|
|
hooks:
|
2020-02-20 18:34:30 +01:00
|
|
|
- id: flake8
|
2019-08-18 06:15:55 +02:00
|
|
|
additional_dependencies:
|
2022-11-28 14:49:11 +01:00
|
|
|
- pycodestyle==2.10.0
|
|
|
|
- pyflakes==3.0.1
|
2021-03-27 10:22:11 +01:00
|
|
|
- flake8-docstrings==1.6.0
|
2023-01-08 23:59:07 +01:00
|
|
|
- pydocstyle==6.2.3
|
2022-11-28 14:49:11 +01:00
|
|
|
- flake8-comprehensions==3.10.1
|
|
|
|
- flake8-noqa==1.3.0
|
|
|
|
- mccabe==0.7.0
|
2023-01-16 20:53:14 +01:00
|
|
|
exclude: docs/source/conf.py
|
2023-01-24 12:15:16 +01:00
|
|
|
stages: [manual]
|
2020-02-20 18:34:30 +01:00
|
|
|
- repo: https://github.com/PyCQA/bandit
|
2022-03-05 20:13:30 +01:00
|
|
|
rev: 1.7.4
|
2019-11-18 09:10:15 +01:00
|
|
|
hooks:
|
2020-02-20 18:34:30 +01:00
|
|
|
- id: bandit
|
2019-11-18 09:10:15 +01:00
|
|
|
args:
|
|
|
|
- --quiet
|
|
|
|
- --format=custom
|
|
|
|
- --configfile=tests/bandit.yaml
|
|
|
|
files: ^(homeassistant|script|tests)/.+\.py$
|
2020-09-04 09:23:24 +02:00
|
|
|
- repo: https://github.com/PyCQA/isort
|
2023-01-29 15:04:17 +01:00
|
|
|
rev: 5.12.0
|
2019-12-12 15:58:47 +01:00
|
|
|
hooks:
|
2020-02-20 18:34:30 +01:00
|
|
|
- id: isort
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2023-01-23 08:43:51 +01: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
|
2022-10-18 10:42:57 +02:00
|
|
|
rev: v1.28.0
|
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
|
2022-11-07 09:09:47 +01:00
|
|
|
rev: v2.7.1
|
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
|
2022-10-14 13:21:37 +02:00
|
|
|
rev: v0.5.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-01-23 09:59:44 +01:00
|
|
|
- --py310-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 16:12:46 +01: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 16:12:46 +01:00
|
|
|
name: mypy
|
|
|
|
entry: script/run-in-env.sh mypy
|
|
|
|
language: script
|
|
|
|
types: [python]
|
|
|
|
require_serial: true
|
2022-06-02 00:06:19 +02:00
|
|
|
files: ^(homeassistant|pylint)/.+\.py$
|
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
|
|
|
|
types: [python]
|
|
|
|
files: ^homeassistant/.+\.py$
|
2020-03-17 21:03:43 +01: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 21:03:43 +01:00
|
|
|
pass_filenames: false
|
2020-03-25 08:47:01 +01:00
|
|
|
language: script
|
2020-05-14 07:24:27 +02:00
|
|
|
types: [text]
|
2022-09-28 22:21:09 +02:00
|
|
|
files: ^(homeassistant/.+/manifest\.json|homeassistant/brands/.+\.json|pyproject\.toml|\.pre-commit-config\.yaml|script/gen_requirements_all\.py)$
|
2020-03-17 21:03:43 +01: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 21:03:43 +01:00
|
|
|
pass_filenames: false
|
2020-03-25 08:47:01 +01:00
|
|
|
language: script
|
2020-10-16 09:57:11 +02:00
|
|
|
types: [text]
|
2022-10-04 16:41:11 +02:00
|
|
|
files: ^(homeassistant/.+/(manifest|strings)\.json|homeassistant/brands/.*\.json|\.coveragerc|homeassistant/.+/services\.yaml|script/hassfest/(?!metadata|mypy_config).+\.py)$
|
2022-01-28 13:36:20 +01: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 02:54:49 +02:00
|
|
|
files: ^(script/hassfest/metadata\.py|homeassistant/const\.py$|pyproject\.toml)$
|
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)$
|