Skip to content
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

Fix crash in unnecessary-list-index-lookup checker (#6049) #6061

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

timmartin
Copy link
Contributor

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

This fixes a crash in the unnecessary-list-index-lookup checker where the value from enumerate() is being destructured, and thus no variable name is available. There are conceivably some cases where we could still salvage a useful check here, but the possible benefit seems minor and the original motivation was to catch the simple cases, so I hope we can just ignore this case for now.

Closes #6049

@coveralls
Copy link

coveralls commented Mar 30, 2022

Pull Request Test Coverage Report for Build 2067770457

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.0007%) to 94.212%

Totals Coverage Status
Change from base Build 2067203898: 0.0007%
Covered Lines: 15432
Relevant Lines: 16380

πŸ’› - Coveralls

@DanielNoord DanielNoord added Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer Crash πŸ’₯ A bug that makes pylint crash labels Mar 30, 2022
@DanielNoord DanielNoord added this to the 2.13.4 milestone Mar 30, 2022
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix @timmartin !

@jacobtylerwalls
Copy link
Member

This checker is not released yet, it's only in 2.14. So I'll remove the backport labels.

@jacobtylerwalls jacobtylerwalls removed the Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer label Mar 30, 2022
@jacobtylerwalls jacobtylerwalls modified the milestones: 2.13.4, 2.14.0 Mar 30, 2022
@DanielNoord DanielNoord merged commit e7344be into pylint-dev:main Mar 31, 2022
@timmartin timmartin deleted the issue-6049 branch April 27, 2022 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash πŸ’₯ A bug that makes pylint crash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError in unnecessary-list-index-lookup
5 participants