2019-07-30 16:59:12 -07:00
|
|
|
repos:
|
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]
|
2022-11-22 09:10:36 +02:00
|
|
|
- repo: https://github.com/PyCQA/autoflake
|
2022-11-28 14:49:11 +01:00
|
|
|
rev: v2.0.0
|
2022-11-22 09:10:36 +02:00
|
|
|
hooks:
|
|
|
|
- id: autoflake
|
|
|
|
args:
|
|
|
|
- --in-place
|
|
|
|
- --remove-all-unused-imports
|
2020-02-20 18:34:30 +01:00
|
|
|
- repo: https://github.com/psf/black
|
2022-12-19 16:43:53 +01:00
|
|
|
rev: 22.12.0
|
2019-07-30 16:59:12 -07:00
|
|
|
hooks:
|
2020-02-20 18:34:30 +01:00
|
|
|
- id: black
|
2019-07-30 16:59:12 -07: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:
|
2022-12-18 00:40:24 +02:00
|
|
|
- --ignore-words-list=additionals,alle,alot,ba,bre,bund,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 13:49:54 -07: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 07:15:55 +03:00
|
|
|
hooks:
|
2020-02-20 18:34:30 +01:00
|
|
|
- id: flake8
|
2019-08-18 07:15:55 +03:00
|
|
|
additional_dependencies:
|
2022-11-28 14:49:11 +01:00
|
|
|
- pycodestyle==2.10.0
|
|
|
|
- pyflakes==3.0.1
|
2021-03-27 11:22:11 +02: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 14:53:14 -05:00
|
|
|
exclude: docs/source/conf.py
|
2020-02-20 18:34:30 +01:00
|
|
|
- repo: https://github.com/PyCQA/bandit
|
2022-03-05 21:13:30 +02:00
|
|
|
rev: 1.7.4
|
2019-11-18 10:10:15 +02:00
|
|
|
hooks:
|
2020-02-20 18:34:30 +01:00
|
|
|
- id: bandit
|
2019-11-18 10:10:15 +02: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
|
2022-12-21 23:06:18 +01:00
|
|
|
rev: 5.11.4
|
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 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
|
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 10:09:47 +02: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 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
|
|
|
|
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 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]
|
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)$
|