detekt/detekt-intellij-plugin

IntelliJ IDEA Plugin: Add Suppression action

Offen

#143 geöffnet am 08.10.2021

 (1 Kommentar) (8 Reaktionen) (0 zugewiesene Personen)Kotlin (38 Forks)auto 404
featurehelp wanted

Repository-Metriken

Stars
 (318 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Expected Behavior

Option in Alt+Enter to add @Suppress("RuleName") to the finding's entity.

Current Behavior

No actions on violations. image

Context

There are some cases when we just need to suppress a warning, because we deem the code is fine as is. In these cases the process is:

  • Looking at the HTML report on CI open the file in IDE
  • See the same Detekt violations show up
  • Find the name of the violation from either the report or the tooltip.
  • Edit the code to add @Suppress("RuleName") manually, this might involve typing the rule name.

I'm sure you all know how easy it is to suppress IDEA inspections. Alt-Enter, Right, Enter

image

Similarly the plugin could open the detekt.yml configuration file for editing at the minimum. The 5* experience would be to automatically add/edit the group: Rule: active: false when suppressing in whole project, but opening the file would be a good start.

Contributor Guide