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 used-before-assignment for assignment expressions in lambda #5530

Merged
merged 5 commits into from
Dec 21, 2021

Conversation

DanielNoord
Copy link
Collaborator

@DanielNoord DanielNoord commented Dec 15, 2021

  • 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

This closes #5360, closes #3877

See a prior discussion in #5241 (comment) and @jacobtylerwalls's comments about it #5241 (comment).

This also fixes the message that gets raised in home-assistant https://github.com/home-assistant/core/blob/296b73874054eec31d91f0db1b9a625ad5d47c32/homeassistant/components/sht31/sensor.py#L63. That also seems to indicate to me that this code is not doing anything meaningful.

The original commit that added it was 5193b7d.
The tests added in that commit still pass with the change in this PR so I think this should be fine?

@DanielNoord DanielNoord added the False Positive 🦟 A message is emitted but nothing is wrong with the code label Dec 15, 2021
@coveralls
Copy link

coveralls commented Dec 15, 2021

Pull Request Test Coverage Report for Build 1606114780

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 93.702%

Totals Coverage Status
Change from base Build 1605912068: 0.01%
Covered Lines: 14299
Relevant Lines: 15260

💛 - Coveralls

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.13.0 milestone Dec 15, 2021
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.

There's a pattern of simply removing code and fixing bug, hmm. 🤔

@DanielNoord DanielNoord added the C: used-before-assignment Issues related to 'used-before-assignment' check label Dec 15, 2021
@DanielNoord
Copy link
Collaborator Author

Also closes #3877.

Adding it to the list of closed issues.

ChangeLog Outdated Show resolved Hide resolved
doc/whatsnew/2.13.rst Outdated Show resolved Hide resolved
@Pierre-Sassoulas
Copy link
Member

Do you want another review before merging ?

@DanielNoord
Copy link
Collaborator Author

I think this should be fine. We have two separate issues reports about this and this fixes this issue. I don't think this was an intended message.

@Pierre-Sassoulas Pierre-Sassoulas merged commit 52576b7 into pylint-dev:main Dec 21, 2021
@DanielNoord DanielNoord deleted the undefined-variable branch December 21, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: used-before-assignment Issues related to 'used-before-assignment' check False Positive 🦟 A message is emitted but nothing is wrong with the code
Projects
None yet
3 participants