-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
99 lines (98 loc) · 2.71 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
#ci:
# skip:
# - pytest
default_language_version:
python: python3.9
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
# - id: check-toml #check-toml does not apply to this repository - only if poetry is used
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
# TO CHECK:
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.961
# hooks:
# - id: mypy
# additional_dependencies:
# - types-toml
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- id: python-no-eval
- id: python-no-log-warn
- id: python-use-type-annotations
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.3
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/yesqa
rev: v1.3.0
hooks:
- id: yesqa
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
args: ["--max-line-length", "88", "--extend-ignore", "E501"]
additional_dependencies:
- flake8-bugbear
- flake8-builtins
# To check:
# - repo: https://github.com/PyCQA/bandit
# rev: 1.7.4
# hooks:
# - id: bandit
# args: ["-c", ".bandit"]
# - repo: https://github.com/PyCQA/pydocstyle
# rev: 6.1.1
# hooks:
# - id: pydocstyle
# args: ["--convention", "pep257", "--add-ignore", "D100,D102"]
# additional_dependencies:
# - toml
# exclude: airflint/__main__.py|tests/
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/crate-ci/typos
rev: v1.10.2
hooks:
- id: typos
- repo: https://github.com/pycqa/autoflake
rev: v1.4
hooks:
- id: autoflake
args: ["--remove-all-unused-imports", "--in-place"]
# TODO: implement testing
# - repo: local
# hooks:
# - id: pytest
# name: Run pytest
# entry: .venv/bin/pytest tests/
# language: script
# pass_filenames: false
# # alternatively you could `types: [python]` so it only runs when python files change
# # though tests might be invalidated if you were to say change a data file
# always_run: true