-
Notifications
You must be signed in to change notification settings - Fork 67
/
.pre-commit-config.yaml
158 lines (158 loc) · 5.59 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
151
152
153
154
155
156
157
158
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
exclude: ^(src/pages/|src/bk-login/pages)
- id: trailing-whitespace
exclude: ^(src/pages/|src/bk-login/pages)
- repo: local
hooks:
- id: Name check
name: Check sensitive info of name
verbose: true
language: system
entry: bash -c "if [[ -d pre_commit_hooks ]]; then pre_commit_hooks/rtx.sh $@; fi"
exclude: >
(?x)^(
.*/\.env|
.*/poetry\.lock|
.*/pyproject\.toml|
src/bk-user/logs|
src/pages/node_modules/
)$
- id: IP check
name: Check sensitive info of ip
verbose: true
language: system
exclude: >
(?x)^(
.*/\.env|
.*/poetry\.lock|
.*/pyproject\.toml|
.*/requirements_dev\.txt|
\.github/workflows/bk-user.yml|
\.github/workflows/bk-login.yml|
\.github/workflows/idp-plugins.yml|
src/bk-user/logs|src/pages/node_modules/|
src/bk-login/pages/src/views/components/protocol.vue|
src/pages/static/bk_icon_font/iconcool.json|
src/pages/static/bk_icon_font/iconcool.js|
src/pages/paas-server/index.js|
src/bk-login/pages/paas-server/index.js
)$
entry: bash -c "if [[ -d pre_commit_hooks ]]; then pre_commit_hooks/ip.sh $@; fi"
- repo: local
hooks:
- id: ruff-format
name: ruff-formatter
language: python
types: [python]
entry: ruff format --config=src/bk-user/pyproject.toml --no-cache
files: src/bk-user/
- id: ruff-check
name: ruff-checker
language: python
types: [python]
entry: ruff check --config=src/bk-user/pyproject.toml --fix --no-cache
files: src/bk-user/
- id: mypy
name: mypy
language: python
types: [python]
entry: mypy --config-file=src/bk-user/pyproject.toml
files: src/bk-user/
- id: import-linter
name: import-linter
require_serial: true
language: system
entry: bash -c "cd src/bk-user && lint-imports"
- id: requirements-export
name: requirements-export
language: system
entry: bash -c "cd src/bk-user && poetry export -f requirements.txt --output requirements.txt --without-hashes"
pass_filenames: false
files: ^src/bk-user/poetry.lock$
- id: requirements-dev-export
name: requirements-dev-export
language: system
entry: bash -c "cd src/bk-user && poetry export --with dev -f requirements.txt --output requirements_dev.txt --without-hashes"
pass_filenames: false
files: ^src/bk-user/poetry.lock$
- repo: local
hooks:
- id: format
name: ruff-formatter
language: python
types: [python]
entry: ruff format --config=src/bk-login/pyproject.toml --no-cache
files: src/bk-login/
- id: ruff
name: ruff
language: python
types: [python]
entry: ruff check --config=src/bk-login/pyproject.toml --unsafe-fixes --fix --no-cache
files: src/bk-login/
- id: mypy
name: mypy
language: python
types: [python]
entry: mypy --config-file=src/bk-login/pyproject.toml
files: src/bk-login/
- id: import-linter
name: import-linter
require_serial: true
language: system
entry: bash -c "cd src/bk-login && lint-imports"
- id: requirements-export
name: requirements-export
language: system
entry: bash -c "cd src/bk-login && poetry export -f requirements.txt --output requirements.txt --without-hashes"
pass_filenames: false
files: ^src/bk-login/poetry.lock$
- id: requirements-dev-export
name: requirements-dev-export
language: system
entry: bash -c "cd src/bk-login && poetry export --with dev -f requirements.txt --output requirements_dev.txt --without-hashes"
pass_filenames: false
files: ^src/bk-login/poetry.lock$
- repo: local
hooks:
- id: format
name: ruff-formatter
language: python
types: [python]
entry: ruff format --config=src/bk-plugins/pyproject.toml --no-cache
files: src/bk-plugins/
- id: ruff
name: ruff
language: python
types: [python]
entry: ruff check --config=src/idp-plugins/pyproject.toml --fix --no-cache
files: src/idp-plugins/
- id: mypy
name: mypy
language: python
types: [python]
entry: mypy --config-file=src/idp-plugins/pyproject.toml
files: src/idp-plugins/
- id: requirements-export
name: requirements-export
language: system
entry: bash -c "cd src/idp-plugins && poetry export -f requirements.txt --output requirements.txt --without-hashes"
pass_filenames: false
files: ^src/idp-plugins/poetry.lock$
- id: requirements-dev-export
name: requirements-dev-export
language: system
entry: bash -c "cd src/idp-plugins && poetry export --with dev -f requirements.txt --output requirements_dev.txt --without-hashes"
pass_filenames: false
files: ^src/idp-plugins/poetry.lock$