Bug 1387862 - Lint python/mozlint yaml files. r=ahal
We should have CI Lint YAML files in the tree.
MozReview-Commit-ID: IMOKGhxKFJW
--- a/python/mozlint/test/linters/badreturncode.yml
+++ b/python/mozlint/test/linters/badreturncode.yml
@@ -1,7 +1,8 @@
+---
BadReturnCodeLinter:
description: Returns an error code no matter what
include:
- files
type: external
extensions: ['.js', '.jsm']
payload: external:badreturncode
--- a/python/mozlint/test/linters/explicit_path.yml
+++ b/python/mozlint/test/linters/explicit_path.yml
@@ -1,7 +1,8 @@
+---
ExplicitPathLinter:
description: Only lint a specific file name
rule: no-foobar
include:
- no_foobar.js
type: string
payload: foobar
--- a/python/mozlint/test/linters/external.yml
+++ b/python/mozlint/test/linters/external.yml
@@ -1,7 +1,8 @@
+---
ExternalLinter:
description: It's bad to have the string foobar in js files.
include:
- files
type: external
extensions: ['.js', '.jsm']
payload: external:external
--- a/python/mozlint/test/linters/invalid_exclude.yml
+++ b/python/mozlint/test/linters/invalid_exclude.yml
@@ -1,5 +1,6 @@
+---
BadExcludeLinter:
description: Has an invalid exclude directive.
exclude: [0, 1] # should be a list of strings
type: string
payload: foobar
--- a/python/mozlint/test/linters/invalid_extension.ym
+++ b/python/mozlint/test/linters/invalid_extension.ym
@@ -1,4 +1,5 @@
+---
BadExtensionLinter:
description: Has an invalid file extension.
type: string
payload: foobar
--- a/python/mozlint/test/linters/invalid_include.yml
+++ b/python/mozlint/test/linters/invalid_include.yml
@@ -1,5 +1,6 @@
+---
BadIncludeLinter:
description: Has an invalid include directive.
include: should be a list
type: string
payload: foobar
--- a/python/mozlint/test/linters/invalid_type.yml
+++ b/python/mozlint/test/linters/invalid_type.yml
@@ -1,4 +1,5 @@
+---
BadTypeLinter:
description: Has an invalid type.
type: invalid
payload: foobar
--- a/python/mozlint/test/linters/missing_attrs.yml
+++ b/python/mozlint/test/linters/missing_attrs.yml
@@ -1,2 +1,3 @@
+---
MissingAttrsLinter:
description: Missing type and payload
--- a/python/mozlint/test/linters/raises.yml
+++ b/python/mozlint/test/linters/raises.yml
@@ -1,4 +1,5 @@
+---
RaisesLinter:
description: Raises an exception
type: external
payload: external:raises
--- a/python/mozlint/test/linters/regex.yml
+++ b/python/mozlint/test/linters/regex.yml
@@ -1,8 +1,11 @@
+---
RegexLinter:
- description: Make sure the string foobar never appears in a js variable file because it is bad.
+ description: >-
+ Make sure the string foobar never appears in a js variable
+ file because it is bad.
rule: no-foobar
include:
- '**/*.js'
- '**/*.jsm'
type: regex
payload: foobar
--- a/python/mozlint/test/linters/string.yml
+++ b/python/mozlint/test/linters/string.yml
@@ -1,9 +1,12 @@
+---
StringLinter:
- description: Make sure the string foobar never appears in browser js files because it is bad
+ description: >-
+ Make sure the string foobar never appears in browser js
+ files because it is bad
rule: no-foobar
include:
- '**/*.js'
- '**/*.jsm'
type: string
extensions: ['.js', 'jsm']
payload: foobar
--- a/python/mozlint/test/linters/structured.yml
+++ b/python/mozlint/test/linters/structured.yml
@@ -1,7 +1,8 @@
+---
StructuredLinter:
description: "It's bad to have the string foobar in js files."
include:
- files
type: structured_log
extensions: ['.js', '.jsm']
payload: external:structured
--- a/tools/lint/yaml.yml
+++ b/tools/lint/yaml.yml
@@ -1,8 +1,9 @@
yamllint:
description: YAML linter
include:
- .cron.yml
+ - python/mozlint/
- taskcluster
extensions: ['yml', 'yaml']
type: external
payload: yamllint_:lint