Bug 1811850 - [lint] Replace isort linter with ruff, r=taskgraph-reviewers,linter-reviewers,marco,jcristau

This results in some changes from our current `isort` configuration. I'm
unclear if it's because ruff isn't at 100% parity with isort, they choose
different defaults or if I missed some configuration.

Either way, the changes all look reasonable to me (see child commit), so I'm
inclined to just accept the new import format it imposes.

Differential Revision: https://phabricator.services.mozilla.com/D172348
This commit is contained in:
Andrew Halberstadt
2023-03-20 13:06:27 +00:00
parent 69b399c915
commit 83bc2ca934
34 changed files with 52 additions and 351 deletions

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=lldbutils

View File

@@ -0,0 +1,4 @@
extend = "../../pyproject.toml"
[isort]
known-first-party = ["lldbutils"]

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=mach

4
python/mach/.ruff.toml Normal file
View File

@@ -0,0 +1,4 @@
extend = "../../pyproject.toml"
[isort]
known-first-party = ["mach"]

View File

@@ -7,6 +7,7 @@ from textwrap import TextWrapper
from mach.config import TYPE_CLASSES
from mach.decorators import Command, CommandArgument
# Interact with settings for mach.
# Currently, we only provide functionality to view what settings are

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=mozboot

View File

@@ -0,0 +1,4 @@
extend = "../../pyproject.toml"
[isort]
known-first-party = ["mozboot"]

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=mozbuild

View File

@@ -0,0 +1,8 @@
extend = "../../pyproject.toml"
src = [
# Treat direct imports in the test modules as first party.
"mozpack/test",
"mozbuild/test",
[isort]
known-first-party = ["mozbuild"]

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=mozlint

View File

@@ -0,0 +1,4 @@
extend = "../../pyproject.toml"
[isort]
known-first-party = ["mozlint"]

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=mozperftest

View File

@@ -0,0 +1,4 @@
extend = "../../pyproject.toml"
[isort]
known-first-party = ["mozperftest"]

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=mozrelease

View File

@@ -0,0 +1,4 @@
extend = "../../pyproject.toml"
[isort]
known-first-party = ["mozrelease"]

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=mozterm

View File

@@ -0,0 +1,4 @@
extend = "../../pyproject.toml"
[isort]
known-first-party = ["mozterm"]

View File

@@ -1,3 +0,0 @@
[settings]
profile=black
known_first_party=mozversioncontrol

View File

@@ -0,0 +1,4 @@
extend = "../../pyproject.toml"
[isort]
known-first-party = ["mozversioncontrol"]