diff options
author | ethan-leba <ethanleba5@gmail.com> | 2020-05-23 14:02:45 -0400 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2020-08-31 21:16:25 +0200 |
commit | 5c84f0dafe79ca1631f70cf8355a5ccc7f9ed232 (patch) | |
tree | fb0608c6896969ffd202bc771831bcbc70203b5c /tests/functional/l | |
parent | 21d168a2449f97e45f369f159b2c279572eb64d5 (diff) | |
download | pylint-git-5c84f0dafe79ca1631f70cf8355a5ccc7f9ed232.tar.gz |
Add bool() check for len-as-condition
Diffstat (limited to 'tests/functional/l')
-rw-r--r-- | tests/functional/l/len_checks.py | 3 | ||||
-rw-r--r-- | tests/functional/l/len_checks.txt | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/functional/l/len_checks.py b/tests/functional/l/len_checks.py index e8e61afad..d7db14ddd 100644 --- a/tests/functional/l/len_checks.py +++ b/tests/functional/l/len_checks.py @@ -99,3 +99,6 @@ def github_issue_1331_v3(*args): def github_issue_1331_v4(*args): assert z and len(args), args # [len-as-condition] + +b = bool(len(z)) # [len-as-condition] +c = bool(len('TEST') or 42) # [len-as-condition] diff --git a/tests/functional/l/len_checks.txt b/tests/functional/l/len_checks.txt index 9dc2969f6..23e3f583f 100644 --- a/tests/functional/l/len_checks.txt +++ b/tests/functional/l/len_checks.txt @@ -11,3 +11,5 @@ len-as-condition:72::Do not use `len(SEQUENCE)` without comparison to determine len-as-condition:95:github_issue_1331_v2:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty len-as-condition:98:github_issue_1331_v3:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty len-as-condition:101:github_issue_1331_v4:Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty +len-as-condition:103::Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty +len-as-condition:104::Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty |