com.sksamuel.scapegoat.io.ScalastyleReportWriter.scala Maven / Gradle / Ivy
package com.sksamuel.scapegoat.io
import scala.xml.Node
import com.sksamuel.scapegoat.{Feedback, Warning}
object ScalastyleReportWriter extends ReportWriter {
private val checkstyleVersion = "5.0"
private val scapegoat = "scapegoat"
override protected val fileName = "scapegoat-scalastyle.xml"
private def toXML(feedback: Feedback): Node =
{feedback.warningsWithMinimalLevel.groupBy(_.sourceFileFull).map(fileToXml)}
private def fileToXml(fileWarningMapEntry: (String, Seq[Warning])): Node = {
val (file, warnings) = fileWarningMapEntry
{warnings.map(warningToXml)}
}
private def warningToXml(warning: Warning) =
override protected def generate(feedback: Feedback): String = toXML(feedback).toString()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy