-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
98 lines (98 loc) · 2.75 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
repos:
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
exclude: ^hardware/
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
args: ["--ignore=E203,S301,S403,W503,C901"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: local
hooks:
- id: sphinx
name: sphinx
entry: "nox --non-interactive --session=docs"
description: Build docs with sphinx.
language: system
files: "docs/source/"
pass_filenames: false
# run for every possible stage other than "manual", to prevent
# a duplicate run in GitHub Actions, which also fails because
# of a shallow git clone
stages:
[
"commit-msg",
"post-checkout",
"post-commit",
"post-merge",
"post-rewrite",
"pre-commit",
"pre-merge-commit",
"pre-push",
"pre-rebase",
"prepare-commit-msg",
]
- id: mypy
name: mypy
entry: "nox --non-interactive --session=mypy --"
description: Type checking with mypy.
language: system
files: "^(src/|tests/).*$"
types: [python]
pass_filenames: false
# run for every possible stage other than "manual", to prevent
# a duplicate run in GitHub Actions, which also fails because
# of a shallow git clone
stages:
[
"commit-msg",
"post-checkout",
"post-commit",
"post-merge",
"post-rewrite",
"pre-commit",
"pre-merge-commit",
"pre-push",
"pre-rebase",
"prepare-commit-msg",
]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
# this fails on esphome's !secret notation
exclude: ^esphome-configs/.*$
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.7.0
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
hooks:
- id: validate-pyproject
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.9.1
hooks:
- id: sphinx-lint