Skip to content

Conversation

@psteinroe
Copy link
Collaborator

adds an ignores config option to all splinter rules.

the filter is applied in rust and not part of the query for more flexibility.

also: moved matcher into its own crate to allow splinter to reuse it

let diagnostics: Vec<SplinterDiagnostic> = results.into_iter().map(Into::into).collect();
let mut diagnostics: Vec<SplinterDiagnostic> = results.into_iter().map(Into::into).collect();

// Apply per-rule object filtering if rules config is provided
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Apply per-rule object filtering if rules config is provided

// Extract rule name from category (e.g., "splinter/performance/noPrimaryKey" -> "noPrimaryKey")
let rule_name = diag.category.name().split('/').next_back().unwrap_or("");

// Look up pre-built matcher for this rule
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Look up pre-built matcher for this rule


// Look up pre-built matcher for this rule
if let Some(matcher) = rule_matchers.get(rule_name) {
// Build object identifier from schema and name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Build object identifier from schema and name

{
let object_identifier = format!("{schema}.{name}");

// If the object matches an ignore pattern, filter it out
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// If the object matches an ignore pattern, filter it out

@psteinroe psteinroe merged commit d04cbc9 into main Jan 2, 2026
8 checks passed
@psteinroe psteinroe deleted the feat/db-object-filter branch January 2, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants