You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.py:7:23: FBT003 Boolean positional value in function call
Pydantic allows you to explicitly specify the default parameter (foo: bool = Field(default=True, ...)). However, this stands out from the general code, where other values are specified without it.
@zanieb Yes, I also encountered several similar problems #4172, #4382, #6711 and other. I think a list of available names/calls would be the most flexible solution
…trap (#10531)
## Summary
Add a setting `extend-allowed-calls` to allow users to define their own
list of calls which allow boolean traps.
Resolves#10485.
Resolves#10356.
## Test Plan
Extended text fixture and added setting test.
Hello!
I use Ruff version
0.1.15
withflake8-boolean-trap
. I am getting this error in the following example:Command
ruff test.py --fix
returnPydantic allows you to explicitly specify the
default
parameter (foo: bool = Field(default=True, ...)
). However, this stands out from the general code, where other values are specified without it.I’m not sure that it’s worth “strictly” filtering such cases. On the one hand, I can disable this check for certain files. I think it's not right to do this. Maybe it’s worth allowing the user to independently specify filtering rules, in addition to those initially specified as here https://github.com/astral-sh/ruff/blob/main/crates/ruff_linter/src/rules/flake8_boolean_trap/helpers.rs#L7?
I'd be glad to hear your opinion.
The text was updated successfully, but these errors were encountered: