Skip to content

ci: lint Windows-only Rust with a native Windows clippy job#182

Merged
simongdavies merged 1 commit into
mainfrom
simongdavies/windows-clippy-ci
Jun 3, 2026
Merged

ci: lint Windows-only Rust with a native Windows clippy job#182
simongdavies merged 1 commit into
mainfrom
simongdavies/windows-clippy-ci

Conversation

@simongdavies

Copy link
Copy Markdown
Member

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-test job's just lint-all). That means #[cfg(target_os = "windows")] / WHP branches in the host crate are never scanned, and a real clippy -D warnings error has been hiding there.

Changes

  • .github/workflows/pr-validate.yml new clippy-windows job (name: Clippy (Windows)) on the hld-win2025-amd 1ES pool, mirroring the WHP build runner labels. It runs just lint-analysis-guest (cargo fmt --check + cargo clippy --workspace -- -D warnings) natively on Windows. Wired into ci-status so it gates merges.
  • src/code-validator/guest/host/src/sandbox.rs fixes the pre-existing clippy::needless_return that 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-msvc that the #[cfg(windows)] block is correctly treated as the function's tail expression (compiles clean, returns Ok("whp")); the non-Windows Err tail is unchanged.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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>
Copilot AI review requested due to automatic review settings June 3, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-windows GitHub Actions job that runs just lint-analysis-guest on the Windows 1ES pool and gates merges via ci-status.
  • Refactor the Windows check_hyperlight_availability() branch to avoid clippy::needless_return by 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.

@simongdavies simongdavies merged commit d1468c3 into main Jun 3, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants