Skip to content

ci: lint the Rust crates on PRs, and format the mcp tests - #82

Open
knihit wants to merge 12 commits into
mainfrom
fix/mcp-rustfmt
Open

knihit wants to merge 12 commits into
mainfrom
fix/mcp-rustfmt

Conversation

@knihit

@knihit knihit commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

CI:

  • validate-pr.yml runs the root make lint, which lints cli, mcp and shared (clippy with -D warnings, then cargo fmt --check), so a crate added there is linted in CI too. PR CI ran the Rust tests but never linted them, so formatting drift went unnoticed.
  • Only the lint step is pinned: it installs Rust 1.98.1 with clippy and rustfmt and runs make lint CARGO="cargo +$RUST_LINT_TOOLCHAIN". On floating stable, each Rust release could add clippy lints that -D warnings turns into failures on every PR. Builds and tests stay on floating stable, the toolchain release.yml ships with, so a stable-only break still shows up in PR CI. A root rust-toolchain.toml was not used, because it would also pin release builds and every contributor's local cargo. Bump RUST_LINT_TOOLCHAIN deliberately.

Formatting:

  • cargo fmt on four mcp/servers/skill-lookup/tests/ files that had drifted from rustfmt's output: find_skills_shakedown.rs, full_tool_surface.rs, get_skill_shakedown.rs and handshake_shakedown.rs. Line wrapping only.

CHANGELOG: one bullet in a new ### Added section under [Unreleased].

Docs: appendix/contributing.md (and both HTML bundles) give make lint CARGO="cargo +1.98.1" as the pre-PR check, so a local run matches CI's lint toolchain.

Type of Change

  • Infrastructure / pipeline

Testing

  • make lint passes on Rust 1.98.1 (RUSTUP_TOOLCHAIN=1.98.1). Before the formatting change, make -C mcp lint failed on those four files.
  • make -C mcp test-rust passes after formatting.
  • The workflow parses.
  • npm test: not affected
  • cd cli && make test: no cli/ changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own changes
  • My changes generate no new warnings

Notes for Reviewers

  • docs/site/.user-guide.manifest is re-recorded because contributing.md changed, and build-user-guide.sh --check hashes the Markdown tree. It does not hide anything new: main already records the current Markdown hash and its --check passes, while both bundles on main still lack the install-kiro-power and install-claude-plugin-marketplace pages. Getting those pages into the bundles needs a full guide rebuild, which belongs in its own PR.
  • Lint stays the last step of Status Checks rather than a separate job. Status Checks is the required check, so a separate job would block nothing until the branch rule is changed, and running lint first would hide test results instead.
  • make guide-check now compares the lint toolchain named in the guide and both bundles with RUST_LINT_TOOLCHAIN.

knihit and others added 2 commits October 25, 2026 04:11
PR CI ran the Rust tests but never clippy or rustfmt, so four mcp test
files drifted from rustfmt's output. Format them, install the clippy and
rustfmt components, and run make lint for cli, mcp and shared.
@knihit
knihit marked this pull request as ready for review October 25, 2026 18:13
knihit and others added 10 commits October 27, 2026 23:31
A floating stable toolchain lets each Rust release add clippy lints that
-D warnings turns into failures on every PR. Pin 1.98.1 (lint passes on
it) and bump it on purpose. The lint step now runs the root make lint,
so a crate added there is linted in CI too.
… Added

Move the make lint step to the end of the PR validation job so a lint
failure no longer skips the claude CLI install, the plugin check, or the
tarball check. Restore the "# stable" ref comment on the pinned
rust-toolchain action, matching release.yml. List the new PR lint check
under Added in the Unreleased CHANGELOG section.
The job-wide 1.98.1 pin also moved PR builds and tests off the stable
toolchain that release.yml ships with. The setup step now installs
floating stable again, matching release.yml, and drops the clippy and
rustfmt components since only the lint step uses them. The lint step
installs 1.98.1 with clippy and rustfmt and runs
make lint CARGO="cargo +1.98.1", so only lint stays pinned.
The lint step reads the pinned version from RUST_LINT_TOOLCHAIN instead
of repeating 1.98.1 in two commands.
…t, and tie the doc to the pin

The pre-PR check now installs the toolchain with clippy and rustfmt
first. The workflow comment says to update contributing.md when the pin
moves.
# Conflicts:
#	docs/index.html
#	docs/site/.user-guide.manifest
#	docs/site/user-guide.html
…TOOLCHAIN

check-guide-facts.py now reads the pin from validate-pr.yml and fails
if contributing.md or either HTML bundle names a different version.

This branch has not been deployed

No deployments
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.

1 participant