Skip to content

Commit

Permalink
Ignore __setattr__ in FBT003 (#4752)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored May 31, 2023
1 parent 6c1ff6a commit c1286d6
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 c1286d6

Please sign in to comment.