Plugin API follow-ons (thresholds, vocabulary) + per-rule config controls + suppress helper#167
Merged
Merged
Conversation
…s helper Completes the plugin API v1 surface and adds per-rule tuning: - Plugins can export a thresholds map merged after built-in defaults and before user config / --threshold (#73); the examples/plugin reference plugin now demonstrates getThreshold with a plugin-provided default. - Plugin vocabulary exports merge into naming-drift concept group resolution below user config groups, replacing the previous ignored-with-warning behavior (#74). Cross-plugin collisions on a threshold key or concept id warn, later plugin wins. - New ruleSeverities config map replaces the severity a rule reports; unknown rule ids warn with a did-you-mean suggestion, invalid severity values fail fast at config merge (#107). - New ruleConfidenceFloors config map hides findings below a per-rule confidence floor, tracked as filterStats.filteredByConfidenceFloor (#108). - New debtlens suppress command prints a copy-paste inline suppression directive (--rule, --reason, optional --file) validated against the rule registry (#146). Schema regenerated; README, plugin RFC, and CHANGELOG updated. Co-Authored-By: Claude Fable 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.
Summary
Completes the v1 plugin API surface (the two follow-ons called out in
docs/plugin-api-rfc.mdafter #166) and adds per-rule config tuning plus a small DX helper.Closes #73, closes #74, closes #107, closes #108, closes #146.
Plugin API follow-ons
thresholds; they merge after built-in defaults so user configthresholdsand--thresholdstill override. Theexamples/plugin/reference plugin now readscontext.getThreshold("no-console.maxCalls", 0)with a plugin-provided default, and non-numeric values fail fast at load.vocabularyexport (previously accepted-but-ignored with a warning) now merges into naming-drift concept group resolution below user config groups, so config groups with the same id still win. Malformed groups fail fast; when two plugins set the same threshold key or concept id, the later plugin wins with a warning.Per-rule config controls
ruleSeverities(Per-rule severity overrides in config #107): rule id → severity map replacing the severity a rule reports, changing summary counts and--fail-onbehavior. Unknown rule ids warn with a did-you-mean suggestion (plugin rule ids are recognized); invalid severity values fail fast at config merge.ruleConfidenceFloors(Per-rule confidence floors in config #108): rule id → minimum confidence (0–1); findings below the floor are hidden and counted undersummary.filterStats.filteredByConfidenceFloor. Same unknown-id warning and fail-fast range validation.DX
debtlens suppress(Add debtlens suppress snippet helper for findings #146): prints a copy-paste inline suppression directive —debtlens suppress --rule todo-comment --reason "tracked in PROJ-123", with--filefor file-level directives. Rule ids are validated against the registry with did-you-mean; a test feeds the generated snippet through a real scan to prove the scanner honors it.JSON schema regenerated (guarded by the drift test); README, plugin RFC (status, export shape, open questions), and CHANGELOG updated.
Test plan
npm test: 222/222 passing (baseline before this branch: 202).npm run typecheckandnpm run typecheck:tests: clean.npm run build: clean;npm run schema:generateoutput committed.debtlens suppress(next-line, unknown-rule suggestion) anddebtlens scan . --cwd examples/plugin --rules no-console(plugin threshold default of 0 still flags the fixture's single console.log).🤖 Generated with Claude Code