Skip to content

Adding clippy::exit lint #3994

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

Merged
merged 11 commits into from
Aug 9, 2023
Merged

Conversation

ShadowCurse
Copy link
Contributor

Changes

This PR is build on top of another PR: #3575
Adds new lint: clippy::exit and makes necessary changes for it.
Updates Error and Result types for several crates.

Reason

Enables the use of clippy::exit. Fixes #3233

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@ShadowCurse ShadowCurse added Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests labels Jul 28, 2023
@ShadowCurse ShadowCurse self-assigned this Jul 28, 2023
@ShadowCurse ShadowCurse force-pushed the clippy_exit branch 2 times, most recently from 25f11e5 to 932421c Compare July 28, 2023 16:22
@ShadowCurse ShadowCurse mentioned this pull request Jul 28, 2023
9 tasks
@ShadowCurse ShadowCurse force-pushed the clippy_exit branch 2 times, most recently from 21ae4d5 to 2dcffb1 Compare July 28, 2023 20:04
@ShadowCurse ShadowCurse removed the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Jul 31, 2023
@ShadowCurse ShadowCurse force-pushed the clippy_exit branch 5 times, most recently from 34c1ad5 to 4779b99 Compare July 31, 2023 16:39
@ShadowCurse ShadowCurse added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Jul 31, 2023
@ShadowCurse ShadowCurse force-pushed the clippy_exit branch 4 times, most recently from 17aab38 to 92dc405 Compare August 4, 2023 11:56
roypat
roypat previously requested changes Aug 4, 2023
@ShadowCurse ShadowCurse force-pushed the clippy_exit branch 2 times, most recently from 18d8bde to 9e27f04 Compare August 7, 2023 09:49
@roypat roypat requested a review from wearyzen August 8, 2023 09:13
@roypat roypat dismissed their stale review August 8, 2023 09:14

Waiting for Sudan to look into this too, but generally looks good to me!

ShadowCurse and others added 11 commits August 9, 2023 10:44
Removed `std::process::exit` call.
Updated `main` to return `Result`.

Signed-off-by: Egor Lazarchuk <[email protected]>
Co-authored-by: Lukas Schwerdtfeger <[email protected]>
Renamed `Error` enums with more descriptive names.
Removed redefinition of `Result` type.

Signed-off-by: Egor Lazarchuk <[email protected]>
Replaced `std::process::exit` calls with
error enums. Errors are now returned from `main`.

Signed-off-by: Egor Lazarchuk <[email protected]>
Co-authored-by: Lukas Schwerdtfeger <[email protected]>
-Moved creation of HttpServer out of `bind_and_run`.
-Renamed `bind_and_run` into `run`, changed return
type to void and updated doc description.
-Removed `Error` enum and `Result` redefinition as they
are not used anymore.
-Added `getrandom` syscall to api thread allow list. It
is needed for `HashMap` inside `HttpServer` to reinitialize
it's thread local vars.

Signed-off-by: Egor Lazarchuk <[email protected]>
Replaced `std::process::exit` calls with
error enums. Errors are now returned from `main`.

Signed-off-by: Egor Lazarchuk <[email protected]>
Co-authored-by: Lukas Schwerdtfeger <[email protected]>
Renamed `Error` enums with more descriptive names.
Removed redefinition of `Result` type.

Signed-off-by: Egor Lazarchuk <[email protected]>
Replaced `std::process::exit` calls with
error enums. Errors are now returned from `main`.

Signed-off-by: Egor Lazarchuk <[email protected]>
Co-authored-by: Lukas Schwerdtfeger <[email protected]>
Replaced `std::process::exit` calls with
error enums. Errors are now returned from `main`.

Signed-off-by: Egor Lazarchuk <[email protected]>
Co-authored-by: Lukas Schwerdtfeger <[email protected]>
Renamed `Error` enums with more descriptive names.
Removed redefinition of `Result` type.

Signed-off-by: Egor Lazarchuk <[email protected]>
Sets clippy to warn on the lint `clippy::exit`.

Signed-off-by: Egor Lazarchuk <[email protected]>
Co-authored-by: Lukas Schwerdtfeger <[email protected]>
Updated code coverage

Signed-off-by: Egor Lazarchuk <[email protected]>
@wearyzen wearyzen merged commit 07403a0 into firecracker-microvm:main Aug 9, 2023
@ShadowCurse ShadowCurse deleted the clippy_exit branch August 9, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use clippy::exit
4 participants