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

chore: Fix pylint 2.16.2 complains #145

Merged
merged 2 commits into from Mar 14, 2023
Merged

Conversation

bdrung
Copy link
Collaborator

@bdrung bdrung commented Mar 13, 2023

pylint 2.16.2 complains:

************* Module apport.ui
apport/ui.py:1567:20: W0101: Unreachable code (unreachable)
************* Module apport.packaging_impl.rpm
apport/packaging_impl/rpm.py:184:12: W0719: Raising too general exception: Exception (broad-exception-raised)
************* Module apport.crashdb_impl.launchpad
apport/crashdb_impl/launchpad.py:397:16: W0719: Raising too general exception: Exception (broad-exception-raised)
************* Module gtk.apport-gtk
gtk/apport-gtk:678:8: W0101: Unreachable code (unreachable)

Remove the unreachable code and replace both exceptions with NotImplementedError which is more precise.

pylint 2.16.2 complains:

```
************* Module apport.ui
apport/ui.py:1567:20: W0101: Unreachable code (unreachable)
************* Module gtk.apport-gtk
gtk/apport-gtk:678:8: W0101: Unreachable code (unreachable)
```

Remove the unreachable code.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
pylint 2.16.2 complains:

```
************* Module apport.packaging_impl.rpm
apport/packaging_impl/rpm.py:184:12: W0719: Raising too general exception: Exception (broad-exception-raised)
************* Module apport.crashdb_impl.launchpad
apport/crashdb_impl/launchpad.py:397:16: W0719: Raising too general exception: Exception (broad-exception-raised)
```

Replace both instances with `NotImplementedError` which is more precise.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
@bdrung bdrung requested a review from schopin-pro March 13, 2023 09:13
@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Merging #145 (807a857) into main (45522de) will increase coverage by 0.21%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   81.74%   81.95%   +0.21%     
==========================================
  Files          87       87              
  Lines       18193    18191       -2     
==========================================
+ Hits        14871    14908      +37     
+ Misses       3322     3283      -39     
Impacted Files Coverage Δ
apport/crashdb_impl/launchpad.py 0.00% <0.00%> (ø)
apport/packaging_impl/rpm.py 3.90% <0.00%> (ø)
apport/ui.py 70.18% <ø> (+0.07%) ⬆️
gtk/apport-gtk 77.41% <ø> (+0.19%) ⬆️

... and 8 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@bdrung
Copy link
Collaborator Author

bdrung commented Mar 13, 2023

IMO codecov/patch can be ignored for this PR.

@schopin-pro schopin-pro merged commit 9f71fd4 into canonical:main Mar 14, 2023
23 of 24 checks passed
@bdrung bdrung deleted the pylint branch March 14, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants