forked from youtube/cobalt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
178 lines (173 loc) · 5.74 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [commit]
default_language_version:
python: python3
exclude: |
(?x)^(
(
base|
build|
buildtools|
components/crash/core/common|
components/metrics|
components/metrics_services_manager|
components/ukm|
components/variations|
components/version_info|
crypto|
extensions/buildflags|
net|
internal/starboard/shared/playstation/glimp/shaders|
testing|
third_party|
tools/gyp|
url
)/
|
components/update_client/((?!cobalt).)*$
|
.*\.sig$
)
repos:
- repo: https://cobalt.googlesource.com/pre-commit-hooks
rev: e1668fe86af3810fbca72b8653fe478e66a0afdc # v3.2.0
hooks:
- id: check-case-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- repo: https://cobalt.googlesource.com/codespell
rev: 67c489d36dd4c52cbb9e4755d90c35c6231842ef # v2.0.0
hooks:
- id: codespell
name: Spell Check
args: [-x, .codespellignorelines,
# The --ignore-words-list argument has a bug where it needs to
# be lowercase, see
# https://github.com/codespell-project/codespell/issues/1390
--ignore-words-list, atleast]
exclude: |
(?x)^(
(internal/)?starboard/[^/]+/i18n/|
cobalt/content/licenses/|
cobalt/fetch/embedded_scripts|
cobalt/loader/cors_preflight.cc|
internal/cobalt/browser/splash_screen/youtube_splash_screen.html|
internal/starboard/shared/playstation/storage_internal.cc|
starboard/shared/win32/media_transform.cc
)
- repo: local
hooks:
- id: sync-keyboxes
name: sync-keyboxes
entry: python ./precommit_hooks/sync_keyboxes_wrapper.py
language: python
stages: [post-checkout]
always_run: true
- id: clang-format
name: clang-format
entry: clang-format
language: python
types: [c++]
args: [-i, -style=file]
additional_dependencies: ['clang-format']
- id: cpplint
name: cpplint
entry: cpplint
language: system
types: [c++]
args: [--verbose=4, --quiet]
exclude: |
(?x)(
^cobalt/bindings/(templates|generated)/|
^internal/starboard/shared/uikit/.*\.h$
)
- id: yapf
name: yapf
description: Run yapf (the python formatter) in-place on changed files.
entry: yapf
language: system
types: [python]
args: [-i, -vv]
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: [-d W0201]
- id: google-java-format
name: google-java-format
entry: python ./precommit_hooks/google_java_format_wrapper.py
language: python
types: [java]
args: [-i]
- id: gcheckstyle
name: Lint Java With gcheckstyle
entry: python ./precommit_hooks/gcheckstyle_wrapper.py
language: python
types: [java]
verbose: true
- id: check-copyright-year
name: check copyright year
entry: python ./precommit_hooks/check_copyright_year.py
language: python
types: [file, text]
stages: [push]
exclude: |
(?x)^(
.pre-commit-config.yaml$|
cobalt/base/unicode/|
cobalt/math/|
cobalt/media/|
cobalt/layout_tests/testdata/|
cobalt/webdriver/screencast/|
cobalt/websocket/|
nb/|
starboard/android/apk/app/src/main/java/dev/cobalt/media/MediaDrmBridge.java$|
starboard/shared/starboard/player/filter/decoded_audio_queue.cc$|
starboard/shared/starboard/player/filter/decoded_audio_queue.h$|
starboard/shared/starboard/player/filter/wsola_internal.cc$
)
exclude_types: [markdown]
verbose: true
- id: check-if-starboard-interface-changed
name: check if starboard interface changed
entry: python ./precommit_hooks/warn_that_starboard_interface_changed_wrapper.py
language: python
files: '^starboard/[^/]+\.h$'
stages: [push]
- id: download-resources
name: download resources
entry: python ./download_resources.py
language: python
stages: [post-checkout]
always_run: true
- id: test-download-from-gcs-helper
name: test download from gcs helper
entry: python
language: python
pass_filenames: false
always_run: true
stages: [push]
args: [-m, unittest, tools/download_from_gcs_test.py]
- id: test-python3-compatibility
name: Test Python 3 Compatibility
description: Checks that scripts can be run in Python 3
entry: python precommit_hooks/python3_check.py
language: python
types: [python]
verbose: true
- id: check-bug-in-commit-message
name: Check Bug In Commit Message
description: Checks for a tracking bug in a commit message
entry: python precommit_hooks/check_bug_in_description_wrapper.py
language: python
stages: [push]
always_run: true
pass_filenames: false
- id: gn-format
name: GN format
entry: gn format
language: system
files: '.*\.gni?$'