Replace isort with Ruff (#10912)

This commit is contained in:
Avasam
2023-10-27 23:14:38 -04:00
committed by GitHub
parent 77bccbe1f1
commit 49ba409da8
12 changed files with 29 additions and 50 deletions

View File

@@ -7,15 +7,13 @@ skip_magic_trailing_comma = true
# for just these files, but doesn't seem possible yet.
force-exclude = ".*_pb2.pyi"
[tool.isort]
profile = "black"
combine_as_imports = true
line_length = 130
skip = [".git", ".github", ".venv"]
extra_standard_library = [
[tool.ruff.isort]
split-on-trailing-comma = false
combine-as-imports = true
extra-standard-library = [
"_typeshed",
"typing_extensions",
# Extra modules not recognized by isort
# Extra modules not recognized by Ruff/isort
"_ast",
"_bisect",
"_bootlocale",
@@ -56,7 +54,7 @@ extra_standard_library = [
"opcode",
"pyexpat",
]
known_first_party = ["parse_metadata", "utils"]
known-first-party = ["parse_metadata", "utils"]
[tool.ruff]
line-length = 130
@@ -75,12 +73,11 @@ exclude = [
".venv",
"env",
]
# Only enable rules that have safe autofixes;
# only enable rules that are relevant to stubs
select = [
"F401", # Remove unused imports
"FA", # flake8-future-annotations
"I", # isort
# Only enable rules that have safe autofixes:
"F401", # Remove unused imports
"PYI009", # use `...`, not `pass`, in empty class bodies
"PYI010", # function bodies must be empty
"PYI012", # class bodies must not contain `pass`