-
Notifications
You must be signed in to change notification settings - Fork 4
/
.pre-commit-config.yaml
115 lines (113 loc) · 4.1 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# For pre-commit.ci
ci:
# Defer autoupdate to quarterly (there is no 'off' button) to have renovate pick up first
autoupdate_schedule: quarterly
skip: [test-core-prep, test-pip-prep, testing, quality]
submodules: true
default_language_version:
# force all unspecified python hooks to run python3
python: python3.12
repos:
# Run manually in CI skipping the branch checks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
hooks:
- id: ruff
name: "Ruff-ing code"
args:
- --fix
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: no-commit-to-branch
name: "Verifying git branch exists"
args:
- --branch=main
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
name: "Checking pyupgrade"
args: [--py39-plus]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
name: "Verifying/updating code for spelling issues"
args:
- --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
- --skip="./.*,*.csv,*.json"
- --quiet-level=2
exclude_types: [csv, json]
- repo: https://github.com/PyCQA/bandit
rev: 1.8.0
hooks:
- id: bandit
name: "Linting with bandit"
args:
- --quiet
- --format=custom
- --configfile=tests/bandit.yaml
files: ^(custom_components|tests)/.+\.py$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
name: "Linting yaml"
- repo: https://github.com/biomejs/pre-commit
rev: v0.5.0
hooks:
- id: biome-lint
additional_dependencies: ["@biomejs/[email protected]"]
name: "Verifying/updating code with biome (improved prettier)"
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.7.0
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
name: "Verifying code for typing-update"
stages: [manual]
args:
- --py39-plus
- --force
- --keep-updates
files: ^(custom_components|tests)/.+\.py$
- repo: local
hooks:
- id: test-core-prep
# yamllint disable-line rule:line-length
name: "Home Assistant Core Testing - Cloning/updating HA core#dev - patience!"
# yamllint disable-line rule:line-length
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/core-testing.sh core_prep'
language: script
pass_filenames: false
- id: test-pip-prep
# yamllint disable-line rule:line-length
name: "Home Assistant Core Testing - Installing dependencies - patience!"
# yamllint disable-line rule:line-length
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/core-testing.sh pip_prep'
language: script
pass_filenames: false
- id: testing
# yamllint disable-line rule:line-length
name: "Home Assistant Core Testing - Performing Tests"
# yamllint disable-line rule:line-length
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/core-testing.sh testing'
language: script
pass_filenames: false
- id: quality
# yamllint disable-line rule:line-length
name: "Home Assistant Core Testing - Quality checks - might need patience"
# yamllint disable-line rule:line-length
entry: /usr/bin/env bash -c 'exec env GITHUB_ACTIONS="1" scripts/core-testing.sh quality'
language: script
pass_filenames: false
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
name: "Linting Markdown"