Skip to content

Allow Boolean positionals in setters#9429

Merged
charliermarsh merged 1 commit intomainfrom
charlie/fbt
Jan 8, 2024
Merged

Allow Boolean positionals in setters#9429
charliermarsh merged 1 commit intomainfrom
charlie/fbt

Conversation

@charliermarsh
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@charliermarsh charliermarsh deleted the charlie/fbt branch January 8, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

2 participants