Skip to content

Regression fix for unused-variable false negative#8684

Merged
jacobtylerwalls merged 7 commits intopylint-dev:mainfrom
zenlyj:regression-fix
May 15, 2023
Merged

Regression fix for unused-variable false negative#8684
jacobtylerwalls merged 7 commits intopylint-dev:mainfrom
zenlyj:regression-fix

Conversation

@zenlyj
Copy link
Copy Markdown
Contributor

@zenlyj zenlyj commented May 14, 2023

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Description

This is a fix for a false negative regression caused by #8441. The issue lies in _defines_name_raises_or_returns(), which returns false even when an exception variable defines the given name.

Closes #8595

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2023

Codecov Report

Merging #8684 (3bc94ee) into main (4e48d46) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8684   +/-   ##
=======================================
  Coverage   95.80%   95.80%           
=======================================
  Files         172      172           
  Lines       18300    18302    +2     
=======================================
+ Hits        17533    17535    +2     
  Misses        767      767           
Impacted Files Coverage Δ
pylint/checkers/variables.py 97.24% <100.00%> (+<0.01%) ⬆️

@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas added the False Negative 🦋 No message is emitted but something is wrong with the code label May 14, 2023
@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.0.0a7 milestone May 14, 2023
@jacobtylerwalls jacobtylerwalls added Unreleased Skip news 🔇 This change does not require a changelog entry labels May 14, 2023
Copy link
Copy Markdown
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

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

Great, thank you for contributing a fix before 3.0 was released!

Comment thread doc/whatsnew/fragments/8595.false_negative Outdated
@github-actions
Copy link
Copy Markdown
Contributor

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

This comment was generated for commit 3bc94ee

@jacobtylerwalls jacobtylerwalls merged commit 2c9d585 into pylint-dev:main May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

False Negative 🦋 No message is emitted but something is wrong with the code Skip news 🔇 This change does not require a changelog entry Unreleased

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unused-variable false negative on a caught exception in the latest 3.x alpha release

3 participants