Skip to content

Conversation

@academo
Copy link
Collaborator

@academo academo commented Jan 28, 2026

Closes #457

This PR allows to configure exceptions for specific rules for specific plugins id

This feature is a complement to the existing exceptions at a validator level but with better granularity

e.g. you want the coderules analyzer to run but only ignore specific rules for your plugin

ResultOf: make(map[*analysis.Analyzer]any),
}

pass.Report = func(ruleName string, d analysis.Diagnostic) {
Copy link
Collaborator Author

@academo academo Jan 28, 2026

Choose a reason for hiding this comment

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

I moved this outside to have access to pass in the closure.

@academo academo self-assigned this Jan 28, 2026
@academo academo moved this from 📬 Triage to 🔬 In review in Plugins Platform / Grafana Community Jan 28, 2026
Copy link
Member

@xnyo xnyo left a comment

Choose a reason for hiding this comment

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

One small comment. LGTM!

Comment on lines 65 to 66
for _, exceptedPluginID := range ruleConfig.Exceptions {
if exceptedPluginID == pluginId {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can probably use slices.Contains here: https://pkg.go.dev/slices#Contains

@academo academo merged commit ff41622 into main Jan 28, 2026
7 checks passed
@academo academo deleted the academo/rule-level-exceptions branch January 28, 2026 10:56
@github-project-automation github-project-automation bot moved this from 🔬 In review to 🚀 Shipped in Plugins Platform / Grafana Community Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚀 Shipped

Development

Successfully merging this pull request may close these issues.

It should be possible to add exceptions at rule level too

2 participants