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

Avoid reporting superfluous-parens after an is not operator #6451

Merged
merged 3 commits into from Apr 27, 2022

Conversation

timmartin
Copy link
Contributor

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

The superfluous-parens checker was incorrectly reporting that parentheses after an is not expression were superfluous. The checker seemed to be assuming that any expression prefixed with not was a unary expression and not part of a larger expression that might need parentheses for correctness.

Closes #5930

@coveralls
Copy link

coveralls commented Apr 24, 2022

Pull Request Test Coverage Report for Build 2234763611

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 252 unchanged lines in 18 files lost coverage.
  • Overall coverage decreased (-0.02%) to 95.12%

Files with Coverage Reduction New Missed Lines %
pylint/checkers/newstyle.py 1 96.15%
pylint/extensions/private_import.py 1 99.15%
pylint/lint/run.py 1 83.96%
pylint/checkers/design_analysis.py 2 98.9%
pylint/checkers/utils.py 2 95.76%
pylint/checkers/exceptions.py 5 97.7%
pylint/checkers/logging.py 8 94.29%
pylint/reporters/text.py 8 85.61%
pylint/checkers/base_checker.py 11 90.0%
pylint/checkers/format.py 11 96.21%
Totals Coverage Status
Change from base Build 2215661832: -0.02%
Covered Lines: 15749
Relevant Lines: 16557

πŸ’› - Coveralls

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.14.0 milestone Apr 24, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Bug πŸͺ² False Positive 🦟 A message is emitted but nothing is wrong with the code Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer labels Apr 24, 2022
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.14.0, 2.13.8 Apr 25, 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.

LGTM

@jacobtylerwalls jacobtylerwalls merged commit 0e35511 into pylint-dev:main Apr 27, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Backported and removed Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer labels May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported Bug πŸͺ² 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.

superfluous-parens false positive for is not tests
4 participants