Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Ruff FBT001: flake8-boolean-trap #1080

Open
Natim opened this issue May 27, 2024 · 0 comments
Open

Add support for Ruff FBT001: flake8-boolean-trap #1080

Natim opened this issue May 27, 2024 · 0 comments

Comments

@Natim
Copy link

Natim commented May 27, 2024

The problem

Please use named parameter in the save method so that we can activate

return self.function(
instance, create, context.value, **context.extra)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant