ci: lint Windows-only Rust with a native Windows clippy job#182
Merged
Conversation
Clippy previously ran only on Linux (lint-and-test's just lint-all), so Windows-only Rust code paths (#[cfg(target_os = "windows")] / WHP) in the host crate were never scanned. This adds a native Windows clippy job on the win2025 1ES pool running just lint-analysis-guest. It also fixes the pre-existing clippy::needless_return in host/src/sandbox.rs that the new job surfaces, turning the cfg(windows) WHP arm into a tail expression. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens CI coverage by adding a native Windows Clippy job so cfg(target_os = "windows") Rust code paths (notably WHP-related logic) are linted under -D warnings, and it fixes a Windows-only Clippy warning that job would surface.
Changes:
- Add a
clippy-windowsGitHub Actions job that runsjust lint-analysis-gueston the Windows 1ES pool and gates merges viaci-status. - Refactor the Windows
check_hyperlight_availability()branch to avoidclippy::needless_returnby using a tail expression.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/pr-validate.yml |
Adds a Windows-native clippy job and wires it into the merge-gating status job. |
src/code-validator/guest/host/src/sandbox.rs |
Removes an unnecessary return in a Windows-only branch to satisfy Clippy under -D warnings. |
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.
What
Adds a native Windows clippy CI job so Windows-only Rust code paths get linted.
Today clippy runs only on Linux (the
lint-and-testjob'sjust lint-all). That means#[cfg(target_os = "windows")]/ WHP branches in thehostcrate are never scanned, and a realclippy -D warningserror has been hiding there.Changes
.github/workflows/pr-validate.ymlnewclippy-windowsjob (name: Clippy (Windows)) on thehld-win2025-amd1ES pool, mirroring the WHP build runner labels. It runsjust lint-analysis-guest(cargo fmt --check+cargo clippy --workspace -- -D warnings) natively on Windows. Wired intoci-statusso it gates merges.src/code-validator/guest/host/src/sandbox.rsfixes the pre-existingclippy::needless_returnthat the new job surfaces, turning the#[cfg(windows)]WHP arm into a tail expression (Ok("whp".to_string())).Validation
Verified natively on
x86_64-pc-windows-msvcthat the#[cfg(windows)]block is correctly treated as the function's tail expression (compiles clean, returnsOk("whp")); the non-WindowsErrtail is unchanged.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com