Skip to content

Commit 6b916e6

Browse files
authored
Merge pull request #168 from gokhanoner/update/scalafmt-core-2.7.5
2 parents 21956d0 + 0b290a4 commit 6b916e6

File tree

6 files changed

+51
-48
lines changed

6 files changed

+51
-48
lines changed

.scalafmt.conf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
version = 2.3.2
2-
edition = 2019-10
1+
version = 2.7.5
32

4-
style = default
3+
preset = default
4+
docstrings.style = Asterisk
55
maxColumn = 120
66

77
align.openParenCallSite = false
88
align.openParenDefnSite = false
99

10-
# don't align arrows in match statements
11-
align.tokens = []
10+
align.preset = none

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ import scala.collection.JavaConverters._
2828
import scala.collection.mutable
2929

3030
/**
31-
* Filters coverage results from Scala synthetic methods:
32-
* - trait forwarders
33-
* - case class toString / equals / apply / unapply
34-
*
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.
37-
*
38-
* This filtering should really happen in Jacoco core, but the API for this is not available and
39-
* scheduled for Q1 2014.
40-
*
41-
* See [[https://github.com/jacoco/jacoco/wiki/FilteringOptions]] and [[https://github.com/jacoco/jacoco/issues/139]]
42-
* for more discussion of the JaCoCo roadmap.
43-
*
44-
* These filters are based on [[https://github.com/timezra/jacoco/commit/b6146ebed8b8e7507ec634ee565fe03f3e940fdd]],
45-
* but extended to correctly exclude synthetics in module classes.
46-
*/
31+
* Filters coverage results from Scala synthetic methods:
32+
* - trait forwarders
33+
* - case class toString / equals / apply / unapply
34+
*
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.
37+
*
38+
* This filtering should really happen in Jacoco core, but the API for this is not available and
39+
* scheduled for Q1 2014.
40+
*
41+
* See [[https://github.com/jacoco/jacoco/wiki/FilteringOptions]] and [[https://github.com/jacoco/jacoco/issues/139]]
42+
* for more discussion of the JaCoCo roadmap.
43+
*
44+
* These filters are based on [[https://github.com/timezra/jacoco/commit/b6146ebed8b8e7507ec634ee565fe03f3e940fdd]],
45+
* but extended to correctly exclude synthetics in module classes.
46+
*/
4747
private final class FilteringClassAnalyzer(
4848
classCoverage: ClassCoverageImpl,
4949
classNode: ClassNode,

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ import org.objectweb.asm.tree.{JumpInsnNode, MethodInsnNode, MethodNode}
1717

1818
import scala.collection.JavaConverters._
1919

20-
/** Detects forwarder methods added by Scala
21-
* - classes and objects that mix in traits have a forwarder to the method body
22-
* 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
27-
* with the interesting code.
28-
*/
20+
/**
21+
* 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.
29+
*/
2930
object ScalaForwarderDetector {
3031
val LazyComputeSuffix: String = "$lzycompute"
3132
def isScalaForwarder(className: String, node: MethodNode): Boolean = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object ScalaSyntheticMethod {
1818
val isOneLiner = firstLine == lastLine
1919
isOneLiner && (
2020
(isModuleClass && isSyntheticObjectMethodName(name))
21-
|| isSyntheticInstanceMethodName(name)
21+
|| isSyntheticInstanceMethodName(name)
2222
)
2323
}
2424

src/main/scala/com/github/sbt/jacoco/report/JacocoReportFormats.scala

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,24 @@ object JacocoReportFormats {
1919
/** HTML report containing detailed metrics at instruction level and embedded source code. */
2020
val ScalaHTML = new ScalaHTMLReportFormat()
2121

22-
/** HTML report containing detailed metrics at instruction level and embedded source code.
23-
*
24-
* '''Note:''' does not support Scala language constructs.
25-
*/
22+
/**
23+
* HTML report containing detailed metrics at instruction level and embedded source code.
24+
*
25+
* '''Note:''' does not support Scala language constructs.
26+
*/
2627
val HTML = new HTMLReportFormat()
2728

28-
/** XML report containing detailed metrics at instruction level.
29-
*
30-
* '''Note:''' does not support Scala language constructs.
31-
*/
29+
/**
30+
* XML report containing detailed metrics at instruction level.
31+
*
32+
* '''Note:''' does not support Scala language constructs.
33+
*/
3234
val XML = new XMLReportFormat()
3335

34-
/** CSV report containing metrics at class level only.
35-
*
36-
* '''Note:''' does not support Scala language constructs.
37-
*/
36+
/**
37+
* CSV report containing metrics at class level only.
38+
*
39+
* '''Note:''' does not support Scala language constructs.
40+
*/
3841
val CSV = new CSVReportFormat()
3942
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ 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.
39-
*
40-
* TODO: Find a way to remove them from the annotated source code reports, too.
41-
*/
37+
* Omits displaying instruction and branch coverage in the coverage tables,
38+
* as Scala generates null checks which make these too noisy.
39+
*
40+
* TODO: Find a way to remove them from the annotated source code reports, too.
41+
*/
4242
class ScalaHtmlFormatter(withBranchCoverage: Boolean) extends HTMLFormatter {
4343
private val table: Table = createTable
4444

0 commit comments

Comments
 (0)