Bug 1708293 - [lint] Add a linter to prefer multiline skip-if statements in test manifests, r=releng-reviewers,jmaher

This will warn if someone includes something like:

    skip-if = <condition A> || <condition B>  # reason A is skipped; reason B is skipped

Instead they should use:

    skip-if =
        <condition A>  # reason A is skipped
        <condition B>  # reason B is skipped

Differential Revision: https://phabricator.services.mozilla.com/D113707
This commit is contained in:
Andrew Halberstadt 2021-04-29 18:38:59 +00:00
Родитель fcb5cf9044
Коммит 730d952a79
3 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -243,7 +243,7 @@ test-manifest:
treeherder:
symbol: misc(tm)
run:
mach: lint -v -l test-disable -f treeherder -f json:/builds/worker/mozlint.json *
mach: lint -v -l test-manifest-disable -l test-manifest-skip-if -f treeherder -f json:/builds/worker/mozlint.json *
when:
files-changed:
- '**/*.ini'

Просмотреть файл

Просмотреть файл

@ -0,0 +1,18 @@
---
multiline-skip-if:
description: Conditions joined by || should be on separate lines
hint: |
skip-if =
<condition one> # reason
<condition two> # reason
exclude:
- "**/application.ini"
- "**/l10n.ini"
- dom/canvas/test/webgl-conf/mochitest-errata.ini
- testing/mozbase/manifestparser/tests
- testing/web-platform
- xpcom/tests/unit/data
extensions: ['ini']
level: warning
type: regex
payload: '^\s*(skip|fail)-if\s*=[^(]*\|\|'