2019-07-31 01:59:12 +02:00
|
|
|
repos:
|
2020-04-05 12:49:57 +02:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2022-10-11 09:04:52 +02:00
|
|
|
rev: v3.1.0
|
2020-04-05 12:49:57 +02:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
2022-01-11 21:38:17 +01:00
|
|
|
args: [--py39-plus]
|
2020-02-20 18:34:30 +01:00
|
|
|
- repo: https://github.com/psf/black
|
2022-10-10 14:19:09 +02:00
|
|
|
rev: 22.10.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:
|
|
|
|
- --safe
|
|
|
|
- --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-01-21 22:05:24 +01:00
|
|
|
rev: v2.1.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:
|
2022-02-20 11:59:11 +01:00
|
|
|
- --ignore-words-list=hass,alot,datas,dof,dur,ether,farenheit,hist,iff,iif,ines,ist,lightsensor,mut,nd,pres,referer,rime,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing,iam,incomfort,ba,haa,pullrequests
|
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
|
|
|
|
rev: 4.0.1
|
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:
|
2021-10-12 15:33:08 +02:00
|
|
|
- pycodestyle==2.8.0
|
|
|
|
- pyflakes==2.4.0
|
2021-03-27 10:22:11 +01:00
|
|
|
- flake8-docstrings==1.6.0
|
2021-10-12 15:33:08 +02:00
|
|
|
- pydocstyle==6.1.1
|
2022-07-10 14:55:43 +02:00
|
|
|
- flake8-comprehensions==3.10.0
|
2022-08-09 15:35:38 +02:00
|
|
|
- flake8-noqa==1.2.8
|
2021-04-25 12:38:40 +02:00
|
|
|
- mccabe==0.6.1
|
2019-10-18 21:20:27 +02:00
|
|
|
files: ^(homeassistant|script|tests)/.+\.py$
|
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
|
2022-03-23 14:47:43 +01:00
|
|
|
rev: 5.10.1
|
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
|
2020-08-08 15:01:57 +02:00
|
|
|
rev: v3.2.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-03-30 13:10:48 +02:00
|
|
|
rev: v2.6.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:
|
2022-01-31 05:16:14 +01:00
|
|
|
- --py39-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)$
|