forked from roflcoopter/viseron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
105 lines (104 loc) · 3.04 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
default_language_version:
python: python3
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
hooks:
- id: pyupgrade
args:
- --py38-plus
- --keep-runtime-typing
files: ^(viseron|tests)/.+\.py$
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.6.0
hooks:
# Run `python-typing-update` hook manually:
# pre-commit run --hook-stage manual python-typing-update --all-files
- id: python-typing-update
stages: [manual]
args:
- --py310-plus
- --force
- --keep-updates
files: ^(viseron|tests)/.+\.py$
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
files: ^(viseron|tests)/.+\.py$
- repo: https://github.com/PyCQA/isort
rev: 5.11.5
hooks:
- id: isort
files: ^(viseron|tests)/.+\.py$
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
args:
- --safe
- --quiet
files: ^(viseron|tests)/.+\.py$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
args:
- --skip="./.*,*.csv,*.json"
- --quiet-level=2
exclude_types: [csv, json]
exclude: ^tests/fixtures/
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- pycodestyle==2.10.0
- pyflakes==3.0.1
- flake8-docstrings==1.6.0
- pydocstyle==6.1.1
- flake8-comprehensions==3.10.1
- flake8-noqa==1.3.0
- mccabe==0.7.0
files: ^(viseron|tests)/.+\.py$
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: [
"-rn", # Only display messages
"-sn", # Don't display the score
"--rcfile=.pylintrc", # Link to your config file
]
files: ^(viseron|tests)/.+\.py$
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
files: ^(viseron)/.+\.py$
args: ["--install-types", "--non-interactive"]
- id: generate_docs
description: Check if docs needs to be regenerated
name: generate_docs
language: system
entry: python3 -m scripts.gen_docs -a
pass_filenames: false
always_run: true
- id: check_config_json
description: 'Fail if any config.json contains "description": null'
name: check docs config.json
language: system
entry: >
bash -c '
test=$(find ./docs/src/pages/components-explorer -iname "config.json" -type f -exec grep -Hn "\"description\": null" {} \;) &&
if [ -n "$test" ]; then echo "Found null description in config.json:"; echo "$test"; false; fi
'
pass_filenames: false
always_run: true