From 84d495968cebf368c69932f538ba8d7d2f0bdbd9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 6 Apr 2023 19:38:05 +0200 Subject: Fix check unused arguments false positive bug (#8542) (#8545) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: the special method `__new__` must match the arguments of the `__init__` method even if `__new__` method does not use them. This generate `unused-argument` for the `__new__` method. Fix: the unused arguments check should not be done on the `__new__` method if the `__init__` method is defined in the same class. Update `unused-argument` test to include a check for the case of `__init__` and `__new__` being defined in a class but `__new__` does not use all of the argument. This is fine because `__new__` must have the same argument of `__init__`. Update with a second check in case of `__init__` being not defined in a class. Then the unused arguments check must be done on `__new__`. Fixes https://github.com/pylint-dev/pylint/issues/3670 (cherry picked from commit 156da64d0fb4c06e15c5b619b91ce550d594a770) Co-authored-by: Théo Battrel --- doc/whatsnew/fragments/3670.false_positive | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/whatsnew/fragments/3670.false_positive (limited to 'doc') diff --git a/doc/whatsnew/fragments/3670.false_positive b/doc/whatsnew/fragments/3670.false_positive new file mode 100644 index 000000000..562a41de2 --- /dev/null +++ b/doc/whatsnew/fragments/3670.false_positive @@ -0,0 +1,3 @@ +Fix `unused-argument` false positive when `__new__` does not use all the arguments of `__init__`. + +Closes #3670 -- cgit v1.2.1 From 011c6ac1a4efa41ce82fb230ca06f97ae50d662e Mon Sep 17 00:00:00 2001 From: "Yilei \"Dolee\" Yang" Date: Fri, 7 Apr 2023 00:06:54 -0700 Subject: Do not emit `logging-not-lazy` for explicitly concatenated strings. (#8546) (cherry picked from commit eeddd667a6e73ef58fb47cdda154c1751f0ffe71) --- doc/whatsnew/fragments/8410.false_positive | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/whatsnew/fragments/8410.false_positive (limited to 'doc') diff --git a/doc/whatsnew/fragments/8410.false_positive b/doc/whatsnew/fragments/8410.false_positive new file mode 100644 index 000000000..264542a7d --- /dev/null +++ b/doc/whatsnew/fragments/8410.false_positive @@ -0,0 +1,3 @@ +`logging-not-lazy` is not longer emitted for explicitly concatenated string arguments. + +Closes #8410 -- cgit v1.2.1 From ed67cc806606668bec945c9b62f006d7aad02664 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Apr 2023 11:53:06 +0000 Subject: Fix typelias `invalid-name` false positives for Union variables without assignment. (#8541) (#8548) (cherry picked from commit cb255eaaed8bba6bec1f7bf5d4cde15821c1dd46) Co-authored-by: Yilei "Dolee" Yang --- doc/whatsnew/fragments/8540.false_positive | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 doc/whatsnew/fragments/8540.false_positive (limited to 'doc') diff --git a/doc/whatsnew/fragments/8540.false_positive b/doc/whatsnew/fragments/8540.false_positive new file mode 100644 index 000000000..543913637 --- /dev/null +++ b/doc/whatsnew/fragments/8540.false_positive @@ -0,0 +1,4 @@ +`Union` typed variables without assignment are no longer treated as +`TypeAlias`. + +Closes #8540 -- cgit v1.2.1 From bcceff6be5903d8f3c203c59906b7fd46d72b499 Mon Sep 17 00:00:00 2001 From: Rogdham Date: Fri, 7 Apr 2023 18:54:23 +0200 Subject: Fix isinstance-second-argument-not-valid-type for union types with None (cherry picked from commit b5f2b01635edd23fecc1546f3fdb2a41e6a51995) --- doc/whatsnew/fragments/8424.false_positive | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/whatsnew/fragments/8424.false_positive (limited to 'doc') diff --git a/doc/whatsnew/fragments/8424.false_positive b/doc/whatsnew/fragments/8424.false_positive new file mode 100644 index 000000000..22dc8b844 --- /dev/null +++ b/doc/whatsnew/fragments/8424.false_positive @@ -0,0 +1,3 @@ +Fix false positive for isinstance-second-argument-not-valid-type when union types contains None. + +Closes #8424 -- cgit v1.2.1 From 61dae1e5f4fa4b8f2f93d8846e66f4eee6cc877f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 05:55:35 +0000 Subject: Fix false positive for ``positional-only-arguments-expected`` when a function contains both a positional-only parameter that has a default value, and ``**kwargs``. (#8556) (#8560) (cherry picked from commit db17860fd61154c59f3acc13ff34b120cc5ba091) Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> --- doc/whatsnew/fragments/8555.false_positive | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/whatsnew/fragments/8555.false_positive (limited to 'doc') diff --git a/doc/whatsnew/fragments/8555.false_positive b/doc/whatsnew/fragments/8555.false_positive new file mode 100644 index 000000000..157486b39 --- /dev/null +++ b/doc/whatsnew/fragments/8555.false_positive @@ -0,0 +1,3 @@ +Fix false positive for ``positional-only-arguments-expected`` when a function contains both a positional-only parameter that has a default value, and ``**kwargs``. + +Closes #8555 -- cgit v1.2.1 From 16fe498b68c170b317eaea94bf85efd568a1dd0a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 17:34:34 +0200 Subject: Fix `unused-import` to check`dummy-variables-rgx` (#8566) (#8568) Resolve #8500 Co-authored-by: Pierre Sassoulas (cherry picked from commit 0cd41b1fb15e31eb311b61f93bc27f7cacc2f7ac) Co-authored-by: RSTdefg <34202999+RSTdefg@users.noreply.github.com> --- doc/whatsnew/fragments/8500.false_positive | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/whatsnew/fragments/8500.false_positive (limited to 'doc') diff --git a/doc/whatsnew/fragments/8500.false_positive b/doc/whatsnew/fragments/8500.false_positive new file mode 100644 index 000000000..ced61766a --- /dev/null +++ b/doc/whatsnew/fragments/8500.false_positive @@ -0,0 +1,3 @@ +Fixed `unused-import` so that it observes the `dummy-variables-rgx` option. + +Closes #8500 -- cgit v1.2.1 From ec96bdc206350e378137da27c2f4cd103a94dc63 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Apr 2023 10:38:55 +0200 Subject: Fix false positive for ``keyword-arg-before-vararg`` (#8571) (#8578) * Fix false positive for ``keyword-arg-before-vararg`` when a positional-only parameter with a default value precedes ``*args``. Closes #8570 (cherry picked from commit 56fa5dce747a46f1dcba6eca003bb22fcc347247) Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com> --- doc/whatsnew/fragments/8570.false_positive | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/whatsnew/fragments/8570.false_positive (limited to 'doc') diff --git a/doc/whatsnew/fragments/8570.false_positive b/doc/whatsnew/fragments/8570.false_positive new file mode 100644 index 000000000..fec3a855e --- /dev/null +++ b/doc/whatsnew/fragments/8570.false_positive @@ -0,0 +1,3 @@ +Fix false positive for ``keyword-arg-before-vararg`` when a positional-only parameter with a default value precedes ``*args``. + +Closes #8570 -- cgit v1.2.1 From 1dba30b43ce7d2c43e6cc94120d8daca5d9ddabd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 07:25:14 +0000 Subject: Improve output of `consider-using-generator` message for `min()` calls with `default` keyword (#8582) (#8583) (cherry picked from commit 4a485e28f0a5118b37550123c79f1f6d0dec42a4) Co-authored-by: Jacob Walls --- doc/whatsnew/fragments/8563.bugfix | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/whatsnew/fragments/8563.bugfix (limited to 'doc') diff --git a/doc/whatsnew/fragments/8563.bugfix b/doc/whatsnew/fragments/8563.bugfix new file mode 100644 index 000000000..3c9d38b1c --- /dev/null +++ b/doc/whatsnew/fragments/8563.bugfix @@ -0,0 +1,3 @@ +Improve output of ``consider-using-generator`` message for ``min()` calls with ``default`` keyword. + +Closes #8563 -- cgit v1.2.1 From 389e14c36819cb87190fd412d3f366a3283f0078 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Mon, 24 Apr 2023 20:17:48 +0200 Subject: Bump pylint to 2.17.3, update changelog (#8620) --- doc/whatsnew/2/2.17/index.rst | 58 ++++++++++++++++++++++++++++++ doc/whatsnew/fragments/3670.false_positive | 3 -- doc/whatsnew/fragments/7506.false_positive | 3 -- doc/whatsnew/fragments/8410.false_positive | 3 -- doc/whatsnew/fragments/8424.false_positive | 3 -- doc/whatsnew/fragments/8500.false_positive | 3 -- doc/whatsnew/fragments/8540.false_positive | 4 --- doc/whatsnew/fragments/8555.false_positive | 3 -- doc/whatsnew/fragments/8563.bugfix | 3 -- doc/whatsnew/fragments/8570.false_positive | 3 -- 10 files changed, 58 insertions(+), 28 deletions(-) delete mode 100644 doc/whatsnew/fragments/3670.false_positive delete mode 100644 doc/whatsnew/fragments/7506.false_positive delete mode 100644 doc/whatsnew/fragments/8410.false_positive delete mode 100644 doc/whatsnew/fragments/8424.false_positive delete mode 100644 doc/whatsnew/fragments/8500.false_positive delete mode 100644 doc/whatsnew/fragments/8540.false_positive delete mode 100644 doc/whatsnew/fragments/8555.false_positive delete mode 100644 doc/whatsnew/fragments/8563.bugfix delete mode 100644 doc/whatsnew/fragments/8570.false_positive (limited to 'doc') diff --git a/doc/whatsnew/2/2.17/index.rst b/doc/whatsnew/2/2.17/index.rst index cd06bbc2e..974ebb501 100644 --- a/doc/whatsnew/2/2.17/index.rst +++ b/doc/whatsnew/2/2.17/index.rst @@ -29,6 +29,64 @@ so we find problems before the actual release. .. towncrier release notes start +What's new in Pylint 2.17.3? +---------------------------- +Release date: 2023-04-24 + + +False Positives Fixed +--------------------- + +- Fix `unused-argument` false positive when `__new__` does not use all the + arguments of `__init__`. + + Closes #3670 (`#3670 `_) + +- Fix ``unused-import`` false positive for usage of ``six.with_metaclass``. + + Closes #7506 (`#7506 `_) + +- `logging-not-lazy` is not longer emitted for explicitly concatenated string + arguments. + + Closes #8410 (`#8410 `_) + +- Fix false positive for isinstance-second-argument-not-valid-type when union + types contains None. + + Closes #8424 (`#8424 `_) + +- Fixed `unused-import` so that it observes the `dummy-variables-rgx` option. + + Closes #8500 (`#8500 `_) + +- `Union` typed variables without assignment are no longer treated as + `TypeAlias`. + + Closes #8540 (`#8540 `_) + +- Fix false positive for ``positional-only-arguments-expected`` when a function + contains both a positional-only parameter that has a default value, and + ``**kwargs``. + + Closes #8555 (`#8555 `_) + +- Fix false positive for ``keyword-arg-before-vararg`` when a positional-only + parameter with a default value precedes ``*args``. + + Closes #8570 (`#8570 `_) + + + +Other Bug Fixes +--------------- + +- Improve output of ``consider-using-generator`` message for ``min()` calls + with ``default`` keyword. + + Closes #8563 (`#8563 `_) + + What's new in Pylint 2.17.2? ---------------------------- Release date: 2023-04-03 diff --git a/doc/whatsnew/fragments/3670.false_positive b/doc/whatsnew/fragments/3670.false_positive deleted file mode 100644 index 562a41de2..000000000 --- a/doc/whatsnew/fragments/3670.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix `unused-argument` false positive when `__new__` does not use all the arguments of `__init__`. - -Closes #3670 diff --git a/doc/whatsnew/fragments/7506.false_positive b/doc/whatsnew/fragments/7506.false_positive deleted file mode 100644 index c6424e1f2..000000000 --- a/doc/whatsnew/fragments/7506.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix ``unused-import`` false positive for usage of ``six.with_metaclass``. - -Closes #7506 diff --git a/doc/whatsnew/fragments/8410.false_positive b/doc/whatsnew/fragments/8410.false_positive deleted file mode 100644 index 264542a7d..000000000 --- a/doc/whatsnew/fragments/8410.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -`logging-not-lazy` is not longer emitted for explicitly concatenated string arguments. - -Closes #8410 diff --git a/doc/whatsnew/fragments/8424.false_positive b/doc/whatsnew/fragments/8424.false_positive deleted file mode 100644 index 22dc8b844..000000000 --- a/doc/whatsnew/fragments/8424.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix false positive for isinstance-second-argument-not-valid-type when union types contains None. - -Closes #8424 diff --git a/doc/whatsnew/fragments/8500.false_positive b/doc/whatsnew/fragments/8500.false_positive deleted file mode 100644 index ced61766a..000000000 --- a/doc/whatsnew/fragments/8500.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fixed `unused-import` so that it observes the `dummy-variables-rgx` option. - -Closes #8500 diff --git a/doc/whatsnew/fragments/8540.false_positive b/doc/whatsnew/fragments/8540.false_positive deleted file mode 100644 index 543913637..000000000 --- a/doc/whatsnew/fragments/8540.false_positive +++ /dev/null @@ -1,4 +0,0 @@ -`Union` typed variables without assignment are no longer treated as -`TypeAlias`. - -Closes #8540 diff --git a/doc/whatsnew/fragments/8555.false_positive b/doc/whatsnew/fragments/8555.false_positive deleted file mode 100644 index 157486b39..000000000 --- a/doc/whatsnew/fragments/8555.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix false positive for ``positional-only-arguments-expected`` when a function contains both a positional-only parameter that has a default value, and ``**kwargs``. - -Closes #8555 diff --git a/doc/whatsnew/fragments/8563.bugfix b/doc/whatsnew/fragments/8563.bugfix deleted file mode 100644 index 3c9d38b1c..000000000 --- a/doc/whatsnew/fragments/8563.bugfix +++ /dev/null @@ -1,3 +0,0 @@ -Improve output of ``consider-using-generator`` message for ``min()` calls with ``default`` keyword. - -Closes #8563 diff --git a/doc/whatsnew/fragments/8570.false_positive b/doc/whatsnew/fragments/8570.false_positive deleted file mode 100644 index fec3a855e..000000000 --- a/doc/whatsnew/fragments/8570.false_positive +++ /dev/null @@ -1,3 +0,0 @@ -Fix false positive for ``keyword-arg-before-vararg`` when a positional-only parameter with a default value precedes ``*args``. - -Closes #8570 -- cgit v1.2.1