Hello!
I use Ruff version 0.1.15 with flake8-boolean-trap. I am getting this error in the following example:
from pydantic import Field
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
foo: bool = Field(True, exclude=True)
Command ruff test.py --fix return
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.
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.
Hello!
I use Ruff version
0.1.15withflake8-boolean-trap. I am getting this error in the following example:Command
ruff test.py --fixreturnPydantic allows you to explicitly specify the
defaultparameter (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.