Immutable registry keys with Literal types (v0.8.3) - #90
Merged
Conversation
Changed all 5 query classes to use Literal types for their name field: - DeadCodeQuery: Literal["find-dead-code"] - ModuleCentralityQuery: Literal["analyze-module-centrality"] - CriticalFunctionsQuery: Literal["find-critical-functions"] - CallComplexityQuery: Literal["analyze-call-complexity"] - CircularDependenciesQuery: Literal["detect-circular-dependencies"] Benefits: - Type checker enforces exact string values - IDE autocomplete shows valid query names - Prevents accidental name modifications at runtime - Better registry integrity (names are keys) All 27 query tests passing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed all 3 quality rule classes to use Literal types for their name field: - TypeCoverageRule: Literal["type-coverage"] - DocstringCoverageRule: Literal["docstring-coverage"] - ParamComplexityRule: Literal["param-complexity"] Benefits: - Type checker enforces exact string values - IDE autocomplete shows valid rule names - Prevents accidental name modifications at runtime - Better registry integrity (names are keys) - Consistent with query system All 85 quality tests passing. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
ydkadri
approved these changes
May 1, 2026
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
Refactors query and quality rule names to use
Literaltypes instead ofstrfor improved type safety and immutability.Closes #86
Changes
Literal["exact-name"]type annotationfind-dead-code,analyze-module-centrality,find-critical-functions,analyze-call-complexity,detect-circular-dependenciesLiteral["exact-name"]type annotationtype-coverage,docstring-coverage,param-complexityBenefits
Testing
Commits
🤖 Generated with Claude Code