Bug 1793625 - Adjust mozlint configs to work with taskgraph skip-unless-mozlint optimization. r=mkmelin

Thunderbird jobs usually do not want to run on upstream code, so set "include" to
"comm/" when a more specific list of includes is not provided. Note that setting
"commroot" for a linter changes the root for "include" and "exclude".

Differential Revision: https://phabricator.services.mozilla.com/D158591

--HG--
extra : amend_source : 323cca3c0b913f9ed5273043d266e4364b71a4d6
extra : absorb_source : d5f4210f0ae98d80dbd9a85d465c9c939d2ce3f6
This commit is contained in:
Rob Lemley 2022-10-12 21:38:43 +11:00
Родитель 853fa73540
Коммит 0bcbd12433
14 изменённых файлов: 75 добавлений и 10 удалений

26
.flake8 Normal file
Просмотреть файл

@ -0,0 +1,26 @@
[flake8]
max-line-length = 99
exclude =
# These paths should be triaged and either fixed or moved to the list below.
python/l10n/tb_fluent_migrations
# See:
# - http://flake8.pycqa.org/en/latest/user/error-codes.html
# - http://pep8.readthedocs.io/en/latest/intro.html#configuration
ignore =
# These should be triaged and either fixed or moved to the list below.
W504, W605, W606,
# These are intentionally disabled (not necessarily for good reason).
# F723: syntax error in type comment
# text contains quotes which breaks our custom JSON formatter
F723, E121, E123, E126, E129, E133, E226, E241, E242, E402, E704, E741, W503,
# black will generate code that breaks these. they're not PEP8 compliant though;
# see https://github.com/psf/black/blob/master/docs/compatible_configs.md#flake8
W503, E203
# per-file-ignores =
builtins =
# For GDB extensions
gdb

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

@ -1,6 +1,8 @@
---
black:
description: Reformat python
include:
- comm/
extensions:
- build
- configure

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

@ -12,6 +12,8 @@ codespell:
- comm/taskcluster/docs/
- comm/third_party/
- comm/README.md
exclude:
- comm/mailnews/extensions/fts3/fts3_porter.c
# List of extensions coming from:
# tools/lint/{flake8,eslint}.yml
# tools/mach_commands.py (clang-format)
@ -36,8 +38,8 @@ codespell:
- ftl
support-files:
- 'tools/lint/spell/**'
- 'comm/tools/lint/spell/**'
type: external
setup: spell:setup
payload: commlint:lint_wrapper
wraps: spell:lint
commroot: true

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

@ -2,7 +2,7 @@
file-perm:
description: File permission check
include:
- .
- comm/
extensions:
- .c
- .cc

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

@ -2,9 +2,9 @@
file-whitespace:
description: File content sanity check
include:
- .
- comm/.
exclude:
- calendar/libical/src/**
- comm/calendar/libical/src/**
extensions:
- .c
- .cc

15
tools/lint/flake8.yml Normal file
Просмотреть файл

@ -0,0 +1,15 @@
---
flake8:
description: Python linter
include:
- .
# The configure option is used by the build system
extensions: ['py']
support-files:
- 'comm/.flake8'
- 'tools/lint/python/flake8*'
commroot: true
type: external
payload: commlint:lint_wrapper
wraps: python.flake8:lint
setup: python.flake8:setup

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

@ -1,12 +1,14 @@
---
fluent-lint:
description: Linter for Fluent files
include:
- .
exclude:
- dom/l10n/tests/mochitest/document_l10n/non-system-principal/localization/test.ftl
extensions: ['ftl']
support-files:
- 'tools/lint/fluent-lint/*.py'
- 'comm/tools/lint/fluent-lint**'
- 'comm/tools/lint/fluent-lint/**'
type: external
payload: commlint:lint_wrapper
wraps: fluent-lint:lint

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

@ -2,7 +2,7 @@
license:
description: License Check
include:
- .
- comm/
exclude:
# By design
- comm/build/macosx/hardenedruntime/developer.entitlements.xml

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

@ -3,7 +3,7 @@ mingw-capitalization:
description: >
"A Windows include file is not lowercase, and may break the MinGW build"
extensions: ['h', 'cpp', 'cc', 'c']
include: ['.']
include: ['comm/']
type: external
level: error
payload: commlint:lint_wrapper

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

@ -2,7 +2,7 @@
avoid-blacklist-and-whitelist:
description: "Use words like 'skip', 'select', 'allow' or 'deny' instead"
level: error
include: ['.']
include: ['comm/']
exclude:
- comm/tools/lint/rejected-words.yml
type: external

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

@ -2,7 +2,7 @@
shellcheck:
description: Shell script linter
include:
- .
- comm/
exclude: []
# 1090: https://github.com/koalaman/shellcheck/wiki/SC1090
# 'Can't follow a non-constant source'

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

@ -23,5 +23,6 @@ complies
nd
fpr
keyserver
keyservers
Nd
msdos

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

@ -0,0 +1,17 @@
---
trojan-source:
description: Trojan Source attack - CVE-2021-42572
include:
- comm/
extensions:
- .c
- .cc
- .cpp
- .h
- .py
- .rs
support-files:
- 'tools/lint/trojan-source/**'
type: external
payload: commlint:lint_wrapper
wraps: trojan-source:lint

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

@ -2,7 +2,7 @@
yamllint:
description: YAML linter
include:
- .
- comm/
extensions: ['yml', 'yaml']
support-files:
- '**/.yamllint'