2019-07-30 23:59:12 +00:00
|
|
|
repos:
|
2020-04-05 10:49:57 +00:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2022-01-11 12:22:16 +00:00
|
|
|
rev: v2.31.0
|
2020-04-05 10:49:57 +00:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
2022-01-11 20:38:17 +00:00
|
|
|
args: [--py39-plus]
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: https://github.com/psf/black
|
2022-02-05 13:19:37 +00:00
|
|
|
rev: 22.1.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:
|
|
|
|
- --safe
|
|
|
|
- --quiet
|
2019-10-18 19:20:27 +00:00
|
|
|
files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2022-01-21 21:05:24 +00:00
|
|
|
rev: v2.1.0
|
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:
|
2022-02-20 10:59:11 +00: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 00:54:16 +00:00
|
|
|
- --skip="./.*,*.csv,*.json"
|
2020-01-31 16:33:00 +00:00
|
|
|
- --quiet-level=2
|
2020-05-03 00:54:16 +00:00
|
|
|
exclude_types: [csv, json]
|
2021-01-10 23:08:25 +00:00
|
|
|
exclude: ^tests/fixtures/
|
2021-10-12 13:33:08 +00:00
|
|
|
- repo: https://github.com/PyCQA/flake8
|
|
|
|
rev: 4.0.1
|
2019-08-18 04:15:55 +00:00
|
|
|
hooks:
|
2020-02-20 17:34:30 +00:00
|
|
|
- id: flake8
|
2019-08-18 04:15:55 +00:00
|
|
|
additional_dependencies:
|
2021-10-12 13:33:08 +00:00
|
|
|
- pycodestyle==2.8.0
|
|
|
|
- pyflakes==2.4.0
|
2021-03-27 09:22:11 +00:00
|
|
|
- flake8-docstrings==1.6.0
|
2021-10-12 13:33:08 +00:00
|
|
|
- pydocstyle==6.1.1
|
2021-10-12 08:15:45 +00:00
|
|
|
- flake8-comprehensions==3.7.0
|
2022-01-02 01:22:26 +00:00
|
|
|
- flake8-noqa==1.2.1
|
2021-04-25 10:38:40 +00:00
|
|
|
- mccabe==0.6.1
|
2019-10-18 19:20:27 +00:00
|
|
|
files: ^(homeassistant|script|tests)/.+\.py$
|
2020-02-20 17:34:30 +00:00
|
|
|
- repo: https://github.com/PyCQA/bandit
|
2020-12-15 02:38:01 +00:00
|
|
|
rev: 1.7.0
|
2019-11-18 08:10:15 +00:00
|
|
|
hooks:
|
2020-02-20 17:34:30 +00:00
|
|
|
- id: bandit
|
2019-11-18 08:10:15 +00:00
|
|
|
args:
|
|
|
|
- --quiet
|
|
|
|
- --format=custom
|
|
|
|
- --configfile=tests/bandit.yaml
|
|
|
|
files: ^(homeassistant|script|tests)/.+\.py$
|
2020-09-04 07:23:24 +00:00
|
|
|
- repo: https://github.com/PyCQA/isort
|
2021-11-04 10:29:01 +00:00
|
|
|
rev: 5.10.0
|
2019-12-12 14:58:47 +00:00
|
|
|
hooks:
|
2020-02-20 17:34:30 +00:00
|
|
|
- id: isort
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2020-08-08 13:01:57 +00:00
|
|
|
rev: v3.2.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
|
2021-11-04 10:27:20 +00:00
|
|
|
rev: v1.26.3
|
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
|
|
|
|
rev: v2.2.1
|
2020-04-05 15:27:16 +00:00
|
|
|
hooks:
|
|
|
|
- id: prettier
|
2020-04-06 17:53:39 +00:00
|
|
|
stages: [manual]
|
2021-03-18 22:20:25 +00:00
|
|
|
- repo: https://github.com/cdce8p/python-typing-update
|
2021-07-20 09:31:48 +00:00
|
|
|
rev: v0.3.5
|
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!
|
|
|
|
- id: python-typing-update
|
|
|
|
stages: [manual]
|
|
|
|
args:
|
2022-01-31 04:16:14 +00:00
|
|
|
- --py39-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
|
|
|
|
files: ^homeassistant/.+\.py$
|
2022-01-24 11:00:49 +00:00
|
|
|
- id: pylint
|
|
|
|
name: pylint
|
|
|
|
entry: script/run-in-env.sh pylint -j 0
|
|
|
|
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-01-28 06:34:18 +00:00
|
|
|
files: ^(homeassistant/.+/manifest\.json|setup\.cfg|\.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-01-28 18:46:17 +00:00
|
|
|
files: ^(homeassistant/.+/(manifest|strings)\.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-01-28 18:46:17 +00:00
|
|
|
files: ^(script/hassfest/metadata\.py|homeassistant/const\.py$|setup\.cfg)$
|
|
|
|
- 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)$
|