Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 42 additions & 39 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,48 @@ skip_magic_trailing_comma = true
# for just these files, but doesn't seem possible yet.
force-exclude = ".*_pb2.pyi"

[tool.ruff]
Copy link
Member Author

@AlexWaygood AlexWaygood Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this table above the tool.ruff.isort table, as I found the current order somewhat confusing

line-length = 130
# Oldest supported Python version
target-version = "py37"
fix = true
exclude = [
# virtual environment
".env",
".venv",
"env",
# cache directories, etc.:
".git",
".mypy_cache",
".pytype",
".venv",
"env",
]
select = [
"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`
"PYI013", # non-empty class bodies must not contain `...`
"PYI020", # quoted annotations are always unnecessary in stubs
"PYI025", # always alias `collections.abc.Set` as `AbstractSet` when importing it
"PYI032", # use `object`, not `Any`, as the second parameter to `__eq__`
"UP004", # Remove explicit `object` inheritance
"UP006", # PEP-585 autofixes
"UP007", # PEP-604 autofixes
"UP013", # Class-based syntax for TypedDicts
"UP014", # Class-based syntax for NamedTuples
"UP019", # Use str over typing.Text
"UP035", # import from typing, not typing_extensions, wherever possible
"UP039", # don't use parens after a class definition with no bases
]

[tool.ruff.per-file-ignores]
"*_pb2.pyi" = ["I"] # Skip isort rules for files generated with mypy-protobuf

Comment on lines +49 to +51
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only bit of new config in this PR

[tool.ruff.isort]
split-on-trailing-comma = false
combine-as-imports = true
Expand Down Expand Up @@ -56,45 +98,6 @@ extra-standard-library = [
]
known-first-party = ["parse_metadata", "utils"]

[tool.ruff]
line-length = 130
# Oldest supported Python version
target-version = "py37"
fix = true
exclude = [
# virtual environment
".env",
".venv",
"env",
# cache directories, etc.:
".git",
".mypy_cache",
".pytype",
".venv",
"env",
]
select = [
"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`
"PYI013", # non-empty class bodies must not contain `...`
"PYI020", # quoted annotations are always unnecessary in stubs
"PYI025", # always alias `collections.abc.Set` as `AbstractSet` when importing it
"PYI032", # use `object`, not `Any`, as the second parameter to `__eq__`
"UP004", # Remove explicit `object` inheritance
"UP006", # PEP-585 autofixes
"UP007", # PEP-604 autofixes
"UP013", # Class-based syntax for TypedDicts
"UP014", # Class-based syntax for NamedTuples
"UP019", # Use str over typing.Text
"UP035", # import from typing, not typing_extensions, wherever possible
"UP039", # don't use parens after a class definition with no bases
]

[tool.typeshed]
pyright_version = "1.1.332"
oldest_supported_python = "3.7"