Skip to content

Commit

Permalink
flake8-boolean-trap: ignore __setattr__ in FBT003
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed May 31, 2023
1 parent 06bcb85 commit 25171be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ def foo(self, value: bool) -> None:
# FBT001: Boolean positional arg in function definition
def foo(self, value: bool) -> None:
pass

def foo(self) -> None:
object.__setattr__(self, "flag", True)
1 change: 1 addition & 0 deletions crates/ruff/src/rules/flake8_boolean_trap/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub(super) const FUNC_CALL_NAME_ALLOWLIST: &[&str] = &[
"pop",
"remove",
"setattr",
"__setattr__",
"setdefault",
"str",
];
Expand Down

0 comments on commit 25171be

Please sign in to comment.