Skip to content

Commit

Permalink
disable Checkstyle and JaCoCo; fix html5 compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
ennru committed Jan 27, 2022
1 parent c7643b6 commit 301d947
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 38 deletions.
70 changes: 36 additions & 34 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ lazy val root = (project in file("."))
doc := (configLib / Compile / doc).value
packageDoc / aggregate := false
packageDoc := (configLib / Compile / packageDoc).value
checkstyle / aggregate := false
checkstyle := (configLib / Compile / checkstyle).value
// checkstyle / aggregate := false
// checkstyle := (configLib / Compile / checkstyle).value
PgpKeys.publishSigned / aggregate := false
PgpKeys.publishSigned := (configLib / PgpKeys.publishSigned).value
PgpKeys.publishLocalSigned / aggregate := false
Expand Down Expand Up @@ -105,40 +105,42 @@ lazy val configLib = Project("config", file("config"))
.setPreference(IndentSpaces, 4)
.setPreference(FirstArgumentOnNewline, Preserve)

checkstyleConfigLocation := CheckstyleConfigLocation.File((baseDirectory.value / "checkstyle-config.xml").toString)

Compile / checkstyle := {
val log = streams.value.log
(Compile / checkstyle).value
val resultFile = (Compile / checkstyleOutputFile).value
val results = scala.xml.XML.loadFile(resultFile)
val errorFiles = results \\ "checkstyle" \\ "file"

def errorFromXml(node: scala.xml.NodeSeq): (String, String, String) = {
val line: String = (node \ "@line" text)
val msg: String = (node \ "@message" text)
val source: String = (node \ "@source" text)
(line, msg, source)
}
def errorsFromXml(fileNode: scala.xml.NodeSeq): Seq[(String, String, String, String)] = {
val name: String = (fileNode \ "@name" text)
val errors = (fileNode \\ "error") map { e => errorFromXml(e) }
errors map { case (line, error, source) => (name, line, error, source) }
}

val errors = errorFiles flatMap { f => errorsFromXml(f) }

if (errors.nonEmpty) {
for (e <- errors) {
log.error(s"${e._1}:${e._2}: ${e._3} (from ${e._4})")
}
throw new RuntimeException(s"Checkstyle failed with ${errors.size} errors")
}
log.info("No errors from checkstyle")
}
// checkstyleConfigLocation := CheckstyleConfigLocation.File((baseDirectory.value / "checkstyle-config.xml").toString)

// Compile / checkstyle := {
// val log = streams.value.log
// (Compile / checkstyle).value
// val resultFile = (Compile / checkstyleOutputFile).value
// val results = scala.xml.XML.loadFile(resultFile)
// val errorFiles = results \\ "checkstyle" \\ "file"
//
// def errorFromXml(node: scala.xml.NodeSeq): (String, String, String) = {
// val line: String = (node \ "@line" text)
// val msg: String = (node \ "@message" text)
// val source: String = (node \ "@source" text)
// (line, msg, source)
// }
// def errorsFromXml(fileNode: scala.xml.NodeSeq): Seq[(String, String, String, String)] = {
// val name: String = (fileNode \ "@name" text)
// val errors = (fileNode \\ "error") map { e => errorFromXml(e) }
// errors map { case (line, error, source) => (name, line, error, source) }
// }
//
// val errors = errorFiles flatMap { f => errorsFromXml(f) }
//
// if (errors.nonEmpty) {
// for (e <- errors) {
// log.error(s"${e._1}:${e._2}: ${e._3} (from ${e._4})")
// }
// throw new RuntimeException(s"Checkstyle failed with ${errors.size} errors")
// }
// log.info("No errors from checkstyle")
// }

// add checkstyle as a dependency of doc
Compile / doc := ((Compile / doc).dependsOn(Compile / checkstyle)).value
Compile / doc := (Compile / doc)
// .dependsOn(Compile / checkstyle)
.value

findbugsReportType := Some(FindbugsReport.Html)
findbugsReportPath := Some(crossTarget.value / "findbugs.html")
Expand Down
5 changes: 3 additions & 2 deletions config/src/main/java/com/typesafe/config/ConfigFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,10 @@ public static Config systemProperties() {
* <p>
* Environment variables are mangled in the following way after stripping the prefix "CONFIG_FORCE_":
* <table border="1">
* <caption>Mangling of environment variables</caption>
* <tr>
* <th bgcolor="silver">Env Var</th>
* <th bgcolor="silver">Config</th>
* <th>Env Var</th>
* <th>Config</th>
* </tr>
* <tr>
* <td>_&nbsp;&nbsp;&nbsp;[1 underscore]</td>
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
addSbtPlugin("com.github.sbt" % "sbt-findbugs" % "2.0.0")
addSbtPlugin("com.github.sbt" % "sbt-jacoco" % "3.4.0")
//addSbtPlugin("com.github.sbt" % "sbt-jacoco" % "3.4.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.1.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.6")
addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.3")

addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % "3.1.1")
//addSbtPlugin("com.etsy" % "sbt-checkstyle-plugin" % "3.1.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.2")
addSbtPlugin("com.eed3si9n" % "sbt-nocomma" % "0.1.0")

0 comments on commit 301d947

Please sign in to comment.