-
Notifications
You must be signed in to change notification settings - Fork 57
/
.pre-commit-config.yaml
150 lines (149 loc) · 5.33 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Copyright 2023-2024 Broadcom
# SPDX-License-Identifier: Apache-2.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.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/psf/black
rev: 23.11.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.12.0
hooks:
- id: reorder-python-imports
args: [ --py37-plus, '--application-directories=.:src' ]
# use latest python syntax
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
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.5.4
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: \.css
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*| *| */
- id: insert-license
files: \.scss
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- /*!| *| */
- id: insert-license
files: (\.yaml$|\.yml$)
# exclude control service helm chart templates as they require template-style comments
exclude: ^projects/control-service/projects/helm_charts/pipelines-control-service/templates
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- id: insert-license
files: (^projects/control-service/projects/helm_charts/pipelines-control-service/templates/.+\.yaml$|^projects/control-service/projects/helm_charts/pipelines-control-service/templates/.+\.yml$)
args:
- --use-current-year
- --license-filepath
- NOTICE.txt
- --comment-style
- '{{- /*| | */}}'
- 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
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
types_or: [scss, css, javascript, ts, html]