-
Notifications
You must be signed in to change notification settings - Fork 109
chore(splinter): integrate into docs codegen #621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
psteinroe
merged 7 commits into
chore/integrate-splinter-runtime
from
chore/integrate-splinter-docs-codegen
Dec 16, 2025
Merged
chore(splinter): integrate into docs codegen #621
psteinroe
merged 7 commits into
chore/integrate-splinter-runtime
from
chore/integrate-splinter-docs-codegen
Dec 16, 2025
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
9612b64 to
9f4643c
Compare
2b05d65 to
8cff804
Compare
9f4643c to
75f57f2
Compare
8cff804 to
ee9755d
Compare
75f57f2 to
c9e5c4d
Compare
ee9755d to
6997db0
Compare
c9e5c4d to
6d06773
Compare
6997db0 to
2162888
Compare
a61dce9 to
13afe90
Compare
2162888 to
e86fa47
Compare
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Instead of re-parsing SQL comment metadata in docs codegen, expose structured metadata directly through the registry API. Changes: - Add SplinterRuleMetadata struct (description, remediation, requires_supabase) - Add get_rule_metadata() function to registry - Update docs codegen to use structured metadata - Remove duplicate SQL parsing logic - Update runtime to use new metadata API - Deprecate rule_requires_supabase() in favor of get_rule_metadata() This eliminates redundant parsing and provides a cleaner API. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Changed the architecture to make metadata accessible as trait constants instead of requiring registry lookups or SQL parsing: - Updated `SplinterRule` trait to include four associated constants: - `SQL_FILE_PATH`: Path to SQL file (changed from function to const) - `DESCRIPTION`: What the rule detects - `REMEDIATION`: URL to documentation - `REQUIRES_SUPABASE`: Whether rule needs Supabase roles - Updated codegen to generate these constants in each rule's impl block - Updated registry to provide metadata via qualified trait syntax: - `get_rule_metadata_fields()`: Returns tuple by calling trait constants - `get_rule_metadata()`: Returns struct by delegating to above - Updated docs codegen to use `get_rule_metadata_fields()` from registry Benefits: - Type-safe: Metadata defined with the rule type - No runtime string parsing - Single source of truth (SQL metadata comments) - Clean API: Registry provides runtime lookups via trait constants 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The combined SQL files (splinter.sql, splinter_generic.sql, splinter_supabase.sql) are no longer used by the runtime. The new system reads individual SQL files from vendor/performance/ and vendor/security/ directories. Changes: - Remove obsolete combined SQL files - Remove build.rs that generated the combined files - Remove ureq build dependency The individual rule SQL files in vendor/ subdirectories are maintained manually and embedded at compile time via include_str! in the registry.
juleswritescode
approved these changes
Dec 16, 2025
Removed confusing type aliases that created two names for the same types:
- Rule → LinterRule
- RuleContext → LinterRuleContext
- RuleDiagnostic → LinterDiagnostic
Updated all 34 rule files and the codegen template to use the full type names
for better clarity and consistency. The aliases made the API confusing by having
two names for the same type (e.g., "is RuleDiagnostic different from
LinterDiagnostic?").
All rule implementations now consistently use:
- use crate::{LinterRule, LinterRuleContext, LinterDiagnostic};
- impl LinterRule for RuleName { ... }
022ad92 to
08d9b38
Compare
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.
wires up splinter with the docs codegen. we collect the metadata using
RuleVisitorand print them out to markdown. This is the same approach we use with the rules fromanalyser(to be renamed tolinter). Added the additional metadata toSplinterRule.