Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow Boolean positionals in setters #9429

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Allow Boolean positionals in setters #9429

merged 1 commit into from
Jan 8, 2024

Conversation

charliermarsh
Copy link
Member

Summary

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

Closes #9287.
Closes #8923.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Jan 8, 2024
Copy link
Contributor

github-actions bot commented Jan 8, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -1 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)

bokeh/bokeh (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --no-preview --select ALL

- examples/server/app/spectrogram/app_hooks.py:8:17: FBT003 Boolean positional value in function call

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
FBT003 1 0 1 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -1 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)

bokeh/bokeh (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --preview --select ALL

- examples/server/app/spectrogram/app_hooks.py:8:17: FBT003 Boolean positional value in function call

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
FBT003 1 0 1 0 0

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the downsides of allowing this calls. Does it increase the rate of false negatives?

@charliermarsh
Copy link
Member Author

@MichaReiser - Yeah, that's right -- there will be some false negatives. But based on the issues, I think this is the right tradeoff -- it's almost always a false positive in these cases, with no workaround.

@charliermarsh charliermarsh merged commit f419af4 into main Jan 8, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/fbt branch January 8, 2024 18:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
2 participants