Bug 1822061 - Port bug 1811850: Replace isort linter with ruff. r=dandarnell
This will trigger some sorting changes due to lack of support in ruff for isort's custom classifications. Depends on D172728 Differential Revision: https://phabricator.services.mozilla.com/D172729 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e077c7d362
Коммит
80e34c14b9
16
.isort.cfg
16
.isort.cfg
|
@ -1,16 +0,0 @@
|
|||
[settings]
|
||||
profile=black
|
||||
|
||||
# Align with flake8 and black
|
||||
line_length=99
|
||||
|
||||
remove_imports=__future__
|
||||
|
||||
known_mozilla_intree=mach,mozboot,mozbuild,mozpack,mozharness,mozlint,mozperftest,mozrelease,mozterm,mozversioncontrol,mozxchannel
|
||||
known_tg_gecko=gecko_taskgraph
|
||||
known_comm_intree=rocboot,rocbuild,tbxchannel,thirdroc
|
||||
known_tg_comm=comm_taskgraph
|
||||
|
||||
known_mozilla_build=buildconfig
|
||||
|
||||
sections=FUTURE,STDLIB,THIRDPARTY,MOZILLA_INTREE,COMM_INTREE,TG_GECKO,TG_COMM,MOZILLA_BUILD,FIRSTPARTY,LOCALFOLDER
|
|
@ -4,6 +4,7 @@ line-length = 99
|
|||
select = [
|
||||
"E", "W", # pycodestyle
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
]
|
||||
ignore = [
|
||||
# These should be triaged and either fixed or moved to the list below.
|
||||
|
@ -21,3 +22,27 @@ exclude = [
|
|||
builtins = ["gdb"]
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
|
||||
[tool.ruff.isort]
|
||||
known-first-party = [
|
||||
"mach",
|
||||
"mozboot",
|
||||
"mozbuild",
|
||||
"mozpack",
|
||||
"mozharness",
|
||||
"mozlint",
|
||||
"mozperftest",
|
||||
"mozrelease",
|
||||
"mozterm",
|
||||
"mozversioncontrol",
|
||||
"mozxchannel",
|
||||
"tbxchannel",
|
||||
"gecko_taskgraph",
|
||||
"buildconfig",
|
||||
]
|
||||
known-local-folder = [
|
||||
"rocboot",
|
||||
"rocbuild",
|
||||
"thirdroc",
|
||||
"comm_taskgraph",
|
||||
]
|
||||
|
|
|
@ -206,20 +206,6 @@ py-black:
|
|||
root-path: comm
|
||||
mozlint-config: black.yml
|
||||
|
||||
py-isort:
|
||||
description: isort run over the gecko codebase
|
||||
treeherder:
|
||||
symbol: py(isort)
|
||||
run:
|
||||
mach: >
|
||||
commlint -v -l isort -f treeherder
|
||||
-f json:/builds/worker/mozlint.json
|
||||
comm/*
|
||||
optimization:
|
||||
skip-unless-mozlint:
|
||||
root-path: comm
|
||||
mozlint-config: flake8.yml
|
||||
|
||||
py-ruff:
|
||||
description: Run ruff over the codebase
|
||||
treeherder:
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
isort:
|
||||
description: Sort python imports
|
||||
level: warning
|
||||
# Excludes should be added to topsrcdir/.flake8.
|
||||
exclude: []
|
||||
extensions: ['configure', 'py']
|
||||
support-files:
|
||||
- 'comm/.flake8'
|
||||
- '**/.isort.cfg'
|
||||
- 'tools/lint/python/isort*'
|
||||
commroot: true
|
||||
type: external
|
||||
payload: commlint:lint_wrapper
|
||||
wraps: python.isort:lint
|
||||
setup: python.isort:setup
|
|
@ -2,8 +2,6 @@
|
|||
ruff:
|
||||
description: An extremely fast Python linter, written in Rust
|
||||
include: ["."]
|
||||
# Excludes should be added to topsrcdir/comm/pyproject.toml
|
||||
exclude: []
|
||||
extensions: ["py"]
|
||||
support-files:
|
||||
- "comm/**/.ruff.toml"
|
||||
|
@ -11,7 +9,7 @@ ruff:
|
|||
- "comm/**/pyproject.toml"
|
||||
- "tools/lint/python/ruff.py"
|
||||
# Rules that should result in warnings rather than errors.
|
||||
warning-rules: []
|
||||
warning-rules: [PLR, PLW]
|
||||
commroot: true
|
||||
type: external
|
||||
payload: commlint:lint_wrapper
|
||||
|
|
Загрузка…
Ссылка в новой задаче