chore: fix Rust clippy/fmt errors and add Rust linting to CI#2
Open
simongdavies wants to merge 1 commit intohyperlight-dev:mainfrom
Open
chore: fix Rust clippy/fmt errors and add Rust linting to CI#2simongdavies wants to merge 1 commit intohyperlight-dev:mainfrom
simongdavies wants to merge 1 commit intohyperlight-dev:mainfrom
Conversation
Contributor
simongdavies
commented
Mar 23, 2026
- Fix clippy errors: unwrap_used, manual_strip, dead code, needless_range_loop
- Allow expect_used on static regex patterns in plugin_scan.rs
- Add check-cfg for cfg(hyperlight) in native-globals Cargo.toml
- Format all Rust code (analysis-guest + sandbox runtime)
- Update CI to use just lint-all + test-all (adds Rust lint/fmt/clippy)
- Rename just recipes for clarity: lint-rust -> lint-analysis-guest, etc.
- Update all docs to reflect renamed recipes
There was a problem hiding this comment.
Pull request overview
This PR tightens Rust quality gates across the repo by fixing clippy/fmt issues in the Rust guest/runtime code, standardizing just recipes, and updating CI + documentation to run the full TS+Rust lint/test suite.
Changes:
- Fix Rust clippy warnings and apply Rustfmt across the analysis guest/runtime and sandbox runtime modules.
- Rename
justrecipes (e.g.test-rust→test-analysis-guest) and update CI to runjust lint-all+just test-all. - Add
unexpected_cfgscheck-cfgconfiguration to silencecfg(hyperlight)warnings in Cargo manifests.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/CLAUDE.md | Updates test commands to the renamed just test-analysis-guest recipe. |
| src/sandbox/runtime/src/main.rs | Import ordering tweak to satisfy formatting/lints. |
| src/sandbox/runtime/modules/native-globals/src/lib.rs | Rustfmt-only changes around string eval blocks and whitespace stripping. |
| src/sandbox/runtime/modules/native-globals/Cargo.toml | Adds check-cfg for cfg(hyperlight) to avoid unexpected_cfgs warnings. |
| src/code-validator/guest/runtime/src/validator.rs | Refactors conditionals/loops to satisfy clippy (let-chains, is_some_and, etc.). |
| src/code-validator/guest/runtime/src/plugin_scan.rs | Adds a clippy allow for expect_used in static regex construction. |
| src/code-validator/guest/runtime/src/metadata.rs | Clippy-driven refactors (strip_prefix, let-chains) and minor test assertion formatting. |
| src/code-validator/guest/runtime/src/lib.rs | Removes an unused Vec import. |
| src/code-validator/guest/runtime/src/js_parser.rs | Clippy-driven refactors (let-chains, safer Option handling). |
| src/code-validator/guest/README.md | Updates docs to the renamed Rust test recipe. |
| src/code-validator/guest/host/src/sandbox.rs | Minor import organization + simplifies runtime-handle error construction. |
| src/code-validator/guest/host/src/runtime.rs | Refactors shutdown flow using let-chains (clippy/clarity). |
| Justfile | Renames Rust recipes and updates aggregate targets (lint-all, fmt-all, test-all). |
| docs/DEVELOPMENT.md | Updates developer documentation to the renamed just recipes. |
| CLAUDE.md | Updates top-level instructions for new just recipe names. |
| .github/workflows/pr-validate.yml | CI now runs just lint-all and just test-all for the lint/test job. |
| .github/instructions/tests.instructions.md | Updates test instructions to just test-analysis-guest. |
| .github/copilot-instructions.md | Updates instruction docs for the renamed Rust test recipe. |
| .claude/CLAUDE.md | Updates Claude instructions for the renamed just recipes. |
b36ed11 to
5cd684c
Compare
- Fix clippy errors: unwrap_used, manual_strip, dead code, needless_range_loop - Allow expect_used on static regex patterns in plugin_scan.rs - Add check-cfg for cfg(hyperlight) in native-globals Cargo.toml - Format all Rust code (analysis-guest + sandbox runtime) - Update CI to use just lint-all + test-all (adds Rust lint/fmt/clippy) - Rename just recipes for clarity: lint-rust -> lint-analysis-guest, etc. - Update all docs to reflect renamed recipes Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
5cd684c to
b30b148
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.