-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
len-test (PLC1802) in Ruff 0.8.1 does not recognize the builtins ascii and sorted as returning sequences, leading to false negatives.
$ cat plc1802.py
bool(len(ascii(1)))
bool(len(sorted("")))
$ ruff check --preview --isolated --select PLC1802 plc1802.py --output-format concise
All checks passed!Compare similar builtins with true positives.
$ cat plc1802.py
bool(len(repr(1)))
bool(len(list("")))
$ ruff check --preview --isolated --select PLC1802 plc1802.py --output-format concise
plc1802.py:1:6: PLC1802 [*] `len(repr(1))` used as condition without comparison
plc1802.py:2:6: PLC1802 [*] `len(list(""))` used as condition without comparison
Found 2 errors.
[*] 2 fixable with the `--fix` option.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule