-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violations
Description
Summary
FAST002 converts parameters into their Annotated counterparts. If the source code contains an ellipses type (literal ...) then the fix will generate incorrect semantics.
Take the following signature:
@router.get("/available")
async def get_available(
ghl_account_id: str = Query(..., description="GHL account identifier"),
) -> SystemsAvailableResponse: ...The use of ... in the default for Query is valid syntax (should be picked up in a lint that you shouldn't do this, but it is "valid").
When trying to run fix, you get:
@router.get("/available")
async def get_available(
ghl_account_id: Annotated[str, Query(description="GHL account identifier")] = ...,
) -> SystemsAvailableResponse: ...When in reality, there is no default value and ruff should convert it to:
@router.get("/available")
async def get_available(
ghl_account_id: Annotated[str, Query(description="GHL account identifier")],
) -> SystemsAvailableResponse: ...Version
ruff 0.14.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violations