Skip to content

chore: remove broad Exception catching from config.py - #2212

Merged
nejch merged 1 commit into
mainfrom
jlvillal/config
Aug 7, 2022
Merged

chore: remove broad Exception catching from config.py#2212
nejch merged 1 commit into
mainfrom
jlvillal/config

Conversation

@JohnVillalovos

Copy link
Copy Markdown
Member

Change "except Exception:" catching to more granular exceptions.

A step in enabling the "broad-except" check in pylint.

@JohnVillalovos
JohnVillalovos marked this pull request as draft August 2, 2022 05:45
@JohnVillalovos
JohnVillalovos marked this pull request as ready for review August 2, 2022 06:27
@JohnVillalovos
JohnVillalovos requested a review from nejch August 2, 2022 16:00
@nejch

nejch commented Aug 3, 2022

Copy link
Copy Markdown
Member

Thanks @JohnVillalovos! Just 2 questions.

FWIW I recently realized we are rolling our own homebrew version of configparser (with all this try/except spaghetti) when python3's (and previously SafeConfigParser) parser actually handles section- vs. default defined options natively.

But probably not worth migrating that breaking change now that tomllib is coming to the stdlib and might be more attractivein the future to bring the config format in line with trends in the python world.

Comment thread gitlab/config.py Outdated
Comment thread gitlab/config.py Outdated
@codecov-commenter

codecov-commenter commented Aug 4, 2022

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.43%. Comparing base (9aecc9e) to head (0abc90b).
⚠️ Report is 817 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2212      +/-   ##
==========================================
- Coverage   95.43%   95.43%   -0.01%     
==========================================
  Files          81       81              
  Lines        5369     5368       -1     
==========================================
- Hits         5124     5123       -1     
  Misses        245      245              
Flag Coverage Δ
api_func_v4 81.35% <75.00%> (+0.03%) ⬆️
cli_func_v4 82.97% <90.00%> (-0.08%) ⬇️
unit 87.27% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
gitlab/config.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Change "except Exception:" catching to more granular exceptions.

A step in enabling the "broad-except" check in pylint.
@nejch

nejch commented Aug 7, 2022

Copy link
Copy Markdown
Member

Cool, I think we can get this in and double check if any new errors are thrown before the 28th :)

@nejch
nejch merged commit 70e67bf into main Aug 7, 2022
@nejch
nejch deleted the jlvillal/config branch August 7, 2022 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants