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

FBT003: ruff reports about function calls from C-extentions #9287

Closed
Paciupa opened this issue Dec 26, 2023 · 2 comments · Fixed by #9429
Closed

FBT003: ruff reports about function calls from C-extentions #9287

Paciupa opened this issue Dec 26, 2023 · 2 comments · Fixed by #9429

Comments

@Paciupa
Copy link

Paciupa commented Dec 26, 2023

In my case this is calls from pygame, for example:

pygame.mouse.set_visible(False)

Ruff reports FBT003 Boolean positional value in function call.
If I try use keyword argument, I'll get TypeError: set_visible() takes no keyword arguments
And it happens with every function from every C-library that takes bool.
So the only solution now is suppress this message.
Ruff version: 0.1.9.

@charliermarsh
Copy link
Member

I believe this is a duplicate of #3247. There aren't many good solutions here -- I typically recommend just not using the FBT rules (which are quite rigid and opinionated) if you're not working in a fairly strict project or setting.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Dec 26, 2023
@Paciupa
Copy link
Author

Paciupa commented Dec 26, 2023

Ok, thanks

charliermarsh added a commit that referenced this issue Jan 8, 2024
## Summary

Ignores Boolean trap enforcement for methods that appear to be setters
(as in the Qt and pygame APIs).

Closes #9287.
Closes #8923.
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

Successfully merging a pull request may close this issue.

2 participants