chore(quality): make knip gate baseline-aware - #119
Merged
Merged
Conversation
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.
Summary
Makes the existing Knip dead-code check baseline-aware.
The repository currently has zero Knip findings and the committed baseline
contains zero finding records. The baseline mechanism remains available for
explicitly reviewed future exceptions without allowing new findings to pass
silently.
The parser fails closed on unknown Knip section headings, malformed normalized
baseline/finding records, missing baselines, and inconsistent Knip results.
Behavior
finding identity
Current expected output:
Dead-Code Check new: 0, baseline: 0, resolved: 0Gate-only regression mode
Focused regression testing can execute the production Knip gate via:
./run-tests.sh --knip-gate-onlyThis mode exists only for focused gate regression tests. Normal
./run-tests.shexecution and the pre-push hook continue to execute the fullpipeline.
The regression tests invoke the same production gate with a temporary
npxstub; there is no second parser or gate implementation.
Regression coverage
Verified cases include:
Verification
npx knip— 0 findingsbash -n run-tests.sh— passedgit diff --check— passednpm run check— passednpm run check:docs— passednpm run test:tutor-quality— 216 passednpm run test:unit— 2477 passed / 1 skipped./run-tests.sh— passednew: 0, baseline: 0, resolved: 0Scope
Exactly three files are changed:
run-tests.shquality/knip-baseline.txttests/scripts/knip-baseline-gate.test.mjsNo Tutor, Stage-2B, provider, or Sonar-rule changes.