Skip to content

Skip unnecessary-list-index-lookup if we encounter if statements #7334

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
merged 2 commits into from
Aug 22, 2022

Conversation

DanielNoord
Copy link
Collaborator

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature, or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Type of Changes

Type
🐛 Bug fix

Description

Closes #6896.

/CC @timmartin This makes the check very conservative but our current test suite still passes and thus the check still offers some benefit. I'd like to merge this and have us improve the checker if somebody wants to: avoiding false positives is more important than false negatives imo.

@DanielNoord DanielNoord added the False Positive 🦟 A message is emitted but nothing is wrong with the code label Aug 22, 2022
@coveralls
Copy link

coveralls commented Aug 22, 2022

Pull Request Test Coverage Report for Build 2902267753

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

Totals Coverage Status
Change from base Build 2899745468: 0.001%
Covered Lines: 16887
Relevant Lines: 17720

💛 - Coveralls

@github-actions
Copy link
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit 817ad24

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.

👌

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.15.0 milestone Aug 22, 2022
@Pierre-Sassoulas Pierre-Sassoulas merged commit 5746f0d into pylint-dev:main Aug 22, 2022
@DanielNoord DanielNoord deleted the unnecessary-index branch August 22, 2022 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unnecessary-list-index-lookup false-positive when iterable is modified in loop
3 participants