forked from vmware/versatile-data-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
143 lines (142 loc) · 4.85 KB
/
.pre-commit-config.yaml
File metadata and controls
143 lines (142 loc) · 4.85 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
args: [ '--unsafe' ]
# exclude helm chart templates
exclude: ^projects/control-service/projects/helm_charts
- id: check-json
exclude: (^projects/frontend/data-pipelines/gui/tsconfig.json|^projects/frontend/data-pipelines/gui/package-lock.json|^projects/frontend/data-pipelines/gui/projects/data-pipelines/.eslintrc.json|^projects/frontend/data-pipelines/gui/projects/data-pipelines/tsconfig.lib.prod.json|^projects/frontend/data-pipelines/gui/projects/data-pipelines/tsconfig.spec.json|^projects/frontend/data-pipelines/gui/projects/data-pipelines/tsconfig.lib.json|^projects/frontend/data-pipelines/gui/projects/ui/.eslintrc.json|^projects/frontend/data-pipelines/gui/projects/ui/tsconfig.app.json|^projects/frontend/data-pipelines/gui/projects/ui/tsconfig.spec.json)
- id: check-ast
exclude: ^projects/vdk-core/tests/functional/run/jobs/syntax-error-job/1_step.py
- id: check-added-large-files
exclude: (^projects/frontend/data-pipelines/gui/tsconfig.json|^projects/frontend/data-pipelines/gui/package-lock.json|^projects/frontend/data-pipelines/gui/projects/ui/src/assets/css/clr-ui.min.css)
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-executables-have-shebangs
- id: requirements-txt-fixer
- id: detect-private-key
- id: fix-byte-order-marker
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.0dev
hooks:
- id: gitlint
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python3
exclude: (^projects/vdk-core/tests/functional/run/jobs/syntax-error-job/1_step.py|^projects/vdk-plugins/vdk-notebook/tests/jobs/rest-api-job-fail-syntax-error/steps.ipynb)
# ensure pydoc is up-to standard
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: # http://www.pydocstyle.org/en/stable/error_codes.html --convention=pep257 seems too much?
- --select=D101,D103,D300
- --match='(?!test_).*\.py'
- repo: https://github.com/pre-commit/mirrors-pylint
rev: 'v3.0.0a5'
hooks:
- id: pylint
args: [ --exit-zero ]
#- repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.812
# hooks:
# - id: mypy
# files: ^(src/|tests/|plugins/)
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: [ --py37-plus, '--application-directories=.:src' ]
# use latest python syntax
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [ --py37-plus ]
# security check
#- repo: https://github.com/PyCQA/bandit
# rev: '1.7.0'
# hooks:
# - id: bandit
# exclude: tests
# args: [ -s, B101 ]
# add copyright notice
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.2
hooks:
- id: insert-license
files: \.java$
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: \.ts$
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: \.js$
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: \.html
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- <!--| ~| -->
- id: insert-license
files: (\.scss$|\.css$)
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: (\.yaml$|\.yml$)
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- id: insert-license
files: \.py$
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- id: insert-license
files: \.sh$
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
# License header create issues in helm chart yaml files
# https://github.com/helm/helm/issues/4409
# - id: insert-license
# files: \.yml$
# args:
# - --license-filepath
# - NOTICE.txt
# - id: insert-license
# files: \.yaml$
# args:
# - --license-filepath
# - NOTICE.txt