Skip to content

Commit 1c90009

Browse files
authored
Merge pull request #170 from scala-steward/update/scalafmt-core-3.0.7
2 parents de417ab + 0e5c144 commit 1c90009

File tree

42 files changed

+111
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+111
-156
lines changed

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = 2.7.5
1+
version = 3.0.7
22

33
preset = default
44
docstrings.style = Asterisk

build.sbt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ ThisBuild / version := {
99
ThisBuild / scalaVersion := "2.12.15"
1010
ThisBuild / licenses += (("Eclipse Public License v1.0", url("http://www.eclipse.org/legal/epl-v10.html")))
1111

12-
1312
lazy val jacocoPlugin = (project in file("."))
1413
.enablePlugins(SbtPlugin)
1514
.enablePlugins(BuildInfoPlugin)
@@ -19,15 +18,15 @@ lazy val jacocoPlugin = (project in file("."))
1918
name := "sbt-jacoco"
2019

2120
libraryDependencies ++= Seq(
22-
"org.jacoco" % "org.jacoco.core" % jacocoVersion,
23-
"org.jacoco" % "org.jacoco.report" % jacocoVersion,
24-
"com.jsuereth" %% "scala-arm" % "2.0",
25-
"com.fasterxml.jackson.core" % "jackson-core" % "2.13.0",
26-
"org.scalaj" %% "scalaj-http" % "2.4.2",
27-
"commons-codec" % "commons-codec" % "1.15",
28-
"org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.0.202109080827-r",
29-
"org.scalatest" %% "scalatest" % "3.2.10" % Test,
30-
"org.mockito" % "mockito-core" % "4.0.0" % Test
21+
"org.jacoco" % "org.jacoco.core" % jacocoVersion,
22+
"org.jacoco" % "org.jacoco.report" % jacocoVersion,
23+
"com.jsuereth" %% "scala-arm" % "2.0",
24+
"com.fasterxml.jackson.core" % "jackson-core" % "2.13.0",
25+
"org.scalaj" %% "scalaj-http" % "2.4.2",
26+
"commons-codec" % "commons-codec" % "1.15",
27+
"org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.0.202109080827-r",
28+
"org.scalatest" %% "scalatest" % "3.2.10" % Test,
29+
"org.mockito" % "mockito-core" % "4.0.0" % Test
3130
)
3231

3332
scalacOptions ++= Seq(
@@ -36,7 +35,8 @@ lazy val jacocoPlugin = (project in file("."))
3635
"-feature",
3736
"-Xfuture",
3837
"-Ywarn-adapted-args",
39-
"-Ywarn-dead-code")
38+
"-Ywarn-dead-code"
39+
)
4040

4141
buildInfoPackage := "com.github.sbt.jacoco.build"
4242
buildInfoKeys := Seq[BuildInfoKey](
@@ -49,8 +49,9 @@ lazy val jacocoPlugin = (project in file("."))
4949
Paradox / paradoxNavigationDepth := 3
5050
git.remoteRepo := "[email protected]:sbt/sbt-jacoco.git"
5151

52-
headerLicense := Some(HeaderLicense.Custom(
53-
"""|This file is part of sbt-jacoco.
52+
headerLicense := Some(
53+
HeaderLicense.Custom(
54+
"""|This file is part of sbt-jacoco.
5455
|
5556
|Copyright (c) Joachim Hofer & contributors
5657
|All rights reserved.
@@ -60,5 +61,6 @@ lazy val jacocoPlugin = (project in file("."))
6061
|which accompanies this distribution, and is available at
6162
|http://www.eclipse.org/legal/epl-v10.html
6263
|""".stripMargin
63-
))
64+
)
65+
)
6466
})

scripted.sbt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
scriptedLaunchOpts := { scriptedLaunchOpts.value ++
2-
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
1+
scriptedLaunchOpts := {
2+
scriptedLaunchOpts.value ++
3+
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
34
}
45

56
scriptedBufferLog := false

src/main/scala/com/github/sbt/jacoco/filter/FilteringClassAnalyzer.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@ import scala.collection.mutable
2929

3030
/**
3131
* Filters coverage results from Scala synthetic methods:
32-
* - trait forwarders
33-
* - case class toString / equals / apply / unapply
32+
* - trait forwarders
33+
* - case class toString / equals / apply / unapply
3434
*
35-
* These are identified by the heuristic that they have the same line number as a constructor, or
36-
* the same line as other one-line methods if we are in a module class.
35+
* These are identified by the heuristic that they have the same line number as a constructor, or the same line as other
36+
* one-line methods if we are in a module class.
3737
*
38-
* This filtering should really happen in Jacoco core, but the API for this is not available and
39-
* scheduled for Q1 2014.
38+
* This filtering should really happen in Jacoco core, but the API for this is not available and scheduled for Q1 2014.
4039
*
4140
* See [[https://github.com/jacoco/jacoco/wiki/FilteringOptions]] and [[https://github.com/jacoco/jacoco/issues/139]]
4241
* for more discussion of the JaCoCo roadmap.
4342
*
44-
* These filters are based on [[https://github.com/timezra/jacoco/commit/b6146ebed8b8e7507ec634ee565fe03f3e940fdd]],
45-
* but extended to correctly exclude synthetics in module classes.
43+
* These filters are based on [[https://github.com/timezra/jacoco/commit/b6146ebed8b8e7507ec634ee565fe03f3e940fdd]], but
44+
* extended to correctly exclude synthetics in module classes.
4645
*/
4746
private final class FilteringClassAnalyzer(
4847
classCoverage: ClassCoverageImpl,

src/main/scala/com/github/sbt/jacoco/filter/ScalaForwarderDetector.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ import scala.collection.JavaConverters._
1919

2020
/**
2121
* Detects forwarder methods added by Scala
22-
* - classes and objects that mix in traits have a forwarder to the method body
23-
* in the trait implementation class
24-
* - classes contains static forwarders to methods in the companion object (for convenient Java interop)
25-
* - methods in (boxed) value classes forward to the method body in the companion object
26-
* - implicit classes creates a factory method beside the class.
27-
* - lazy vals have an accessor that forwards to `\$lzycompute`, which is the method
28-
* with the interesting code.
22+
* - classes and objects that mix in traits have a forwarder to the method body in the trait implementation class
23+
* - classes contains static forwarders to methods in the companion object (for convenient Java interop)
24+
* - methods in (boxed) value classes forward to the method body in the companion object
25+
* - implicit classes creates a factory method beside the class.
26+
* - lazy vals have an accessor that forwards to `\$lzycompute`, which is the method with the interesting code.
2927
*/
3028
object ScalaForwarderDetector {
3129
val LazyComputeSuffix: String = "$lzycompute"

src/main/scala/com/github/sbt/jacoco/report/formats/ScalaHTMLReportFormat.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class ScalaHTMLReportFormat(withBranchCoverage: Boolean = true) extends JacocoRe
3434
}
3535

3636
/**
37-
* Omits displaying instruction and branch coverage in the coverage tables,
38-
* as Scala generates null checks which make these too noisy.
37+
* Omits displaying instruction and branch coverage in the coverage tables, as Scala generates null checks which make
38+
* these too noisy.
3939
*
4040
* TODO: Find a way to remove them from the annotated source code reports, too.
4141
*/

src/sbt-test/sbt-jacoco/csv-report/project/plugins.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
if (pluginVersion == null)
44
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
55
|Specify this property using the parameter -Dplugin.version=<version>""".stripMargin)
6-
76
else addSbtPlugin("com.github.sbt" % "sbt-jacoco" % pluginVersion)
87
}
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package jacocotest
22

3-
case class TestClass( val x : Int )
4-
{
5-
def double() : Int = x * 2
6-
7-
def triple() : Int = x * 3
8-
}
3+
case class TestClass(val x: Int) {
4+
def double(): Int = x * 2
5+
6+
def triple(): Int = x * 3
7+
}

src/sbt-test/sbt-jacoco/csv-report/src/test/scala/jacocotest/TestClassTests.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ package jacocotest
22

33
import org.scalatest.flatspec._
44

5-
class TestClassTests extends AnyFlatSpec
6-
{
7-
"TestClass" should "double a number correctly" in
8-
{
9-
assert( new TestClass( 2 ).double === 4 )
10-
}
5+
class TestClassTests extends AnyFlatSpec {
6+
"TestClass" should "double a number correctly" in {
7+
assert(new TestClass(2).double === 4)
8+
}
119
}

src/sbt-test/sbt-jacoco/forked-integration/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ scalaVersion := "2.12.15"
66
enablePlugins(JacocoItPlugin)
77

88
Test / fork := true
9-
IntegrationTest / fork := true
9+
IntegrationTest / fork := true

0 commit comments

Comments
 (0)