forked from feluelle/airflow-diagrams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
125 lines (124 loc) · 3.43 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
116
117
118
119
120
121
122
123
124
125
ci:
skip:
- pytest
- demo
- usage
default_language_version:
python: python3.9
exclude: examples/
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: assets/images/demo.svg
- id: sort-simple-yaml
files: airflow_diagrams/abbreviations.yml|examples/mapping.yml
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
hooks:
- id: mypy
additional_dependencies:
- types-requests
- types-PyYAML
- types-toml
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.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.4.0
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
hooks:
- id: yesqa
- repo: https://github.com/asottile/dead
rev: v1.5.0
hooks:
- id: dead
args: ["--exclude", "examples/"] # global exclude does not work
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ["--max-line-length", "88", "--extend-ignore", "E203,E501,B008"]
additional_dependencies:
- flake8-bugbear
- flake8-builtins
- flake8-pytest-style
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args: ["-c", ".bandit"]
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: ["--convention", "pep257", "--add-ignore", "D100,D107"]
additional_dependencies:
- toml
exclude: airflow_diagrams/cli.py|airflow_diagrams/__main__.py|dev/|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: typos-dict-v0.9.15
hooks:
- id: typos
exclude: \.svg$
- repo: https://github.com/pycqa/autoflake
rev: v2.0.0
hooks:
- id: autoflake
args: ["--remove-all-unused-imports", "--in-place"]
- 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
- id: demo
name: Recreate demo
entry: task demo
language: system
files: ^airflow_diagrams/|^dev/demo/
types: [file, python]
pass_filenames: false
- id: usage
name: Recreate usage
entry: task usage
language: system
files: airflow_diagrams/cli.py
pass_filenames: false