Port bug 1492495: Enable 'flake8-isort' plugin in flake8 mozlinter
Categories
(Thunderbird :: Build Config, task)
Tracking
(thunderbird_esr102 unaffected)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr102 | --- | unaffected |
People
(Reporter: rjl, Assigned: rjl)
References
Details
Attachments
(2 files)
Bug 1492495 adds the 'flake8-isort' plugin to the flake8 Python linter.
The short version is that it will enforce a standard order for imported libraries and modules.
Initially, it will only produce warnings which will not fail mozlint tests in CI.
A new config file will need to be added: comm/tools/lint/flake8.yml. This will enable comm-central file exclusions and not run flake8 on *.configure files. Not sure why m-c is including configure files in its mozlint config, they're all excluded in the .flake8 file.
---
flake8:
description: Python linter
# Excludes should be added to topsrcdir/.flake8.
exclude: []
# The configure option is used by the build system
extensions: ['py']
support-files:
- '**/.flake8'
- 'tools/lint/python/flake8*'
# Rules that should result in warnings rather than errors.
warning-rules: ['I001', 'I003', 'I004', 'I005']
type: external
payload: commlint:lint_wrapper
wraps: python.flake8:lint
setup: python.flake8:setup
Then with bug 1492495 in m-c, this works:
./mach commlint -l flake8 --warnings comm
Should be able to pass --fix to mach commlint and take care of most of the isort problems.
| Assignee | ||
Comment 1•3 years ago
|
||
isort is an "import" statement ordering check. For now, only issue warnings for
those checks.
| Assignee | ||
Comment 2•3 years ago
|
||
Depends on D161279
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/050b94a49569
port Bug 1492495: Make flake8-isort failures a warning instead of hard fail. r=dandarnell
https://hg.mozilla.org/comm-central/rev/ec849410c436
Fix flake8-isort error messages. r=dandarnell
| Comment hidden (Intermittent Failures Robot) |
Updated•3 years ago
|
Description
•