Skip to content

feat(clippy): add disallowed macros for asserts in clippy.toml #1376

Merged
simongdavies merged 1 commit intohyperlight-dev:mainfrom
simongdavies:no-asserts
Apr 16, 2026
Merged

feat(clippy): add disallowed macros for asserts in clippy.toml #1376
simongdavies merged 1 commit intohyperlight-dev:mainfrom
simongdavies:no-asserts

Conversation

@simongdavies
Copy link
Copy Markdown
Member

This pull request introduces stricter linting for assertion macros in release builds.

Linting and Build Configuration Changes:

  • Added a clippy.toml configuration disallowing the use of assert!, assert_eq!, and assert_ne! macros in release builds, with explanations for each.
  • Updated crate-level attributes in lib.rs to globally suppress the clippy::disallowed_macros lint, then selectively re-enable it for release host builds (with std feature), while allowing asserts for guest targets and in test/debug builds. This is thoroughly documented in comments.

…ppress globally

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
@simongdavies simongdavies added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Apr 14, 2026
Copy link
Copy Markdown
Contributor

@dblnz dblnz left a comment

Choose a reason for hiding this comment

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

I see the changes only affect hyperlight-common, shouldn't we do the same thing for the other crates used on the host?

@simongdavies
Copy link
Copy Markdown
Member Author

I see the changes only affect hyperlight-common, shouldn't we do the same thing for the other crates used on the host?

The hyperlight-host crate should already have this, are there others we need?

@simongdavies simongdavies merged commit 108fd89 into hyperlight-dev:main Apr 16, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants