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 false positive used-before-assignment for named expressions in ternary operators #5748

Merged
merged 1 commit into from
Feb 2, 2022

Conversation

jacobtylerwalls
Copy link
Member

@jacobtylerwalls jacobtylerwalls commented Jan 30, 2022

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Extend an existing special case in the variables checker ("Single statement if, with assignment expression on same line as assignment") to include assignment expressions inside ternary operator tests used in calls (keyword or positional arguments).

Closes #5177
Closes #5212

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1768856502

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.878%

Totals Coverage Status
Change from base Build 1768037003: 0.0%
Covered Lines: 14767
Relevant Lines: 15730

πŸ’› - Coveralls

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 @jacobtylerwalls !

@Pierre-Sassoulas Pierre-Sassoulas added the False Positive 🦟 A message is emitted but nothing is wrong with the code label Jan 30, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.13.0 milestone Jan 30, 2022
@Pierre-Sassoulas Pierre-Sassoulas merged commit e177b19 into pylint-dev:main Feb 2, 2022
@jacobtylerwalls jacobtylerwalls deleted the ternary-walrus branch February 2, 2022 14:46
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
3 participants