-
Notifications
You must be signed in to change notification settings - Fork 111
feat(splinter): allow ignoring db objects #634
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
Conversation
crates/pgls_splinter/src/lib.rs
Outdated
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Apply per-rule object filtering if rules config is provided |
crates/pgls_splinter/src/lib.rs
Outdated
| // 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Look up pre-built matcher for this rule |
crates/pgls_splinter/src/lib.rs
Outdated
|
|
||
| // Look up pre-built matcher for this rule | ||
| if let Some(matcher) = rule_matchers.get(rule_name) { | ||
| // Build object identifier from schema and name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Build object identifier from schema and name |
crates/pgls_splinter/src/lib.rs
Outdated
| { | ||
| let object_identifier = format!("{schema}.{name}"); | ||
|
|
||
| // If the object matches an ignore pattern, filter it out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // If the object matches an ignore pattern, filter it out |
adds an
ignoresconfig option to allsplinterrules.the filter is applied in rust and not part of the query for more flexibility.
also: moved
matcherinto its own crate to allowsplinterto reuse it