Skip to content

Commit

Permalink
Avoid boolean-trap rules for positional-only builtin calls (#3075)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Feb 20, 2023
1 parent 6e02405 commit 35f7f7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def used(do):
{}.deploy(True, False)
getattr(someobj, attrname, False)
mylist.index(True)
int(True)
str(int(False))


class Registry:
Expand Down
4 changes: 4 additions & 0 deletions crates/ruff/src/rules/flake8_boolean_trap/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const FUNC_CALL_NAME_ALLOWLIST: &[&str] = &[
"pop",
"setattr",
"setdefault",
"str",
"bytes",
"int",
"float",
];

const FUNC_DEF_NAME_ALLOWLIST: &[&str] = &["__setitem__"];
Expand Down

0 comments on commit 35f7f7b

Please sign in to comment.