forked from intel/neural-compressor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
157 lines (147 loc) · 3.95 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
ci:
autofix_prs: true
autoupdate_schedule: quarterly
exclude: |
(?x)^(
conda_meta/.+|
neural_insights/gui.+|
neural_insights/test.+|
neural_solution/frontend/gRPC/proto/neural_solution_pb2.py|
neural_coder/extensions/.+|
neural_coder/examples/.+
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
files: (.*\.(py|md|rst|yaml|yml))$
exclude: |
(?x)^(
examples/.+
)$
- id: check-json
exclude: |
(?x)^(
.vscode/settings_recommended.json
)$
- id: check-yaml
exclude: |
(?x)^(
conda_meta/|
neural_compressor/template/pruning.yaml|
neural_compressor/adaptor/tensorflow_itex.yaml|
neural_compressor/adaptor/tensorflow.yaml
)$
- id: debug-statements
- id: file-contents-sorter
files: |
(?x)^(
.azure-pipelines/scripts/codeScan/pyspelling/inc_dict.txt|
.azure-pipelines/scripts/codeScan/pydocstyle/scan_path*.txt
)$
args: [--unique]
- id: requirements-txt-fixer
exclude: |
(?x)^(
examples/.+
)$
- id: trailing-whitespace
files: (.*\.(py|rst|cmake|yaml|yml))$
exclude: |
(?x)^(
examples/.+
)$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
hooks:
- id: insert-license
files: |
(?x)^(
neural_solution/.*(py|yaml|yml|sh)|
neural_compressor/.*(py|yaml|yml|sh)|
neural_insights/.*(py|yaml|yml|sh)
)$
exclude: |
(?x)^(
neural_solution/test/.*
)$
args:
[
--license-filepath=.github/license_template.txt,
--use-current-year,
--detect-license-in-X-top-lines=40,
--skip-license-insertion-comment=Copyright,
]
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
name: Unused noqa
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
exclude: |
(?x)^(
examples/.+
)$
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: [
--in-place,
--wrap-summaries=0, # 0 means disable wrap
--wrap-descriptions=0, # 0 means disable wrap
--black,
--style=google,
]
exclude: |
(?x)^(
examples/.+
)$
- repo: https://github.com/psf/black.git
rev: 24.1.1
hooks:
- id: black
files: (.*\.py)$
exclude: |
(?x)^(
neural_compressor/conf/config.py|
neural_compressor/conf/pythonic_config.py|
examples/.+
)$
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
args: [--line-length=120, --skip-errors]
additional_dependencies:
- black==24.1.1
exclude: |
(?x)^(
examples/.+|
docs/source-app
)$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude: |
(?x)^(
examples/.*(txt|patch)|
examples/onnxrt/nlp/huggingface_model/text_generation/llama/quantization/ptq_static/prompt.json|
examples/notebook/dynas/ResNet50_Quantiation_Search_Supernet_NAS.ipynb
)$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.15
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --no-cache]
exclude: |
(?x)^(
examples/.+
)$