Source code

Revision control

Copy as Markdown

Other Tools

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
---
job-defaults:
always-target: true
attributes:
code-review: true
treeherder:
kind: test
tier: 1
platform: lint/opt
worker-type: t-linux-xlarge-source
worker:
docker-image: {in-tree: "lint"}
max-run-time: 1800
artifacts:
- type: file
name: public/code-review/mozlint.json
path: /builds/worker/mozlint.json
run:
using: mach
codespell:
description: Checks for misspellings in text files
treeherder:
symbol: text(spell)
# We don't want patches to be backed out because of a typo, a follow up bug will be
# good enough
tier: 2
run:
mach: lint -v -l codespell -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: codespell.yml
rejected-words:
description: Reject some words we don't want to use in the code base
treeherder:
symbol: text(rejected-words)
# We don't want patches to be backed out because of this, a follow up bug will be
# good enough
tier: 2
run:
mach: lint -v -l rejected-words -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: rejected-words.yml
eslint:
description: JS lint check
treeherder:
symbol: js(ES)
run:
using: run-task
cwd: '{checkout}'
command: >
cp -r /build/node_modules_eslint node_modules &&
cp -r /build/node_modules_eslint-plugin-mozilla/ tools/lint/eslint/eslint-plugin-mozilla/node_modules &&
ln -s ../tools/lint/eslint/eslint-plugin-mozilla node_modules &&
ln -s ../tools/lint/eslint/eslint-plugin-spidermonkey-js node_modules &&
./mach lint -v -l eslint -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: eslint.yml
eslint-build:
description: ESLint checks with build data
always-target: false
# Triggered by cron task, don't run on any projects and disable optimization.
run-on-projects: []
when: null
attributes:
code-review: false
treeherder:
symbol: js(ES-B)
tier: 2
run:
using: run-task
cwd: '{checkout}'
command: >
export MOZ_XPT_ARTIFACTS_DIR="$MOZ_FETCHES_DIR/$MOZ_XPT_ARTIFACTS_DIRNAME" &&
find "$MOZ_XPT_ARTIFACTS_DIR" &&
cp -r /build/node_modules_eslint node_modules &&
cp -r /build/node_modules_eslint-plugin-mozilla/ tools/lint/eslint/eslint-plugin-mozilla/node_modules &&
ln -s ../tools/lint/eslint/eslint-plugin-mozilla node_modules &&
ln -s ../tools/lint/eslint/eslint-plugin-spidermonkey-js node_modules &&
./mach lint -v -l eslint -f treeherder --quiet -f json:/builds/worker/mozlint.json . --rule "mozilla/valid-services-property: error" --rule "mozilla/valid-ci-uses: error"
worker:
env:
MOZ_XPT_ARTIFACTS_DIRNAME: xpt_artifacts
require-build:
.*: build-linux64/opt
fetches:
build:
- artifact: target.xpt_artifacts.zip
dest: xpt_artifacts
stylelint:
description: CSS lint check
treeherder:
symbol: stylelint
run:
using: run-task
cwd: '{checkout}'
command: >
cp -r /build/node_modules_eslint node_modules &&
./mach lint -v -l stylelint -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: stylelint.yml
license:
description: Check for license blocks in source files.
treeherder:
symbol: pedantic(license)
run:
mach: lint -v -l license -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: license.yml
lintpref:
description: Check for duplicates between all.js and StaticPrefList.yaml.
treeherder:
symbol: misc(pref)
run:
mach: lint -v -l lintpref -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: lintpref.yml
mingw-cap:
description: lint for MinGW Capitalization issues
treeherder:
symbol: misc(mingw)
run:
mach: lint -v -l mingw-capitalization -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: mingw-capitalization.yml
updatebot:
description: Ensure moz.yaml files are valid per schema
treeherder:
symbol: misc(mozyaml)
run:
mach: lint -v -l updatebot -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: updatebot.yml
mscom-init:
description: Lint for Microsoft COM initialization
treeherder:
symbol: misc(mscom)
run:
mach: lint -v -l mscom-init -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: mscom-init.yml
py-black:
description: black run over the gecko codebase
treeherder:
symbol: py(black)
run:
mach: lint -v -l black -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: black.yml
py-ruff:
description: Run ruff over the gecko codebase
treeherder:
symbol: py(ruff)
run:
mach: lint -v -l ruff -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: ruff.yml
test-manifest:
description: lint test manifests
treeherder:
symbol: misc(tm)
run:
mach: lint -v -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint:
- test-manifest-alpha.yml
- test-manifest-disable.yml
- test-manifest-skip-if.yml
wptlint-gecko:
description: web-platform-tests linter
treeherder:
symbol: misc(W)
run:
mach: lint -v -l wpt -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: wpt.yml
yaml:
description: yamllint run over the gecko codebase
treeherder:
symbol: pedantic(yaml)
run:
mach: lint -v -l yaml -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: yaml.yml
rst:
description: rst lint run over the gecko codebase
treeherder:
symbol: text(rst)
run:
mach: lint -v -l rst -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: rst.yml
shellcheck:
description: shellcheck run over the gecko codebase
treeherder:
symbol: misc(shell)
run:
mach: lint -v -l shellcheck -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: shellcheck.yml
localization:
description: l10n tests for strings with errors
treeherder:
symbol: l10n(l1nt)
run:
mach: lint -v -l l10n -f treeherder *
attributes:
code-review: false
optimization:
skip-unless-mozlint: l10n.yml
l10n-conflicts:
description: l10n tests for strings with errors and conflicts with cross-channel
treeherder:
symbol: l10n(l1nt-conflicts)
always-target: false
run-on-projects: []
run:
mach: lint -W -l l10n -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: l10n.yml
clang-format:
description: clang-format on the C/C++ code
treeherder:
symbol: cpp(clang-format)
run:
mach: lint -v -l clang-format -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: clang-format.yml
dependencies:
linux64-clang-tidy: toolchain-linux64-clang-tidy
fetches:
linux64-clang-tidy:
- artifact: clang-tidy.tar.zst
dest: clang-tools
rustfmt:
description: rustfmt on the Rust code
treeherder:
symbol: rust(rustfmt)
run:
mach: lint -v -l rustfmt -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: rustfmt.yml
fetches:
toolchain:
- linux64-rust
clippy:
description: clippy on the Rust code
treeherder:
symbol: rust(clippy)
run:
mach: lint -v -l clippy -f treeherder -f json:/builds/worker/mozlint.json -j 1 .
optimization:
skip-unless-mozlint: clippy.yml
fetches:
toolchain:
- linux64-clang
- linux64-rust
- linux64-rust-size
- linux64-cbindgen
- linux64-dump_syms
- linux64-sccache
- linux64-nasm
- linux64-node
- linux64-pkgconf
- sysroot-x86_64-linux-gnu
- sysroot-wasm32-wasi
file-whitespace:
description: Check for trailing whitespaces and Windows CR
platform: lint/opt
treeherder:
symbol: pedantic(file-whitespace)
# We don't want patches to be backed out because of this, a follow up bug will be
# good enough
tier: 2
run:
mach: lint -v -l file-whitespace -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: file-whitespace.yml
file-perm:
description: Check for incorrect permissions on source files
platform: lint/opt
treeherder:
symbol: pedantic(file-perm)
# We don't want patches to be backed out because of this, a follow up bug will be
# good enough
tier: 2
run:
mach: lint -v -l file-perm -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: file-perm.yml
perfdocs-verify:
description: Verifies Performance Testing documentation
treeherder:
symbol: text(perfdocs)
run:
mach: lint -v -l perfdocs -f treeherder -f json:/builds/worker/mozlint.json .
worker:
env:
WORKSPACE: /builds/worker/checkouts/gecko/
DECISION_TASK_ID: {task-reference: <decision>}
artifacts:
- type: file
name: public/perfdocs.diff
path: /builds/worker/diff.txt
when:
files-changed:
- 'devtools/perfdocs/**'
- 'taskcluster/**'
- '**/perftest.toml'
- 'python/mozperftest/**'
- 'testing/awsy/**'
- 'testing/raptor/**'
- 'testing/talos/**'
- 'testing/performance/**'
- 'testing/perfdocs/**'
- 'tools/lint/perfdocs.yml'
condprof-addons-verify:
description: |
Verifies all xpi files needed by condprof customization sideloading addons are
included in the firefox-addons fetch task.
treeherder:
symbol: misc(condprof-addons)
run:
mach: |
lint -v -l condprof-addons -f treeherder -f json:/builds/worker/mozlint.json .
fetches:
fetch:
- firefox-addons
optimization:
skip-unless-mozlint: condprof-addons.yml
fluent-lint:
description: Check for problems with Fluent files.
platform: lint/opt
treeherder:
symbol: l10n(fluent)
run:
mach: lint --linter fluent-lint -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: fluent-lint.yml
trojan-source:
description: Trojan Source attack - CVE-2021-42572
platform: lint/opt
treeherder:
symbol: misc(trojan-source)
run:
mach: lint -v -l trojan-source --include-third-party -f treeherder -f json:/builds/worker/mozlint.json .
optimization:
skip-unless-mozlint: trojan-source.yml
ignorefile-test:
description: .gitignore vs .hgignore consistency check
platform: lint/opt
treeherder:
symbol: ignorefile
run:
mach: lint -v -l ignorefile .gitignore .hgignore
optimization:
skip-unless-mozlint: ignorefile.yml