feat(cli): scope check, JSON for lint/verify, lint granularity warnings#24
Merged
Conversation
Implements issues #1, #2, and #6 — no version bump / release. #1 check scoping: --files <globs> and diff-scoping via an explicit --base (merge-base..working-tree). Omitting --base keeps a full check with HEAD enrichment; a bad ref / non-repo falls back to full check. #2 --format json for lint and verify, mirroring check. Extracts the shared Format enum into format.rs; lint findings serialize directly; verify gains a structured VerifyReport while keeping its file-stamping side effects. #6 advisory lint granularity warnings (never block, §8): near-whole-file anchor spans, hubs with too many anchors, and public functions in an anchored file that no claim covers. Adds surf_core::public_fns (top-level public functions only — pub(crate) and data types excluded to avoid over-anchoring noise). Hubs updated to document the new behavior and re-sealed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements issues #1, #2, and #6. No version bump / release.
#1 —
checkscoping (closes #1)--files <globs>evaluates only claims whose anchored file(s) match.--base <ref>diff-scopes to claims whose files changed (merge-base..working-tree) and drives advisory enrichment.--basekeeps a full check withHEADenrichment; a bad ref / non-repo falls back to a full check rather than checking nothing.#2 —
--format jsonforlintandverify(closes #2)Formatenum extracted intoformat.rs.lintfindings serialize directly;verifygains a structuredVerifyReport(stamped/followed/unchanged/skipped + counts) while preserving its file-stamping side effects.#6 — lint granularity warnings, advisory/never-blocking (§8) (closes #6)
surf_core::public_fns— top-level public functions only (pub(crate)and data types excluded to avoid over-anchoring noise). On this repo it surfaces 10 genuinely undocumented public functions; warnings only, exit 0.Dogfooding
Hubs updated to document the new behavior and re-sealed;
surf checkis green,surf lintexits 0 (warnings only).Verification
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings, and the full test suite all pass (9 new tests).🤖 Generated with Claude Code