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
125 lines (122 loc) · 3.97 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
125 lines (122 loc) · 3.97 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
# 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/.*|
.github/.*|
.pre-commit-config.yaml|
.pylintrc|
docker-compose.yaml|
)$
exclude: |
(?x)^(
(
starboard/contrib/RDK|
)/
)
repos:
- repo: https://cobalt.googlesource.com/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-xml
exclude: |
(?x)^(
cobalt/shell/android/javatests/AndroidManifest.xml
)
- id: check-yaml
- id: check-json
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: local
hooks:
- id: chromium-pre-commit # To test: pre-commit run --hook-stage manual 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]
files: ^.*$ # Apply to all file paths
stages: [manual] # Require manual run for testing
- 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==17.0.1']
- 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?$'