본문으로 건너뛰기
cccskills
무료GitHub에 공개

clippy-diff-report

Run clippy locally and report only issues in the current diff, matching the CI reviewdog flow. Use when asked how to lint changed code or get clippy feedback on a branch before pushing.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Run Clippy on the Current Diff Only

The problem

Running cargo clippy on the whole workspace produces hundreds of warnings that may have nothing to do with your changes. The CI workflow solves this with reviewdog — a tool that filters clippy output to only lines touched by the PR diff.

You can run the same filter locally before pushing.

Prerequisites

  • reviewdog on PATH (provided by the devenv shell)
  • Documentation EPUB already built (cargo xtask docs --mdbook-only)
  • Native dependencies already built (cargo xtask setup --host)

Run clippy filtered to your diff

cargo xtask clippy --features emulator --github-report --diff-branch master

This:

  1. Runs cargo clippy --message-format=short for the emulator feature set
  2. Pipes output through reviewdog with -filter-mode=added
  3. Reviewdog diffs against master and prints only warnings on changed lines

Why --features emulator

cadmus-core requires a device feature (emulator, kobo, or deviceless) to compile — default is empty and --features default fails. For native host linting use emulator (it matches what run-emulator builds). The full feature matrix is large and slow; run it only in CI. Use cargo xtask ci matrix to see all available labels if you need a specific one.

Check all feature combinations you touched

If your changes span multiple feature sets (e.g. you added #[cfg(feature = "tracing")] code), run clippy for each relevant combination — every combination must include a device feature:

cargo xtask clippy --features emulator --github-report --diff-branch master
cargo xtask clippy --features "emulator + profiling + test + tracing" --github-report --diff-branch master

[!NOTE] The telemetry feature is excluded from the xtask matrix because it aliases tracing + profiling with no separate cfg branches. Use the expanded form (emulator + profiling + test + tracing) instead.

How it works

The xtask wrapper constructs a reviewdog invocation equivalent to:

reviewdog \
  -f=clippy \
  -filter-mode=added \
  -fail-on-error=false \
  -reporter=local \
  -diff="git diff --no-ext-diff master"
  • -filter-mode=added — only reports diagnostics on lines that appear in the diff (new or modified lines)
  • -reporter=local — prints to terminal instead of posting GitHub comments
  • -diff=... — tells reviewdog which diff to filter against

Common use cases

GoalCommand
Check emulator-feature changes before pushingcargo xtask clippy --features emulator --github-report --diff-branch master
Check telemetry-related changescargo xtask clippy --features "emulator + profiling + test + tracing" --github-report --diff-branch master
See raw (unfiltered) clippy output for one feature setcargo xtask clippy --features emulator
Run the full matrix (slow — CI only)cargo xtask clippy --github-report --diff-branch master (omits --features)

Fixing warnings

When resolving Clippy warnings introduced by a change:

  • Never add #[allow(...)] — fix the root cause.
  • Change only what Clippy flags — do not refactor unrelated code.
  • field_reassign_with_default: when converting let mut s = S::default(); s.field = val; to a struct literal, keep let mut if the variable is mutated again later in the same scope, and ensure all subsequent mutations are preserved — do not drop them.

After fixes, re-run the filtered clippy command above, then complete the verification sequence in AGENTS.md (fmt → clippy → tests with --features emulator → build-kobo).

Troubleshooting

"reviewdog not found"

  • Using devenv: reviewdog is already provided by the devenv shell. Ensure you are inside the shell (direnv allow or devenv shell).
  • Not using devenv: Install reviewdog yourself. The simplest way is via Homebrew (brew install reviewdog) or by downloading the binary from https://github.com/reviewdog/reviewdog/releases. If you are unsure how to install it on your platform, ask the operator for help.

"diff-branch: no merge base"

Your branch may be old. Rebase or merge master first:

git fetch origin master
git rebase origin/master

Too much noise from unrelated files

You probably forgot --diff-branch. Without it, xtask falls back to the github-pr-review reporter which tries to fetch the PR diff from GitHub and will fail locally.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Build Cadmus on Linux and macOS hosts using xtask. Use when asked how to compile, test, lint, or run the project locally.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 20일 업데이트

Build, test, and lint Cadmus from a jj sibling workspace that has no .git (non-colocated checkout). Use when jj workspace root is a sibling tmp/agent workspace and builds fail with git submodule or .gitmodules errors, empty thirdparty/ sources, cache-marker misses, or missing sqlite.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 20일 업데이트

Cross-compile Cadmus for Kobo e-reader devices (ARM Linux). Use this when asked to build a Kobo release, cross-compile for ARM, or prepare a device binary.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 20일 업데이트

Resolve failed Renovate or Dependabot dependency update PRs by fixing version constraints, API breaking changes, and verifying build/test/format compliance. Use when a dependency bump PR fails CI, Cargo cannot select versions, or a crate update requires code migration.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 20일 업데이트

docs

무료

Build the full Cadmus documentation website (mdBook + cargo doc + Storybook + Next.js). Use this when asked to build, preview, or update the documentation site.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 20일 업데이트

Fetch Cadmus application logs from Loki by run ID. Use when asked to look up logs for a specific run, debug a device session, or find log output for a given run ID.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 20일 업데이트

OGKevin의 스킬 모두 보기

이 스킬의 문제 신고