Skip to content

Conversation

@simongdavies
Copy link
Contributor

@simongdavies simongdavies commented Mar 5, 2025

This PR:

Adds a clippy lints to check for use of expect, panic and unwrap in hyperlight-host for non test/non dev code in hyperlight_host and hyperlight_common
Removes all uses of expect in non test/dev code in hyperlight-host.
Removes all uses of panic in non test/dev code in hyperlight-host.
Removes all uses of unwrap in non test/dev code in hyperlight-host.

Adds a clippy.toml file to hyperlight_host/src and hyperlight_common/src to prevent the use of assert* using disallowed_macros lint
Disables the disallowed_macros lint for test and dev code

Fixes #320

@simongdavies simongdavies added the kind/refactor For PRs that restructure or remove code without adding new functionality. label Mar 5, 2025
@simongdavies simongdavies force-pushed the fix-unwrap-panic-expect-assert branch 3 times, most recently from 8f6ad7f to 5d4faf5 Compare March 5, 2025 18:38
@simongdavies simongdavies force-pushed the fix-unwrap-panic-expect-assert branch 4 times, most recently from e1c5ad9 to b7dab3c Compare March 18, 2025 12:58
@simongdavies simongdavies force-pushed the fix-unwrap-panic-expect-assert branch from b7dab3c to e8e9bd6 Compare March 18, 2025 13:30
@simongdavies simongdavies changed the title Remove and Prevent use of expect/assert*/panic/unwrap in hyperlight Remove and Prevent use of expect/assert*/panic/unwrap in hyperlight_host Mar 18, 2025
@simongdavies simongdavies force-pushed the fix-unwrap-panic-expect-assert branch from e8e9bd6 to 1716a9a Compare March 18, 2025 13:35
@simongdavies simongdavies marked this pull request as ready for review March 18, 2025 13:37
@simongdavies simongdavies changed the title Remove and Prevent use of expect/assert*/panic/unwrap in hyperlight_host Review/remove and Prevent unintentional use of expect/assert*/panic/unwrap in hyperlight_host Mar 18, 2025
@simongdavies simongdavies changed the title Review/remove and Prevent unintentional use of expect/assert*/panic/unwrap in hyperlight_host Review/remove and prevent unintentional use of expect/assert*/panic/unwrap in hyperlight_host Mar 18, 2025
@simongdavies simongdavies changed the title Review/remove and prevent unintentional use of expect/assert*/panic/unwrap in hyperlight_host Review/remove and prevent unintentional use of expect/assert*/panic/unwrap in hyperlight_host and hyperlght_common Mar 18, 2025
Copy link
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@simongdavies simongdavies merged commit eef8ac5 into hyperlight-dev:main Mar 18, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor For PRs that restructure or remove code without adding new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review use of expect/panic/assert/unwrap across the hyperlight codebase

2 participants