-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix false positive when testing for-loops for unbalanced unpacking (W0644) #8892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DanielNoord
merged 35 commits into
pylint-dev:main
from
Neowizard:false-positive-unbalanced-dict-unpacking
Sep 4, 2023
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
519c09a
When checking for loops for unbalanced dict unpacking, compare the nuβ¦
Neowizard f028970
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 877afaf
Prevent unbalanced-dict-unpacking from shadowing dict-iter-missing-itβ¦
Neowizard d8cbf40
Fixed support for Dict values when checking for unbalanced-dict-unpacβ¦
Neowizard 4c2cd8a
Added support for star-unpacking when checking for unbalanced-dict-unβ¦
Neowizard c10f299
Merge branch 'false-positive-unbalanced-dict-unpacking' of https://giβ¦
Neowizard cfc4907
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 31bdca5
Added test case to cover subscripts/splices when checking for unbalanβ¦
Neowizard 71e54a8
Regenerated docs
Neowizard 4892c97
Merge branch 'false-positive-unbalanced-dict-unpacking' of https://giβ¦
Neowizard e21bc39
Fixed but in how we test the length of a splice - was missing `Const.β¦
Neowizard 181f07d
Reverted unintended changes to docs/user_guide
Neowizard 07558f3
Added news fragment
Neowizard e29fea9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] de1206d
Merge branch 'pylint-dev:main' into false-positive-unbalanced-dict-unβ¦
Neowizard ed8d7d1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 72eb2e6
Fix news fragment to match expected regex (capitalize "Closes")
Neowizard bc98d03
Work around mypy's definition that `math.ceil` returns floats
Neowizard 8ac683e
Merge branch 'false-positive-unbalanced-dict-unpacking' of https://giβ¦
Neowizard 28ad6fb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3151e25
Add trailing newline to 8156.false_positive as required by the pre_coβ¦
Neowizard c98b889
Merge branch 'false-positive-unbalanced-dict-unpacking' of https://giβ¦
Neowizard 197746c
Fix type'o in unbalanced_dict_unpacking.py test
Neowizard a0471d4
Merge branch 'pylint-dev:main' into false-positive-unbalanced-dict-unβ¦
Neowizard bc65c3c
Merge branch 'pylint-dev:main' into false-positive-unbalanced-dict-unβ¦
Neowizard f721da9
Merge remote-tracking branch 'upstream/main' into false-positive-unbaβ¦
Neowizard 49888a1
Detect incidents of missing call to `items` during unbalanced-dict-unβ¦
Neowizard 51bf4bd
Rephrased comment about bypassing unbalanced-dict-unpacking for consiβ¦
Neowizard f63349a
Fix spelling
Pierre-Sassoulas 766d13b
Merge branch 'main' into false-positive-unbalanced-dict-unpacking
Neowizard bd3044d
Merge remote-tracking branch 'upstream/main' into false-positive-unbaβ¦
Neowizard f6becf1
Explicitly state the cases handled by the end of `visit_for` in `variβ¦
Neowizard 3989730
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] fb2f253
Refactored conditions for readability when detecting ubnalanced-dict-β¦
Neowizard 0fe5f2e
Fixed type'o in variable name variables.py
Neowizard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
When checking for unbalanced dict unpacking in for-loops, Pylint will now test whether the length of each value to be | ||
unpacked matches the number of unpacking targets. Previously, Pylint would test the number of values for the loop | ||
iteration, which would produce a false unbalanced-dict-unpacking warning. | ||
|
||
Closes #8156 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.