Skip to content

feat(workflows): add clippy-fixer agentic workflow#575

Merged
jamesadevine merged 1 commit into
mainfrom
workflow/clippy-fixer
May 16, 2026
Merged

feat(workflows): add clippy-fixer agentic workflow#575
jamesadevine merged 1 commit into
mainfrom
workflow/clippy-fixer

Conversation

@jamesadevine

Copy link
Copy Markdown
Collaborator

Summary

Adds a new agentic workflow, clippy-fixer, that runs daily and opens a focused PR to clear cargo clippy warnings as they surface.

Design (mirrors the existing bash-lint-auditor pattern):

  • Trigger: fuzzy daily schedule around 08:30
  • Permissions: read-only — all writes flow through safe-outputs
  • Tools: bash, github, cache-memory (to track prior runs and avoid duplicate PRs)
  • Network: defaults, rust (cargo / crates.io)
  • Safe output: create-pull-request (max 1) with allowed-files scoped to src/**, tests/**, examples/**, ado-aw-derive/**, Cargo.toml, Cargo.lock

Agent loop:

  1. Load cache state; exit early if a prior clippy-fixer PR is still open.
  2. Verify toolchain / install the clippy component if missing.
  3. Baseline cargo clippy --all-targets --all-features --workspace -- -D warnings.
  4. Triage to one focused scope per run — explicitly forbids mixing unrelated lints, blanket #[allow], or Cargo.toml lint-level edits.
  5. Apply canonical fixes from a built-in lint-to-fix table covering the common rules (needless_borrow, redundant_clone, uninlined_format_args, or_fun_call, single_match, etc.).
  6. Validate with cargo build, cargo test, and a full clippy pass. Revert if cargo test regresses.
  7. Save state to cache and open a PR with a conventional-commits title (style/refactor/fix(clippy): ...).

Includes both the source .md and the compiled .lock.yml.

Test plan

  • gh aw compile clippy-fixer → 0 errors, 0 warnings.
  • gh aw compile clippy-fixer --validate → passes (only an informational notice about a newer actions/github-script SHA, which is repo-wide and unrelated to this workflow).

The workflow runs against the production toolchain on a real runner, so live verification will happen on the first scheduled execution.

Daily workflow that runs cargo clippy across the workspace and opens

a focused, conventional-commits-titled PR for any warnings it finds.

Mirrors the bash-lint-auditor pattern: read-only permissions, writes

via safe-outputs (create-pull-request, max 1, allowed-files scoped to

src/, tests/, examples/, ado-aw-derive/, Cargo.toml/lock), one focused

scope per run, full cargo build + test + clippy validation before

opening a PR, and cache-memory state to avoid duplicate PRs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine merged commit ca914f1 into main May 16, 2026
12 checks passed
@jamesadevine jamesadevine deleted the workflow/clippy-fixer branch May 16, 2026 20:59
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