forked from youtube/cobalt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
147 lines (144 loc) · 4.55 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
147 lines (144 loc) · 4.55 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
144
145
146
147
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [pre-commit]
default_language_version:
python: python3
files: |
(?x)^(
(.*/)?cobalt/.*|
(.*/)?starboard/.*|
.agent/.*|
.github/.*|
.pre-commit-config.yaml|
.pylintrc|
docker-compose.yaml|
)$
exclude: |
(?x)^(
(
starboard/contrib/RDK|
starboard/contrib/rdk|
)/
)
repos:
- repo: https://github.com/google/keep-sorted
rev: ac58172d1655aa47a6f806e56ff0f269d6dbe637 # v0.8.0
hooks:
- id: keep-sorted
- repo: https://cobalt.googlesource.com/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-xml
exclude: |
(?x)^(
cobalt/shell/android/javatests/AndroidManifest.xml
)
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/rhysd/actionlint
rev: 03d0035246f3e81f36aed592ffb4bebf33a03106
hooks:
- id: actionlint
files: ^.github/workflows
- repo: local
hooks:
- id: autoroll-format
name: autoroll-format
entry: python3 ./cobalt/precommit/autoroll_check.py
language: python
files: ^.github/AUTOROLL$
pass_filenames: false
- id: chromium-pre-commit
name: Chromium presubmit bridge
entry: ./third_party/depot_tools/vpython3 --vpython-spec=./third_party/depot_tools/.vpython3 ./cobalt/precommit/run_chromium_presubmits.py
language: system
types: [file]
exclude: |
(?x)^(
(.*/)?cobalt/.*|
(.*/)?starboard/.*|
)
files: ^.*$ # Apply to all file paths
- id: clang-format
name: clang-format
entry: clang-format
language: python
types: [c++]
args: [-i, -style=file]
exclude: |
(?x)(
^cobalt/shell/app/resource.h$|
^starboard/shared/uikit/accessibility_extension.cc$|
^starboard/shared/uikit/player_configuration.cc$
)
additional_dependencies: ['clang-format==21.1.0']
- id: cpplint
name: cpplint
entry: cpplint
language: python
types: [c++]
args: [--verbose=5, --quiet]
exclude: |
(?x)(
^cobalt/bindings/(templates|generated)/|
^cobalt/common/features/starboard_features_initialization.cc$|
^cobalt/shell/app/resource.h$|
^starboard/shared/uikit/.*\.h$|
^starboard/shared/starboard/starboard_feature_test.cc$|
^starboard/shared/starboard/link_receiver.cc$
)
additional_dependencies: ['cpplint==2.0.2']
- id: yapf
name: yapf
entry: yapf
language: python
types: [python]
args: [-i, -vv]
additional_dependencies: ['yapf==0.40.2']
- id: pylint
name: pylint
entry: pylint
language: python
types: [python]
args: [-d W0201]
additional_dependencies: ['pylint==3.3.1']
- id: python3-compatibility-check
name: Python 3 Compatibility Check
entry: python3 ./cobalt/precommit/python3_check.py
language: python
types: [python]
- id: google-java-format
name: google-java-format
entry: python3 ./cobalt/precommit/google_java_format_wrapper.py
language: python
types: [java]
args: [-i]
# (TODO:b/454687024) Re-enable. Temporarily disabled post m138 merge
# due to unintended update of java code formatting rules
exclude: |
(?x)^(
starboard/|
cobalt/
)
- id: gcheckstyle
name: gcheckstyle
entry: python3 ./cobalt/precommit/gcheckstyle_wrapper.py
language: python
exclude: |
(?x)^(
starboard/android/apk/app/src/main/java/dev/cobalt/storage/StorageProto.java|
cobalt/android/apk/app/src/org/chromium/content_shell/Util.java|
cobalt/android/apk/app/src/org/chromium/content_shell/Shell.java|
cobalt/android/apk/app/src/org/chromium/content_shell/ShellManager.java
)
types: [java]
- id: gn-format
name: gn-format
entry: gn format
language: system
files: '.*\.gni?$'