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

Fix-should-panic-lint #127

Merged
merged 6 commits into from
Feb 24, 2024
Merged

Fix-should-panic-lint #127

merged 6 commits into from
Feb 24, 2024

Conversation

albertotirla
Copy link
Member

@albertotirla albertotirla commented Feb 24, 2024

this is especially needed because without it, everyone else's pull requests will break on the CI step, requiring ignoring by maintainers, which is harder work because now we have to filter out what we know to be clippy errors related to legacy code, and what is new lints detected on new code, which no one should do
assuming this passes tests, it should be merged right away, and existing unmerged pull requests should afterwards rebase upon main

in stead, the message has been wrapped in `.context()`, which wraps the originating error in an anyhow error with the specified message, so that, in stead of panicking, the error gets bubbled up, logged and tracked, and then the program exits with the span traces belonging to that error.
this is much cleanner and healthier than panicking, so that's the reason I'm going with this
in stead, wrap the message with `anyhow::context`, then bubble it upward
in stead, anyhow::context is being used, to wrap the error
the signature of a function was changed to return a result, the test did likewise have to change to accomodate it. Luckily, that function was used only in one test
this is done because I can't meaningfully use error propagation in that context, since the unwrapping happens inside the declaration of a lazy static, but the explicit allow had to be added in order to eliminate all clippy warnings
Copy link

codecov bot commented Feb 24, 2024

Codecov Report

Attention: Patch coverage is 53.84615% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 14.33%. Comparing base (cf57b7e) to head (7d98fd2).

Files Patch % Lines
cache/src/lib.rs 12.50% 7 Missing ⚠️
odilia/src/events/object.rs 0.00% 2 Missing ⚠️
odilia/src/main.rs 0.00% 2 Missing ⚠️
odilia/src/state.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
+ Coverage   14.15%   14.33%   +0.17%     
==========================================
  Files          16       16              
  Lines        1533     1556      +23     
==========================================
+ Hits          217      223       +6     
- Misses       1316     1333      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

mostly related to using try_into instead of into, add explicit matching on unit types in stead of _, etc

this should hopefully fix most of the warnings which make our clippy test fail
@albertotirla albertotirla merged commit 797956a into main Feb 24, 2024
11 checks passed
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.

1 participant