-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
needs-decisionAwaiting a decision from a maintainerAwaiting a decision from a maintainerruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
FBT001 should catch boolean positional arguments in function definitions, but to my surprise it does not care about bool | None, which I would expect it to do. Thinking about it, I would expect it to catch any union type where bool is one of the options.
In both cases, FBT003 triggers on the call to the function, but the function definition itself passes.
def chaught(x: bool) -> bool:
"""FBT0001 trigger."""
return x
def passes(x: bool | None) -> bool | None:
"""No FBT0001 trigger."""
return x
chaught(True) #FBT003 trigger
passes(False) #FBT003 triggerReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-decisionAwaiting a decision from a maintainerAwaiting a decision from a maintainerruleImplementing or modifying a lint ruleImplementing or modifying a lint rule