mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-08-20 06:03:19 +00:00
Modernize type hints to PEP 585 / PEP 604 syntax (#803)
This commit is contained in:
@@ -113,6 +113,18 @@ exclude = [
|
||||
"parsedmarc/resources/maps/[!_]*.py",
|
||||
]
|
||||
|
||||
[tool.ruff.lint]
|
||||
# Enforce modern type-hint syntax on top of ruff's default rules. With
|
||||
# requires-python >=3.10, PEP 585 builtins (list[int]) and PEP 604 unions
|
||||
# (X | Y, X | None) are available, so keep the deprecated typing.List /
|
||||
# Union / Optional spellings out of the codebase.
|
||||
extend-select = [
|
||||
"UP006", # non-pep585-annotation: List -> list, Dict -> dict
|
||||
"UP007", # non-pep604-annotation-union: Union[X, Y] -> X | Y
|
||||
"UP035", # deprecated-import: typing.List etc. / typing -> collections.abc
|
||||
"UP045", # non-pep604-annotation-optional: Optional[X] -> X | None
|
||||
]
|
||||
|
||||
[tool.pyright]
|
||||
# The whole codebase passes pyright with zero errors and warnings; CI
|
||||
# enforces this (see .github/workflows/python-tests.yml). Run locally with
|
||||
|
||||
Reference in New Issue
Block a user