Repository navigation
feat(checker): add complexity-hints, a checker scoped to the change - #57
Merged
Merged
Conversation
Runs the project's Oxlint on the files changed since the merge base with the default branch, and reports only the cognitive-complexity and max-params diagnostics the change is responsible for: a function blocks when the change touches both it and its fix's target, and is a note when it touches only the function. --strict blocks on both. Closes #44 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.
Closes #44
Summary
Adds a
complexity-hintsbin that runs the project's own Oxlint on a change and reports only what the change is responsible for, so an agent (or a pre-commit/CI gate) isn't asked to fix complexity it didn't touch. ADR-0006 records why; the behavior is indocs/specs/scoped-checker.mdand the implementation indocs/designs/scoped-checker.md.origin/HEAD, else localmain/master, or--base <ref>) and the working tree, plus untracked files whole. With no base it exits 2 rather than checking less.cognitive-complexity: blocks when the change touches the function's own lines and the fix's target; a note when it touches only the function; nothing when it touches neither.--strictblocks on any touched function. The fallback fix targets the whole function.max-paramsblocks when the parameter list changed. Other rules are left to the project's own lint.Changes
+++ xisn't taken for a header.vpis preferred over a plainoxlintand runs asvp lint, since only it readsvite.config.ts. A plainoxlintruns withoutVP_VERSION, which otherwise makes it skip.oxlintrc.jsonand lint with no rules.vp pack(exports.bin), and the package checks coverdist/checker/cli.*and run--helpon the built bin.Verification
vp run ready: format, lint, typecheck and 100 tests pass.tests/checker.test.ts(35 tests) runs the CLI against throwaway git repositories: block/note/--strict, untracked files, commits and--base,origin/HEAD, deletions, renames, nested functions,max-paramsacross lines with non-ASCII text,warnseverity,.vuepositions, path and directory arguments, deleted/ignored/unlinted files, hostile git config, a header-like added line, a quoted path, and each setup error./refinerounds on the plan and one on the implementation; findings applied.Plan deviations
None. The Claude Code hook and the README guidance follow in the next PR (#45).