Enforce modern Python typing annotations with Ruff (#8296)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Graham Neubig
2025-05-06 07:58:33 -04:00
committed by GitHub
parent 4c1ae6fd8d
commit adfa510b5f
24 changed files with 79 additions and 72 deletions

View File

@@ -26,7 +26,7 @@ repos:
- id: ruff
entry: ruff check --config dev_config/python/ruff.toml
types_or: [python, pyi, jupyter]
args: [--fix]
args: [--fix, --unsafe-fixes]
# Run the formatter.
- id: ruff-format
entry: ruff format --config dev_config/python/ruff.toml

View File

@@ -7,6 +7,9 @@ select = [
"Q",
"B",
"ASYNC",
"UP006", # Use `list` instead of `List` for annotations
"UP007", # Use `X | Y` instead of `Union[X, Y]`
"UP008", # Use `X | None` instead of `Optional[X]`
]
ignore = [