Closed os97673 closed 6 months ago
I think the "problem" is in the way "treat as error" handled (https://github.com/detekt/detekt-intellij-plugin/blob/e808894ee69bc746446b353fb138a84caf6b9281/src/main/kotlin/io/gitlab/arturbosch/detekt/idea/DetektAnnotator.kt#L60C32-L60C54) I think instead of
val severity = if (settings.treatAsErrors) HighlightSeverity.ERROR else HighlightSeverity.WARNING
it should be something like
val severity = if (settings.treatAsErrors) HighlightSeverity.ERROR else convertSeverity(finding.severity)
Or, at least, do this for the case when user specified a custom detekt config. Of course if it is ok to make such "backward incompatible" change.
Would you be open for such PR?
I have
in my detekt.yml and when I run detekt it reports problem in the code as error but in the editor (Android Studio Hedgehog | 2023.1.1 Patch 1) the problem is shown as a warning :-(
The detekt plugin (2.3.0) is configured to use the config, but it looks like it overrides severity with "treat detekt findings as errors" (which is not checked by my because I don't want ALL findings from the config to be reported as error) Is this expected behavior or is this a bug?