-
Notifications
You must be signed in to change notification settings - Fork 35
/
.pre-commit-config.yaml
103 lines (98 loc) · 2.65 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
exclude: >
(?x)^(
.+/airflow_override/.+|
.+/_vendor/.+|
.*/?docs/sdk-docs/.+
)$
repos:
# Keep autoflake as a first hook
# it may change you code without fixing formatting
# so following isort&black will do the rest
- repo: https://github.com/fsouza/autoflake8
rev: v0.3.1
hooks:
- id: autoflake8
additional_dependencies: ["pyflakes<3"]
args:
[
"--in-place",
"--verbose",
"--expand-star-imports",
"--remove-duplicate-keys",
"--remove-unused-variables",
]
verbose: true
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
# support running black from parent dirrectory and from dbnd-core root:
entry: >
sh -c '
if test -f "dbnd-core/pyproject.toml"; then
black --config dbnd-core/pyproject.toml "$@"
else
black "$@"
fi;
' --
verbose: true
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
language_version: python3
# support running isort from parent dirrectory and from dbnd-core root:
args: [--resolve-all-configs]
entry: >
sh -c '
if test -f "dbnd-core/pyproject.toml"; then
isort --config-root dbnd-core "$@"
else
isort "$@"
fi;
' --
verbose: true
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-added-large-files
args: ["--maxkb=3000"]
- id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
files: dbnd-core/.+/.+\.py$
args:
- --license-filepath
- COPYRIGHT.txt
- --skip-license-insertion
- "Copyright"
#- --remove-header
exclude: |
(?x)^(
.+/airflow_override/.+|
.+/_vendor/.+|
.+/docs/sdk-docs/.+|
.+/build/.+|
.+/dist/.+|
)$
- id: insert-license
files: dbnd-core/modules/dbnd-java/.+/.+\.java$
args:
- --license-filepath
- COPYRIGHT.txt
- --skip-license-insertion
- "Copyright"
- --comment-style
- /*| *| */
#- --remove-header
exclude: |
(?x)^(
.+/airflow_override/.+|
.+/_vendor/.+|
.+/docs/sdk-docs/.+|
.+/build/.+|
.+/dist/.+|
)$