Add support for Ruff `FBT001`: `flake8-boolean-trap`
Natim opened this issue · comments
The problem
Please use named parameter in the save method so that we can activate
factory_boy/factory/declarations.py
Lines 683 to 684 in d6349de
Proposed solution
return self.function(
instance, create=create, extracted=context.value, **context.extra)
Extra notes
Checks for the use of boolean positional arguments in function definitions, as determined by the presence of a bool type hint.
Calling a function with boolean positional arguments is confusing as the meaning of the boolean value is not clear to the caller and to future readers of the code.
The use of a boolean will also limit the function to only two possible behaviors, which makes the function difficult to extend in the future.