Module clippy

Module clippy 

Source
Expand description

cargo xtask clippy — lint across the full feature matrix.

The feature matrix is derived dynamically from the workspace Cargo.toml files, so adding a new feature flag automatically includes it in all clippy runs without any manual update.

§Feature matrix

Every power-set combination of workspace features is checked, each scoped to --workspace --all-targets.

§Reviewdog reporting

When --github-report is passed, clippy output is emitted as JSON and piped through reviewdog. Reviewdog filters the diagnostics to only lines touched by the diff and posts them as inline review comments.

Two modes are supported:

FlagReporterDiff sourceUse case
--github-reportgithub-pr-reviewGitHub PR APICI on pull requests
--github-report --diff-branch masterlocalgit diff masterLocal development

CI requirements:

  • reviewdog on PATH
  • REVIEWDOG_GITHUB_API_TOKEN set to a token with pull-requests: write

Local requirements:

  • reviewdog on PATH (provided by the devenv shell)

§JSON artifact collection

When --save-json <path> is passed, raw clippy JSON lines are written to the given file instead of running reviewdog or applying -D warnings. This is used by CI to collect per-feature-label artifacts that are later deduplicated and reported in a single cargo xtask ci clippy-report run.

Structs§

ClippyArgs
Arguments for cargo xtask clippy.

Functions§

filter 🔒
Returns the matrix entries to run, optionally filtered by label.
run
Runs cargo clippy across the feature matrix (or a single entry).
run_with_reviewdog 🔒
Runs cargo clippy --message-format=short and pipes the output through reviewdog.
save_json 🔒
Runs cargo clippy --message-format=json and writes every output line to dest, creating or truncating the file.