Skip to content

Commit

Permalink
diktatFix
Browse files Browse the repository at this point in the history
  • Loading branch information
nulls committed Nov 15, 2023
1 parent db810e8 commit 60861fe
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@ fun <T> Any.closureOf(action: T.() -> Unit): Closure<Any?> =
KotlinClosure1(action, this, this)

/**
* @param diktatExtension
* @return returns sourceRootDir as projectDir for sarif report
*/
fun Project.getSourceRootDir(diktatExtension: DiktatExtension): Path? = when {
diktatExtension.githubActions -> projectDir.toPath()
diktatExtension.reporter == "sarif" -> projectDir.toPath()
else -> null
}

/**
* Create CLI flag to set reporter for ktlint based on [diktatExtension].
* [DiktatExtension.githubActions] should have higher priority than a custom input.
Expand Down

0 comments on commit 60861fe

Please sign in to comment.