gecko-dev/taskcluster/ci/source-test/mozlint.yml

289 строки
7.7 KiB
YAML

# 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
worker:
docker-image: {in-tree: "lint"}
max-run-time: 1800
artifacts:
- type: file
name: public/code-review/mozlint.json
path: /builds/worker/mozlint.json
env:
RUSTFMT: /build/rust/bin/rustfmt
RUSTUP_HOME: /build/rust
CARGO_HOME: /build/rust
run:
using: mach
when:
files-changed:
# Other misc lint related files.
- 'python/mozlint/**'
- 'tools/lint/**'
codespell:
description: Checks for misspellings in text files
treeherder:
symbol: text(spell)
run:
mach: lint -l codespell -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.js'
- '**/*.jsm'
- '**/*.jxs'
- '**/*.xml'
- '**/*.html'
- '**/*.xhtml'
- '**/*.cpp'
- '**/*.c'
- '**/*.h'
- '**/*.configure'
- '**/*.py'
- '**/*.properties'
- '**/*.rst'
- '**/*.ftl'
cpp-virtual-final:
description: lint C++ virtual function declarations
treeherder:
symbol: cpp(Cvf)
run:
mach: lint -l cpp-virtual-final -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.cpp'
- '**/*.h'
- '**/*.mm'
eslint:
description: JS lint check
treeherder:
symbol: js(ES)
run:
using: run-task
cwd: '{checkout}'
command: >
cp -r /build/node_modules_eslint 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 -l eslint -f treeherder --quiet -f json:/builds/worker/mozlint.json
when:
files-changed:
# Files that are likely audited.
- '**/*.js'
- '**/*.jsm'
- '**/*.jsx'
- '**/*.html'
- '**/*.xhtml'
- '**/*.xml'
# Run when eslint policies change.
- '**/.eslintignore'
- '**/*eslintrc*'
# The plugin implementing custom checks.
- 'tools/lint/eslint/eslint-plugin-mozilla/**'
- 'tools/lint/eslint/eslint-plugin-spidermonkey-js/**'
license:
description: Check for license blocks in source files.
treeherder:
symbol: pedantic(license)
run:
mach: lint -l license -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.c'
- '**/*.cc'
- '**/*.cpp'
- '**/*.h'
- '**/*.html'
- '**/*.js'
- '**/*.jsm'
- '**/*.jsx'
- '**/*.m'
- '**/*.mm'
- '**/*.py'
- '**/*.rs'
- '**/*.xhtml'
- '**/*.xml'
- '**/*.xul'
lintpref:
description: Check for duplicates between all.js and StaticPrefList.yaml.
treeherder:
symbol: misc(pref)
run:
mach: lint -l lintpref -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- modules/libpref/init/all.js
- modules/libpref/init/StaticPrefList.yaml
mingw-cap:
description: lint for MinGW Capitalization issues
treeherder:
symbol: misc(mingw)
run:
mach: lint -l mingw-capitalization -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.cpp'
- '**/*.cc'
- '**/*.c'
- '**/*.h'
py-compat:
description: lint for python 2/3 compatibility issues
treeherder:
symbol: py(py-compat)
run:
mach: lint -l py2 -l py3 -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.py'
- '**/.flake8'
py-flake8:
description: flake8 run over the gecko codebase
treeherder:
symbol: py(f8)
run:
mach: lint -l flake8 -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.py'
- '**/.flake8'
# moz.configure files are also Python files.
- '**/*.configure'
test-manifest:
description: lint test manifests
treeherder:
symbol: misc(tm)
run:
mach: lint -l test-disable -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.ini'
- 'python/mozlint/**'
- 'tools/lint/**'
wptlint-gecko:
description: web-platform-tests linter
treeherder:
symbol: misc(W)
run:
mach: lint -l wpt -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- 'testing/web-platform/tests/**'
- 'testing/web-platform/mozilla/tests/**'
yaml:
description: yamllint run over the gecko codebase
treeherder:
symbol: pedantic(yaml)
run:
mach: lint -l yaml -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.yml'
- '**/*.yaml'
- '**/.ymllint'
rst:
description: rst lint run over the gecko codebase
treeherder:
symbol: text(rst)
run:
mach: lint -l rst -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.rst'
shellcheck:
description: shellcheck run over the gecko codebase
treeherder:
symbol: misc(shell)
run:
mach: lint -l shellcheck -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.sh'
localization:
description: l10n tests for strings with errors and conflicts with cross-channel
treeherder:
symbol: text(l1nt)
run:
mach: lint -l l10n -f treeherder
when:
files-changed:
- '**/locales/en-US/**'
- '**/l10n.toml'
- 'third_party/python/compare-locales/**'
- 'third_party/python/fluent/**'
rustfmt:
description: rustfmt on the Rust code
treeherder:
symbol: misc(rustfmt)
run:
mach: lint -l rustfmt -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.rs'
file-whitespace:
description: Check for trailing whitespaces and Windows CR
platform: lint/opt
treeherder:
symbol: pedantic(file-whitespace)
run:
mach: lint -l file-whitespace -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.c'
- '**/*.cc'
- '**/*.cpp'
- '**/*.h'
- '**/*.py'
- '**/*.rs'
file-perm:
description: Check for incorrect permissions on source files
platform: lint/opt
treeherder:
symbol: pedantic(file-perm)
run:
mach: lint -l file-perm -f treeherder -f json:/builds/worker/mozlint.json
when:
files-changed:
- '**/*.c'
- '**/*.cc'
- '**/*.cpp'
- '**/*.h'
- '**/*.html'
- '**/*.js'
- '**/*.jsm'
- '**/*.jsx'
- '**/*.m'
- '**/*.mm'
- '**/*.rs'
- '**/*.xhtml'
- '**/*.xml'
- '**/*.xul'