Bug 1373368 - [lint] Add support-files to all of the lint configs, r?Standard8
MozReview-Commit-ID: ChOVmTFTmha
--- a/tools/lint/codespell.yml
+++ b/tools/lint/codespell.yml
@@ -29,10 +29,12 @@ codespell:
- xhtml
- cpp
- c
- h
- configure
- py
- properties
- rst
+ support-files:
+ - 'tools/lint/spell/**'
type: external
payload: spell:lint
--- a/tools/lint/eslint.yml
+++ b/tools/lint/eslint.yml
@@ -1,10 +1,33 @@
---
eslint:
description: JavaScript linter
# ESLint infra handles its own path filtering, so just include cwd
include: ['.']
exclude: []
extensions: ['js', 'jsm', 'jsx', 'xml', 'html', 'xhtml']
+ support-files:
+ - '**/.eslintrc.js'
+ - '.eslintignore'
+ - 'tools/lint/eslint/**'
+ # Files that can influence global variables
+ - 'browser/base/content/nsContextMenu.js'
+ - 'browser/base/content/utilityOverlay.js'
+ - 'browser/components/customizableui/content/panelUI.js'
+ - 'browser/components/downloads/content/downloads.js'
+ - 'browser/components/downloads/content/indicator.js'
+ - 'browser/components/places/content/browserPlacesViews.js'
+ - 'browser/components/places/content/controller.js'
+ - 'browser/components/places/content/treeView.js'
+ - 'testing/mochitest/tests/SimpleTest/EventUtils.js'
+ - 'testing/mochitest/tests/SimpleTest/MockObjects.js'
+ - 'testing/mochitest/tests/SimpleTest/SimpleTest.js'
+ - 'testing/mochitest/tests/SimpleTest/WindowSnapshot.js'
+ - 'toolkit/components/printing/content/printUtils.js'
+ - 'toolkit/components/viewsource/content/viewSourceUtils.js'
+ - 'toolkit/content/contentAreaUtils.js'
+ - 'toolkit/content/editMenuOverlay.js'
+ - 'toolkit/content/globalOverlay.js'
+ - 'toolkit/modules/Services.jsm'
type: external
payload: eslint:lint
setup: eslint:setup
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
@@ -15,16 +15,19 @@
var fs = require("fs");
var path = require("path");
var helpers = require("../helpers");
var globals = require("../globals");
const rootDir = helpers.rootDir;
+// When updating EXTRA_SCRIPTS or MAPPINGS, be sure to also update the
+// 'support-files' config in `tools/lint/eslint.yml`.
+
// These are scripts not included in global-scripts.inc, but which are loaded
// via overlays.
const EXTRA_SCRIPTS = [
"browser/base/content/nsContextMenu.js",
"toolkit/content/contentAreaUtils.js",
"browser/components/places/content/editBookmark.js",
"browser/components/downloads/content/downloads.js",
"browser/components/downloads/content/indicator.js",
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/simpletest.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/simpletest.js
@@ -12,16 +12,18 @@
// -----------------------------------------------------------------------------
// Rule Definition
// -----------------------------------------------------------------------------
var path = require("path");
var helpers = require("../helpers");
var globals = require("../globals");
+// When updating this list, be sure to also update the 'support-files' config
+// in `tools/lint/eslint.yml`.
const simpleTestFiles = [
"ExtensionTestUtils.js",
"EventUtils.js",
"MockObjects.js",
"SimpleTest.js",
"WindowSnapshot.js"
];
const simpleTestPath = "testing/mochitest/tests/SimpleTest";
--- a/tools/lint/flake8.yml
+++ b/tools/lint/flake8.yml
@@ -36,11 +36,14 @@ flake8:
- toolkit/components/telemetry
- toolkit/crashreporter/tools/upload_symbols.py
- tools/
# Excludes should be added to topsrcdir/.flake8 due to a bug in flake8 where
# specifying --exclude causes custom configuration files to be ignored.
exclude: []
# The configure option is used by the build system
extensions: ['configure', 'py']
+ support-files:
+ - '**/.flake8'
+ - 'tools/lint/python/flake8*'
type: external
payload: python.flake8:lint
setup: python.flake8:setup
--- a/tools/lint/py2.yml
+++ b/tools/lint/py2.yml
@@ -52,11 +52,13 @@ py2:
- tools/lint
- tools/mach_commands.py
- tools/power/mach_commands.py
- tools/profiler
- tools/rb
- tools/update-packaging
- xpcom
extensions: ['py']
+ support-files:
+ - 'tools/lint/python/*compat*'
type: external
payload: python.compat:lintpy2
setup: python.compat:setuppy2
--- a/tools/lint/py3.yml
+++ b/tools/lint/py3.yml
@@ -39,11 +39,13 @@ py3:
- toolkit
- tools/jprof
- tools/profiler
- tools/rb
- tools/update-packaging
- xpcom/idl-parser
- xpcom/typelib
extensions: ['py']
+ support-files:
+ - 'tools/lint/python/*compat*'
type: external
payload: python.compat:lintpy3
setup: python.compat:setuppy3
--- a/tools/lint/shellcheck.yml
+++ b/tools/lint/shellcheck.yml
@@ -2,11 +2,13 @@
shellcheck:
description: Shell script linter
include:
- taskcluster/docker/
exclude: []
# 1090: https://github.com/koalaman/shellcheck/wiki/SC1090
# 'Can't follow a non-constant source'
extensions: ['sh']
+ support-files:
+ - 'tools/lint/shell/**'
excludecodes: ['1090', '1091']
type: external
payload: shell:lint
--- a/tools/lint/wpt.yml
+++ b/tools/lint/wpt.yml
@@ -1,8 +1,10 @@
---
wpt:
description: web-platform-tests lint
include:
- testing/web-platform/tests
exclude: []
+ support-files:
+ - tools/lint/wpt/wpt.py
type: external
payload: wpt.wpt:lint
--- a/tools/lint/wpt_manifest.yml
+++ b/tools/lint/wpt_manifest.yml
@@ -1,9 +1,11 @@
---
wpt_manifest:
description: web-platform-tests manifest lint
include:
- testing/web-platform/tests
- testing/web-platform/mozilla/tests
exclude: []
+ support-files:
+ - tools/lint/wpt/wpt_manifest.py
type: structured_log
payload: wpt.wpt_manifest:lint
--- a/tools/lint/yaml.yml
+++ b/tools/lint/yaml.yml
@@ -4,10 +4,13 @@ yamllint:
include:
- .cron.yml
- python/mozlint/
- security/nss/.taskcluster.yml
- taskcluster
- testing/mozharness
- tools
extensions: ['yml', 'yaml']
+ support-files:
+ - '**/.yamllint'
+ - 'tools/lint/yamllint_/**'
type: external
payload: yamllint_:lint