taskcluster/ci/source-test/mozlint.yml
author Rob Lemley <rob@thunderbird.net>
Mon, 20 Apr 2020 20:12:12 -0400
changeset 39063 9227be55de89ca0abea878b6d1ac067e51cb069a
parent 38815 51cfabe491f351343e2365e01fe1a56b9a941978
permissions -rw-r--r--
Bug 1631643 - Port bug 1589712: Switch mozlint tests to -source workers. r=darktrojan

# 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
    treeherder:
        kind: test
        tier: 1
    platform: lint/opt
    worker-type: t-linux-xlarge-source
    worker:
        docker-image: {in-tree: "lint"}
        max-run-time: 1800
        env:
            MOZLINT_NO_SUITE: '1'
    run:
        using: mach
        comm-checkout: true
    when:
        files-changed:
            # Other misc lint related files.
            - 'python/mozlint/**'
            - 'tools/lint/**'

codespell:
    always-target: false
    description: Checks for misspellings in text files
    treeherder:
        symbol: text(spell)
    run-on-projects: ['try-comm-central']
    run:
        mach: >
            lint -v -l codespell -f treeherder
            -f json:/builds/worker/mozlint.json
            --config-path=comm/tools/lint
            comm/*
    when:
        files-changed:
            - 'comm/**.js'
            - 'comm/**.jsm'
            - 'comm/**.jxs'
            - 'comm/**.xml'
            - 'comm/**.html'
            - 'comm/**.xhtml'
            - 'comm/**.cpp'
            - 'comm/**.c'
            - 'comm/**.h'
            - 'comm/**.configure'
            - 'comm/**.py'
            - 'comm/**.properties'
            - 'comm/**.rst'
            - 'comm/**.md'
            - 'comm/**.ftl'

eslint:
    description: JS lint check
    treeherder:
        symbol: js(ES)
    run:
        using: run-task
        command: >
            cd /builds/worker/checkouts/gecko/ &&
            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 &&
            cd /builds/worker/checkouts/gecko/comm &&
            ../mach lint -f treeherder -l eslint --quiet -f json:/builds/worker/mozlint.json *
    when:
        files-changed:
            # Files that are likely audited.
            - 'comm/**/*.js'
            - 'comm/**/*.jsm'
            - 'comm/**/*.jsx'
            - 'comm/**/*.html'
            - 'comm/**/*.xhtml'
            - 'comm/**/*.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/**'

file-perm:
    description: Check for incorrect permissions on source files
    platform: lint/opt
    treeherder:
        symbol: pedantic(file-perm)
    run:
        mach: >
            lint -v -l file-perm -f treeherder
            -f json:/builds/worker/mozlint.json
            --config-path=comm/tools/lint
            comm/*
    when:
        files-changed:
            - 'comm/**/*.c'
            - 'comm/**/*.cc'
            - 'comm/**/*.cpp'
            - 'comm/**/*.h'
            - 'comm/**/*.html'
            - 'comm/**/*.js'
            - 'comm/**/*.jsm'
            - 'comm/**/*.jsx'
            - 'comm/**/*.m'
            - 'comm/**/*.mm'
            - 'comm/**/*.rs'
            - 'comm/**/*.xhtml'
            - 'comm/**/*.xml'
            - 'comm/**/*.xul'

file-whitespace:
    description: Check for trailing whitespaces and Windows CR
    platform: lint/opt
    treeherder:
        symbol: pedantic(file-whitespace)
    run:
        mach: >
            lint -v -l file-whitespace -f treeherder
            -f json:/builds/worker/mozlint.json
            --config-path=comm/tools/lint
            comm/*
    when:
        files-changed:
            - 'comm/**/*.c'
            - 'comm/**/*.cc'
            - 'comm/**/*.cpp'
            - 'comm/**/*.h'
            - 'comm/**/*.py'
            - 'comm/**/*.rs'

license:
    always-target: false
    description: Check for license blocks in source files.
    treeherder:
        symbol: pedantic(license)
    run-on-projects: ['try-comm-central']
    run:
        mach: >
            lint -v -l license -f treeherder
            -f json:/builds/worker/mozlint.json
            --config-path=comm/tools/lint
            comm/*
    when:
        files-changed:
            - 'comm/**/*.c'
            - 'comm/**/*.cc'
            - 'comm/**/*.cpp'
            - 'comm/**/*.h'
            - 'comm/**/*.html'
            - 'comm/**/*.js'
            - 'comm/**/*.jsm'
            - 'comm/**/*.jsx'
            - 'comm/**/*.m'
            - 'comm/**/*.mm'
            - 'comm/**/*.py'
            - 'comm/**/*.rs'
            - 'comm/**/*.xhtml'
            - 'comm/**/*.xml'
            - 'comm/**/*.xul'

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
            --config-path=comm/tools/lint
            comm/*
    when:
        files-changed:
            - 'modules/libpref/init/all.js'
            - 'modules/libpref/init/StaticPrefList.yaml'
            - 'comm/mail/app/profile/all-thunderbird.js'
            - 'comm/mail/app/profile/channel-prefs.js'
            - 'comm/mail/branding/nightly/thunderbird-branding.js'
            - 'comm/mail/branding/thunderbird/thunderbird-branding.js'

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
            --config-path=comm/tools/lint
            comm/*
    when:
        files-changed:
            - 'comm/**/*.cpp'
            - 'comm/**/*.cc'
            - 'comm/**/*.c'
            - 'comm/**/*.h'

py-compat:
    description: lint for python 2/3 compatibility issues
    treeherder:
        symbol: py(py-compat)
    run:
        mach: >
            lint -v -l py2 -l py3 -f treeherder
            -f json:/builds/worker/mozlint.json
            --config-path=comm/tools/lint
            comm/*
    when:
        files-changed:
            - 'comm/**/*.py'
            - 'comm/**/.flake8'

py-flake8:
    description: flake8 run over the thunderbird codebase
    treeherder:
        symbol: py(f8)
    run:
        mach: >
            lint -v -l flake8 -f treeherder
            -f json:/builds/worker/mozlint.json
            --config-path=comm/tools/lint
            comm/taskcluster
    when:
        files-changed:
            - '**/*.py'
            - '**/.flake8'
            # moz.configure files are also Python files.
            - '**/*.configure'

shellcheck:
    always-target: false
    description: shellcheck run over the gecko codebase
    treeherder:
        symbol: misc(shell)
    run-on-projects: ['try-comm-central']
    run:
        mach: >
            lint -v -l shellcheck -f treeherder
            -f json:/builds/worker/mozlint.json
            --config-path=comm/tools/lint
            comm/*
    when:
        files-changed:
            - 'comm/**/*.sh'

yaml:
    description: yamllint run over the taskcluster configuration
    treeherder:
        symbol: pedantic(yaml)
    run:
        mach: >
            lint -v -l yaml -f treeherder
            -f json:/builds/worker/mozlint.json
            --config-path=comm/tools/lint
            comm/mail/config
            comm/taskcluster
            comm/.*.yml
    when:
        files-changed:
            - 'comm/**/*.yml'
            - 'comm/**/*.yaml'
            - '**/.ymllint'