Skip to content

Added example for bad-except-order#5997

Merged
DanielNoord merged 1 commit intopylint-dev:mainfrom
matusvalo:bad-except-order
Mar 28, 2022
Merged

Added example for bad-except-order#5997
DanielNoord merged 1 commit intopylint-dev:mainfrom
matusvalo:bad-except-order

Conversation

@matusvalo
Copy link
Copy Markdown
Collaborator

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Description

Closes partially #5953

Co-authored-by: Vladyslav Krylasov <vladyslav.krylasov@gmail.com>
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 27, 2022

Pull Request Test Coverage Report for Build 2047857185

  • 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 94.154%

Totals Coverage Status
Change from base Build 2047793050: 0.0%
Covered Lines: 15334
Relevant Lines: 16286

💛 - Coveralls

Comment on lines +5 to +6
except Exception:
raise
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This would emit try-except-raise, I think, so maybe we should model doing something with the exception?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Based on this discussion #5992 (comment) we should prefer simplicity/readability over code cleanness.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's fair, but I think a flexible approach to this is worth considering, because I suspect we'll get an issue someday "I rewrote my code the way pylint said to but then I got another error".

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I leave the decision to @Pierre-Sassoulas and @DanielNoord

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about a pass instead of a raise ? Still simple, but no try-except-raise ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess it's a losing battle because bare-exception is also in play (probably?). So I'm willing to leave this be 😄

@DanielNoord DanielNoord merged commit fa0a1ae into pylint-dev:main Mar 28, 2022
@matusvalo matusvalo deleted the bad-except-order branch March 28, 2022 09:05
@Pierre-Sassoulas Pierre-Sassoulas removed this from the 2.14.0 milestone May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants