Source code

Revision control

Other Tools

1
# This Source Code Form is subject to the terms of the Mozilla Public
2
# License, v. 2.0. If a copy of the MPL was not distributed with this
3
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
---
5
job-defaults:
6
always-target: true
7
attributes:
8
code-review: true
9
treeherder:
10
kind: test
11
tier: 1
12
platform: lint/opt
13
worker-type: t-linux-xlarge
14
worker:
15
docker-image: {in-tree: "lint"}
16
max-run-time: 1800
17
artifacts:
18
- type: file
19
name: public/code-review/mozlint.json
20
path: /builds/worker/mozlint.json
21
env:
22
RUSTFMT: /build/rust/bin/rustfmt
23
RUSTUP_HOME: /build/rust
24
CARGO_HOME: /build/rust
25
run:
26
using: mach
27
when:
28
files-changed:
29
# Other misc lint related files.
30
- 'python/mozlint/**'
31
- 'tools/lint/**'
32
33
codespell:
34
description: Checks for misspellings in text files
35
treeherder:
36
symbol: text(spell)
37
run:
38
mach: lint -l codespell -f treeherder -f json:/builds/worker/mozlint.json
39
when:
40
files-changed:
41
- '**/*.js'
42
- '**/*.jsm'
43
- '**/*.jxs'
44
- '**/*.xml'
45
- '**/*.html'
46
- '**/*.xhtml'
47
- '**/*.cpp'
48
- '**/*.c'
49
- '**/*.h'
50
- '**/*.configure'
51
- '**/*.py'
52
- '**/*.properties'
53
- '**/*.rst'
54
- '**/*.ftl'
55
56
cpp-virtual-final:
57
description: lint C++ virtual function declarations
58
treeherder:
59
symbol: cpp(Cvf)
60
run:
61
mach: lint -l cpp-virtual-final -f treeherder -f json:/builds/worker/mozlint.json
62
when:
63
files-changed:
64
- '**/*.cpp'
65
- '**/*.h'
66
- '**/*.mm'
67
68
eslint:
69
description: JS lint check
70
treeherder:
71
symbol: js(ES)
72
run:
73
using: run-task
74
cwd: '{checkout}'
75
command: >
76
cp -r /build/node_modules_eslint node_modules &&
77
ln -s ../tools/lint/eslint/eslint-plugin-mozilla node_modules &&
78
ln -s ../tools/lint/eslint/eslint-plugin-spidermonkey-js node_modules &&
79
./mach lint -l eslint -f treeherder --quiet -f json:/builds/worker/mozlint.json
80
when:
81
files-changed:
82
# Files that are likely audited.
83
- '**/*.js'
84
- '**/*.jsm'
85
- '**/*.jsx'
86
- '**/*.html'
87
- '**/*.xhtml'
88
- '**/*.xml'
89
# Run when eslint policies change.
90
- '**/.eslintignore'
91
- '**/*eslintrc*'
92
# The plugin implementing custom checks.
93
- 'tools/lint/eslint/eslint-plugin-mozilla/**'
94
- 'tools/lint/eslint/eslint-plugin-spidermonkey-js/**'
95
96
license:
97
description: Check for license blocks in source files.
98
treeherder:
99
symbol: pedantic(license)
100
run:
101
mach: lint -l license -f treeherder -f json:/builds/worker/mozlint.json
102
when:
103
files-changed:
104
- '**/*.c'
105
- '**/*.cc'
106
- '**/*.cpp'
107
- '**/*.h'
108
- '**/*.html'
109
- '**/*.js'
110
- '**/*.jsm'
111
- '**/*.jsx'
112
- '**/*.m'
113
- '**/*.mm'
114
- '**/*.py'
115
- '**/*.rs'
116
- '**/*.xhtml'
117
- '**/*.xml'
118
- '**/*.xul'
119
120
lintpref:
121
description: Check for duplicates between all.js and StaticPrefList.yaml.
122
treeherder:
123
symbol: misc(pref)
124
run:
125
mach: lint -l lintpref -f treeherder -f json:/builds/worker/mozlint.json
126
when:
127
files-changed:
128
- modules/libpref/init/all.js
129
- modules/libpref/init/StaticPrefList.yaml
130
131
mingw-cap:
132
description: lint for MinGW Capitalization issues
133
treeherder:
134
symbol: misc(mingw)
135
run:
136
mach: lint -l mingw-capitalization -f treeherder -f json:/builds/worker/mozlint.json
137
when:
138
files-changed:
139
- '**/*.cpp'
140
- '**/*.cc'
141
- '**/*.c'
142
- '**/*.h'
143
144
py-compat:
145
description: lint for python 2/3 compatibility issues
146
treeherder:
147
symbol: py(py-compat)
148
run:
149
mach: lint -l py2 -l py3 -f treeherder -f json:/builds/worker/mozlint.json
150
when:
151
files-changed:
152
- '**/*.py'
153
- '**/.flake8'
154
155
py-flake8:
156
description: flake8 run over the gecko codebase
157
treeherder:
158
symbol: py(f8)
159
run:
160
mach: lint -l flake8 -f treeherder -f json:/builds/worker/mozlint.json
161
when:
162
files-changed:
163
- '**/*.py'
164
- '**/.flake8'
165
# moz.configure files are also Python files.
166
- '**/*.configure'
167
168
test-manifest:
169
description: lint test manifests
170
treeherder:
171
symbol: misc(tm)
172
run:
173
mach: lint -l test-disable -f treeherder -f json:/builds/worker/mozlint.json
174
when:
175
files-changed:
176
- '**/*.ini'
177
- 'python/mozlint/**'
178
- 'tools/lint/**'
179
180
wptlint-gecko:
181
description: web-platform-tests linter
182
treeherder:
183
symbol: misc(W)
184
run:
185
mach: lint -l wpt -f treeherder -f json:/builds/worker/mozlint.json
186
when:
187
files-changed:
188
- 'testing/web-platform/tests/**'
189
- 'testing/web-platform/mozilla/tests/**'
190
191
yaml:
192
description: yamllint run over the gecko codebase
193
treeherder:
194
symbol: pedantic(yaml)
195
run:
196
mach: lint -l yaml -f treeherder -f json:/builds/worker/mozlint.json
197
when:
198
files-changed:
199
- '**/*.yml'
200
- '**/*.yaml'
201
- '**/.ymllint'
202
203
rst:
204
description: rst lint run over the gecko codebase
205
treeherder:
206
symbol: text(rst)
207
run:
208
mach: lint -l rst -f treeherder -f json:/builds/worker/mozlint.json
209
when:
210
files-changed:
211
- '**/*.rst'
212
213
shellcheck:
214
description: shellcheck run over the gecko codebase
215
treeherder:
216
symbol: misc(shell)
217
run:
218
mach: lint -l shellcheck -f treeherder -f json:/builds/worker/mozlint.json
219
when:
220
files-changed:
221
- '**/*.sh'
222
223
224
localization:
225
description: l10n tests for strings with errors and conflicts with cross-channel
226
treeherder:
227
symbol: text(l1nt)
228
run:
229
mach: lint -l l10n -f treeherder
230
when:
231
files-changed:
232
- '**/locales/en-US/**'
233
- '**/l10n.toml'
234
- 'third_party/python/compare-locales/**'
235
- 'third_party/python/fluent/**'
236
237
238
rustfmt:
239
description: rustfmt on the Rust code
240
treeherder:
241
symbol: misc(rustfmt)
242
run:
243
mach: lint -l rustfmt -f treeherder -f json:/builds/worker/mozlint.json
244
when:
245
files-changed:
246
- '**/*.rs'
247
248
249
file-whitespace:
250
description: Check for trailing whitespaces and Windows CR
251
platform: lint/opt
252
treeherder:
253
symbol: pedantic(file-whitespace)
254
run:
255
mach: lint -l file-whitespace -f treeherder -f json:/builds/worker/mozlint.json
256
when:
257
files-changed:
258
- '**/*.c'
259
- '**/*.cc'
260
- '**/*.cpp'
261
- '**/*.h'
262
- '**/*.py'
263
- '**/*.rs'
264
265
266
file-perm:
267
description: Check for incorrect permissions on source files
268
platform: lint/opt
269
treeherder:
270
symbol: pedantic(file-perm)
271
run:
272
mach: lint -l file-perm -f treeherder -f json:/builds/worker/mozlint.json
273
when:
274
files-changed:
275
- '**/*.c'
276
- '**/*.cc'
277
- '**/*.cpp'
278
- '**/*.h'
279
- '**/*.html'
280
- '**/*.js'
281
- '**/*.jsm'
282
- '**/*.jsx'
283
- '**/*.m'
284
- '**/*.mm'
285
- '**/*.rs'
286
- '**/*.xhtml'
287
- '**/*.xml'
288
- '**/*.xul'