Bug 1418883: Specify files-changed for lint tasks. draft
authorTom Prince <mozilla@hocat.ca>
Sun, 19 Nov 2017 21:31:35 -0700
changeset 23531 9663f90e6847a3ab2b17f4dea54427dce89e67b3
parent 23530 ef57d33bb1fcce6193d1471eabf262f9368f9b6d
push id182
push userbmo:mozilla@hocat.ca
push dateMon, 18 Dec 2017 20:46:44 +0000
bugs1418883
Bug 1418883: Specify files-changed for lint tasks. MozReview-Commit-ID: 8LnLBEwgNQw
taskcluster/ci/source-test/mozlint.yml
--- a/taskcluster/ci/source-test/mozlint.yml
+++ b/taskcluster/ci/source-test/mozlint.yml
@@ -9,39 +9,70 @@ job-defaults:
         tier: 1
     worker-type: aws-provisioner-v1/gecko-t-linux-xlarge
     worker:
         docker-image: {in-tree: "lint"}
         max-run-time: 1800
     run:
         using: mach
         comm-checkout: true
+    when:
+        files-changed:
+            # Other misc lint related files.
+            - 'python/mozlint/**'
+            - 'tools/lint/**'
 
 eslint:
     description: JS lint check
     platform: lint/opt
     treeherder:
         symbol: 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
+    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/**'
 
 yaml:
     description: yamllint run over the taskcluster configuration
     platform: lint/opt
     treeherder:
         symbol: yaml
     run:
         mach: lint -f treeherder -l yaml -n comm/taskcluster .taskcluster.yml
+    when:
+        files-changed:
+            - 'comm/**/*.yml'
+            - 'comm/**/*.yaml'
+            - '**/.ymllint'
 
 py-flake8:
     description: flake8 run over the thunderbird codebase
     platform: lint/opt
     treeherder:
         symbol: f8
     run:
         mach: lint -f treeherder -l flake8 -n comm/taskcluster
+    when:
+        files-changed:
+            - '**/*.py'
+            - '**/.flake8'
+            # moz.configure files are also Python files.
+            - '**/*.configure'