fix unnecessary-comprehension provides incorrect suggestion#9172
Conversation
This comment has been minimized.
This comment has been minimized.
|
@jacobtylerwalls i am a beginner and having a hard time solving can you help me what i have to do to solve the issue. it would be a great help! thanks |
|
I'm on mobile si I can't link the specific code but the message is raised in the add_message function, the message is dynamic and the argument given to add_message used in %s later is what need to be modified. |
for more information, see https://pre-commit.ci
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #9172 +/- ##
==========================================
+ Coverage 95.76% 95.79% +0.02%
==========================================
Files 173 173
Lines 18692 18722 +30
==========================================
+ Hits 17901 17935 +34
+ Misses 791 787 -4
|
This comment has been minimized.
This comment has been minimized.
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
Thank you for your contribution, it looks promising, do you mind adding the functional tests from #8577
a = [[1, 2], [3, 4]]
b = [(x, y) for x, y in a] # flagged as unnecessary-comprehensionAnd #9109:
#pylint: disable=missing-module-docstring
a = [1, 2, 3]
b = [x for x in a]
b[0] = 0
print(a) # [1, 2, 3]in tests/functional/u/unnecessary/unnecessary_comprehension.py, please ?
|
Also a bug / or false positive changelog fragment would be nice for this one. |
in the unnecessary_comprehension.py on line 5 it can be use for 9109 and |
where to do that in the doc/whatsnew/fragment or any where else and what it would be helpfull thanks! |
Check out the contributor docs for some info on documenting your pull request. |
for more information, see https://pre-commit.ci
This comment has been minimized.
This comment has been minimized.
jacobtylerwalls
left a comment
There was a problem hiding this comment.
Thanks for the news entry! Spotted one typo.
|
Thanks for the contribution! 🎁 |
requested test coverage added
(cherry picked from commit 6f83d5a)
Type of Changes
Description
Closes #9109