-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
90 lines (86 loc) · 2.7 KB
/
.pre-commit-config.yaml
File metadata and controls
90 lines (86 loc) · 2.7 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
exclude: .*/contrib/.*
# for pre-commit 4.4.0
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v6.0.0'
hooks:
- name: 'Check file end line'
id: end-of-file-fixer
# exclude .svg files
exclude: \.(svg)$
- name: 'Check trailing whitespace'
id: trailing-whitespace
- name: 'Check executable files'
id: check-executables-have-shebangs
exclude:
(?x)^(
.*/__init__.py$|
.*/nnc/utils/.*\.py$|
runtime/tests/scripts/models/.*/config\.sh$|
res/TensorFlowTests/.*\.py$
)
- repo: https://github.com/rhysd/actionlint
rev: 'v1.7.9'
# https://github.com/rhysd/actionlint/blob/v1.7.9/docs/usage.md#pre-commit
hooks:
- name: 'Check CI workflows with actionlint'
id: actionlint
- repo: https://github.com/google/yapf
rev: 'v0.43.0'
hooks:
- name: 'Check CI Python scripts with yapf'
id: yapf
types: [file] # override default type check exceptional case
# yapf pre-commit cannot handle exceptional case:
# one-cmds don't have '.py' extension.
# onecc-docker don't have '.py' extension.
# visq don't have '.py' extension.
# fm-equalize doesn't have '.py' extension.
files:
(?x)^(
.*\.py$|
compiler/one-cmds/[^(\./)]*$|
compiler/onecc-docker/onecc-docker$|
compiler/visq/visq$|
compiler/fm-equalize/fm-equalize$
)
# Ignore shell script: one-prepare-venv
# Exclude files in .yapfignore - yapf's pre-commit issue
exclude:
(?x)^(
compiler/_deprecated/.*|
compiler/one-cmds/one-prepare-venv|
runtime/3rdparty/.*|
runtime/contrib/.*|
runtime/tests/nnapi/nnapi_test_generator/.*|
runtime/tests/nnapi/specs/.*
)$
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v16.0.6'
hooks:
- name: 'Check C/C++ code with clang-format'
id: clang-format
types_or: [file] # override default type check to cl files
files: ((\.c[cl]?)|(\.cpp)|(\.h(pp)?))$
exclude:
(?x)^(
compiler/_deprecated/.*|
runtime/contrib/.*
)
- repo: local
hooks:
- name: 'Check copyright headers'
id: copyright-check
entry: infra/git-hooks/copyright-check.sh
language: script
pass_filenames: true
types: [file]
files: \.(c[cl]?|cpp|h(pp)?)$
# Ignore 3rd-party code
exclude:
(?x)^(
.*/NeuralNetworks.h|
onert-micro/externals/.*|
runtime/3rdparty/.*|
runtime/tests/nnapi/.*
)