Skip to content

Commit

Permalink
diktat fixes
Browse files Browse the repository at this point in the history
### What's done:
- Fixing diktat issues
  • Loading branch information
orchestr7 committed Jan 26, 2022
1 parent a5341b6 commit 5aea2cb
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package org.cqfn.diktat.plugin.maven

import org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider

import com.pinterest.ktlint.core.KtLint
import com.pinterest.ktlint.core.LintError
import com.pinterest.ktlint.core.Reporter
import com.pinterest.ktlint.core.RuleExecutionException
import com.pinterest.ktlint.core.RuleSet
import com.pinterest.ktlint.core.Reporter
import com.pinterest.ktlint.reporter.html.HtmlReporter
import com.pinterest.ktlint.reporter.json.JsonReporter
import com.pinterest.ktlint.reporter.plain.PlainReporter
Expand All @@ -14,12 +16,11 @@ import org.apache.maven.plugin.MojoExecutionException
import org.apache.maven.plugin.MojoFailureException
import org.apache.maven.plugins.annotations.Parameter
import org.apache.maven.project.MavenProject
import org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider

import java.io.File
import java.io.FileOutputStream
import java.io.PrintStream


/**
* Base [Mojo] for checking and fixing code using diktat
*/
Expand All @@ -42,7 +43,6 @@ abstract class DiktatBaseMojo : AbstractMojo() {
*/
@Parameter(property = "diktat.output")
var output = ""

private lateinit var reporterImpl: Reporter

/**
Expand Down Expand Up @@ -109,7 +109,7 @@ abstract class DiktatBaseMojo : AbstractMojo() {

private fun resolveReporter(): Reporter {
val output = if (this.output.isBlank()) System.`out` else PrintStream(FileOutputStream(this.output, true))
return when(this.reporter) {
return when (this.reporter) {
"sarif" -> SarifReporter(output)
"plain" -> PlainReporter(output)
"json" -> JsonReporter(output)
Expand Down

0 comments on commit 5aea2cb

Please sign in to comment.