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

Extend exception-related checks to except* #9197

Merged
merged 15 commits into from
Nov 10, 2023

Conversation

azinneck0485
Copy link
Contributor

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Modify exceptions.py checks to detect try-except* blocks and treat the same as try-except.

Also updated basic_checker.py so that try-except* blocks are not flagged as "pointless-statement"

Functional tests for broad-exception-caught and broad-exception-raised were updated to include try-except*. All tests passed locally with pytest, tox, and primer.

Closes #8827

@Pierre-Sassoulas Pierre-Sassoulas added False Negative πŸ¦‹ No message is emitted but something is wrong with the code python 3.12 labels Oct 28, 2023
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.1.0 milestone Oct 28, 2023
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.

I have a nit but this is going straight into 3.1.0, great work :)

pylint/checkers/base/basic_checker.py Outdated Show resolved Hide resolved
Co-authored-by: Pierre Sassoulas <[email protected]>
@azinneck0485
Copy link
Contributor Author

thank you!

and thanks for the suggested change, I wasn't aware of that syntax and it looks so much better with less repeated code :-)

@jacobtylerwalls jacobtylerwalls changed the title Issue8827 exceptstar Extend exception-related checks to except* Oct 28, 2023
@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas enabled auto-merge (squash) November 9, 2023 23:13

This comment has been minimized.

auto-merge was automatically disabled November 10, 2023 02:47

Head branch was pushed to by a user without write access

Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Merging #9197 (400c41d) into main (2b17c39) will increase coverage by 0.00%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9197   +/-   ##
=======================================
  Coverage   95.79%   95.79%           
=======================================
  Files         173      173           
  Lines       18718    18720    +2     
=======================================
+ Hits        17931    17933    +2     
  Misses        787      787           
Files Coverage Ξ”
pylint/checkers/base/basic_checker.py 98.08% <ΓΈ> (ΓΈ)
pylint/checkers/exceptions.py 98.26% <100.00%> (+0.01%) ⬆️

@Pierre-Sassoulas Pierre-Sassoulas enabled auto-merge (squash) November 10, 2023 08:52
Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 400c41d

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 for your contribution, congrats on becoming a pylint contributor πŸŽ‰

@Pierre-Sassoulas Pierre-Sassoulas merged commit ae344fb into pylint-dev:main Nov 10, 2023
43 of 59 checks passed
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 python 3.11
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend broad-exception-raised and broad-exception-caught to except*
3 participants