Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

NPE during sonarqube run #160

Closed
5V715 opened this issue Sep 30, 2022 · 1 comment
Closed

NPE during sonarqube run #160

5V715 opened this issue Sep 30, 2022 · 1 comment

Comments

@5V715
Copy link

5V715 commented Sep 30, 2022

How can i disable to whole formatting RuleSet that is somehow pulled in. i cannot configure it in sonarqube itself.
i'd like to remove all ktlint related things (FormattingRules) since it's handled elsewhere. In one of our projects running ktlint from detekt fails.

Analyzing XYZ.kt led to an exception. 
  The original exception message was: null
  Running detekt '1.19.0' on Java '11.0.16.1+1' on OS 'Linux'
  If the exception message does not help, please feel free to create an issue on our GitHub page.
at io.gitlab.arturbosch.detekt.core.AnalyzerKt.throwIllegalStateException(Analyzer.kt:162)
	at io.gitlab.arturbosch.detekt.core.AnalyzerKt.access$throwIllegalStateException(Analyzer.kt:1)
	at io.gitlab.arturbosch.detekt.core.Analyzer.runSync(Analyzer.kt:70)
	at io.gitlab.arturbosch.detekt.core.Analyzer.run(Analyzer.kt:52)
	at io.gitlab.arturbosch.detekt.core.tooling.Lifecycle$analyze$result$1.invoke(Lifecycle.kt:45)
	at io.gitlab.arturbosch.detekt.core.tooling.Lifecycle$analyze$result$1.invoke(Lifecycle.kt:42)
	at io.gitlab.arturbosch.detekt.core.util.PerformanceMonitor.measure(PerformanceMonitor.kt:42)
	at io.gitlab.arturbosch.detekt.core.tooling.Lifecycle$DefaultImpls.measure(Lifecycle.kt:32)
	at io.gitlab.arturbosch.detekt.core.tooling.Lifecycle$DefaultImpls.analyze(Lifecycle.kt:42)
	at io.gitlab.arturbosch.detekt.core.tooling.DefaultLifecycle.analyze(Lifecycle.kt:59)

with

Caused by: kotlin.KotlinNullPointerException
	at com.pinterest.ktlint.ruleset.standard.IndentationRule.rearrangeBlock(IndentationRule.kt:202)
	at com.pinterest.ktlint.ruleset.standard.IndentationRule.access$rearrangeBlock(IndentationRule.kt:103)
	at com.pinterest.ktlint.ruleset.standard.IndentationRule$rearrange$1.invoke(IndentationRule.kt:172)
	at com.pinterest.ktlint.ruleset.standard.IndentationRule$rearrange$1.invoke(IndentationRule.kt:170)
	at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:225)
	at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:226)
	at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:226)
@arturbosch
Copy link
Member

Duplicate of #161

@arturbosch arturbosch marked this as a duplicate of #161 Aug 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants