mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-01 21:50:21 +08:00
Import names from typing directly rather than importing module (#13761)
This commit is contained in:
@@ -83,6 +83,8 @@ select = [
|
||||
"FURB169", # Compare the identities of `{object}` and None instead of their respective types
|
||||
"FURB177", # Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups
|
||||
"FURB187", # Use of assignment of `reversed` on list `{name}`
|
||||
# Used for lint.flake8-import-conventions.aliases
|
||||
"ICN001", # `{name}` should be imported as `{asname}`
|
||||
# Autofixable flake8-use-pathlib only
|
||||
"PTH201", # Do not pass the current directory explicitly to `Path`
|
||||
"PTH210", # Invalid suffix passed to `.with_suffix()`
|
||||
@@ -217,6 +219,8 @@ ignore = [
|
||||
"PLC0414", # Import alias does not rename original package
|
||||
]
|
||||
"*_pb2.pyi" = [
|
||||
# Special autogenerated typing --> typing_extensions aliases
|
||||
"ICN001", # `{name}` should be imported as `{asname}`
|
||||
# Leave the docstrings as-is, matching source
|
||||
"D", # pydocstyle
|
||||
# See comment on black's force-exclude config above
|
||||
@@ -226,6 +230,11 @@ ignore = [
|
||||
[tool.ruff.lint.pydocstyle]
|
||||
convention = "pep257" # https://docs.astral.sh/ruff/settings/#lint_pydocstyle_convention
|
||||
|
||||
[tool.ruff.lint.flake8-import-conventions.aliases]
|
||||
# Prevent aliasing these, as it causes false-negatives for certain rules
|
||||
typing_extensions = "typing_extensions"
|
||||
typing = "typing"
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
split-on-trailing-comma = false
|
||||
combine-as-imports = true
|
||||
|
||||
Reference in New Issue
Block a user