diff options
| author | Jaehoon Hwang <jaehoonhwang@users.noreply.github.com> | 2021-10-17 00:31:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-17 09:31:34 +0200 |
| commit | 59d2b545b557a7ac47955c65935889e296da941a (patch) | |
| tree | a07b8d66954e630e5b8181d175fff60c423b93c7 /doc/whatsnew | |
| parent | 9098c6078551e2d3028fe65537d3b0e407c85724 (diff) | |
| download | pylint-git-59d2b545b557a7ac47955c65935889e296da941a.tar.gz | |
Add a warning ``use-implicit-booleaness-not-comparison`` for comparison with collection literals (#5120)
* Create a new checker; use-implicit-booleanness checker where it looks
for boolean evaluatiion with collection literals such as `()`, `[]`,
or `{}`
* Fixed invalid usage of comparison within pylint package
This closes #4774
* Ignore tuples when checking for `literal-comparison`
Closes #3031
* Merge len_checker with empty_literal checker
Moving empty literal checker with len_checker to avoid class without
iterators without boolean expressions (false positive on pandas)
Reference: https://github.com/PyCQA/pylint/pull/3821/files
* Update `len_checker` and its class `LenChecker` to `ComparisonChecker`
to reflect better usage after merging between `len_checker` and
`empty_literal_checker` and its tests.
* Fixed `consider_using_in` and `consider_iterating_dictionary` tests
that were failing due to new empty literal checkers.
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'doc/whatsnew')
| -rw-r--r-- | doc/whatsnew/2.12.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/whatsnew/2.12.rst b/doc/whatsnew/2.12.rst index ec4817eed..54214ac99 100644 --- a/doc/whatsnew/2.12.rst +++ b/doc/whatsnew/2.12.rst @@ -33,6 +33,14 @@ New checkers * Added ``using-f-string-in-unsupported-version`` checker. Issued when ``py-version`` is set to a version that does not support f-strings (< 3.6) +* Added new checker `use-implicit-booleanness``: Emitted when using collection + literals for boolean comparisons + +* Added new checker ``use-implicit-booleaness-not-comparison``: Emitted when + collection literal comparison is being used to check for emptiness. + + Closes #4774 + Removed checkers ================ @@ -53,6 +61,10 @@ Other Changes ``use-implicit-booleaness-not-len`` in order to be consistent with ``use-implicit-booleaness-not-comparison``. +* Update ``literal-comparison``` checker to ignore tuple literals + + Closes #3031 + * ``undefined-variable`` now correctly flags variables which only receive a type annotations and never get assigned a value |
