2019-07-31 01:59:12 +02:00
|
|
|
repos:
|
2020-04-05 12:49:57 +02:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2021-11-11 07:21:43 +01:00
|
|
|
rev: v2.29.0
|
2020-04-05 12:49:57 +02:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
2021-01-04 11:47:29 +01:00
|
|
|
args: [--py38-plus]
|
2020-02-20 18:34:30 +01:00
|
|
|
- repo: https://github.com/psf/black
|
2021-11-29 11:51:58 +01:00
|
|
|
rev: 21.11b1
|
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
|
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/codespell-project/codespell
|
2020-12-31 19:14:07 +01:00
|
|
|
rev: v2.0.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:
|
2021-12-06 23:35:14 +01:00
|
|
|
- --ignore-words-list=hass,alot,datas,dof,dur,ether,farenheit,hist,iff,ines,ist,lightsensor,mut,nd,pres,referer,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing,iam,incomfort,ba,haa
|
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]
|
2021-01-11 00:08:25 +01:00
|
|
|
exclude: ^tests/fixtures/
|
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
|
2021-10-12 10:15:45 +02:00
|
|
|
- flake8-comprehensions==3.7.0
|
2021-10-12 15:33:08 +02:00
|
|
|
- flake8-noqa==1.2.0
|
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
|
2020-12-15 03:38:01 +01:00
|
|
|
rev: 1.7.0
|
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
|
2021-11-04 11:29:01 +01:00
|
|
|
rev: 5.10.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
|
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
|
2021-11-04 11:27:20 +01:00
|
|
|
rev: v1.26.3
|
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
|
|
|
|
rev: v2.2.1
|
2020-04-05 17:27:16 +02:00
|
|
|
hooks:
|
|
|
|
- id: prettier
|
2020-04-06 19:53:39 +02:00
|
|
|
stages: [manual]
|
2021-03-18 23:20:25 +01:00
|
|
|
- repo: https://github.com/cdce8p/python-typing-update
|
2021-07-20 11:31:48 +02:00
|
|
|
rev: v0.3.5
|
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!
|
|
|
|
- id: python-typing-update
|
|
|
|
stages: [manual]
|
|
|
|
args:
|
|
|
|
- --py38-plus
|
|
|
|
- --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
|
|
|
|
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]
|
|
|
|
files: ^(homeassistant/.+/manifest\.json|\.pre-commit-config\.yaml)$
|
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]
|
2021-02-18 18:17:09 +01:00
|
|
|
files: ^(homeassistant/.+/(manifest|strings)\.json|\.coveragerc|homeassistant/.+/services\.yaml)$
|