Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scoverage/sbt-scoverage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.8.1
Choose a base ref
...
head repository: scoverage/sbt-scoverage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on May 28, 2021

  1. Copy the full SHA
    f9874cd View commit details
  2. Merge pull request #354 from scala-steward/update/scalac-scoverage-pl…

    …ugin-1.4.8
    
    Update scalac-scoverage-plugin to 1.4.8
    ckipp01 authored May 28, 2021
    Copy the full SHA
    e8e3505 View commit details

Commits on Jun 1, 2021

  1. Copy the full SHA
    4dcf121 View commit details

Commits on Jun 4, 2021

  1. Update to scala 2.12.14

    samupra committed Jun 4, 2021
    Copy the full SHA
    bad6866 View commit details
  2. Merge pull request #355 from scala-steward/update/sbt-1.5.3

    Update sbt, scripted-plugin to 1.5.3
    ckipp01 authored Jun 4, 2021
    Copy the full SHA
    99c4822 View commit details
  3. Merge pull request #356 from samupra/main

    Update to scala 2.12.14
    ckipp01 authored Jun 4, 2021
    Copy the full SHA
    03de62e View commit details

Commits on Jun 14, 2021

  1. Copy the full SHA
    f8952fd View commit details
  2. Merge pull request #357 from scala-steward/update/sbt-1.5.4

    Update sbt, scripted-plugin to 1.5.4
    ckipp01 authored Jun 14, 2021
    Copy the full SHA
    bad92cb View commit details

Commits on Jul 9, 2021

  1. Copy the full SHA
    8b3f4de View commit details

Commits on Jul 10, 2021

  1. Merge pull request #359 from scala-steward/update/sbt-scalafmt-2.4.3

    Update sbt-scalafmt to 2.4.3
    ckipp01 authored Jul 10, 2021
    Copy the full SHA
    ca24fe4 View commit details

Commits on Jul 12, 2021

  1. Copy the full SHA
    9d9fa31 View commit details
  2. Merge pull request #361 from scala-steward/update/sbt-1.5.5

    Update sbt, scripted-plugin to 1.5.5
    ckipp01 authored Jul 12, 2021
    Copy the full SHA
    ed3de78 View commit details

Commits on Aug 19, 2021

  1. Copy the full SHA
    369559e View commit details
  2. Copy the full SHA
    cf2dcac View commit details
  3. Merge pull request #363 from scala-steward/update/scalafmt-core-3.0.0

    Update scalafmt-core to 3.0.0
    ckipp01 authored Aug 19, 2021
    Copy the full SHA
    828a491 View commit details

Commits on Aug 27, 2021

  1. Copy the full SHA
    9d96252 View commit details

Commits on Aug 28, 2021

  1. Merge pull request #364 from scala-steward/update/scalafmt-core-3.0.1

    Update scalafmt-core to 3.0.1
    ckipp01 authored Aug 28, 2021
    Copy the full SHA
    a532e6f View commit details

Commits on Sep 4, 2021

  1. Copy the full SHA
    9141cf7 View commit details
  2. Merge pull request #365 from scala-steward/update/scalafmt-core-3.0.2

    Update scalafmt-core to 3.0.2
    ckipp01 authored Sep 4, 2021
    Copy the full SHA
    1fdb369 View commit details

Commits on Sep 7, 2021

  1. Merge pull request #5 from scoverage/main

    Rebase to Main branch of parent project
    pzhong-livongo authored Sep 7, 2021
    Copy the full SHA
    332744a View commit details

Commits on Sep 8, 2021

  1. Copy the full SHA
    1839027 View commit details

Commits on Sep 10, 2021

  1. Copy the full SHA
    140b99a View commit details
  2. Update src/main/scala/scoverage/ScoverageKeys.scala

    Co-authored-by: Chris Kipp <ckipp@pm.me>
    pzhong-livongo and ckipp01 authored Sep 10, 2021
    Copy the full SHA
    4324103 View commit details
  3. Copy the full SHA
    58ae1b3 View commit details

Commits on Sep 12, 2021

  1. Merge pull request #367 from scala-steward/update/scalafmt-core-3.0.3

    Update scalafmt-core to 3.0.3
    ckipp01 authored Sep 12, 2021
    Copy the full SHA
    99ba2c1 View commit details

Commits on Sep 13, 2021

  1. Merge pull request #366 from livongo/beplat-72-rebase

    provide possibility to set up data dir(Rebased to newest version)
    ckipp01 authored Sep 13, 2021
    Copy the full SHA
    8d88e71 View commit details

Commits on Sep 16, 2021

  1. Copy the full SHA
    2e81498 View commit details
  2. Merge pull request #370 from ckipp01/new-scoverage

    Update default scoverage to 1.4.9
    ckipp01 authored Sep 16, 2021
    Copy the full SHA
    8696e74 View commit details

Commits on Sep 17, 2021

  1. Copy the full SHA
    3a1b39b View commit details
  2. Copy the full SHA
    9703a63 View commit details

Commits on Sep 18, 2021

  1. Merge pull request #371 from scala-steward/update/scalafmt-core-3.0.4

    Update scalafmt-core to 3.0.4
    ckipp01 authored Sep 18, 2021
    Copy the full SHA
    cdfeacb View commit details

Commits on Sep 22, 2021

  1. Copy the full SHA
    220a6f0 View commit details

Commits on Sep 23, 2021

  1. Merge pull request #373 from scala-steward/update/sbt-ci-release-1.5.9

    Update sbt-ci-release to 1.5.9
    ckipp01 authored Sep 23, 2021
    Copy the full SHA
    bb40ce9 View commit details

Commits on Oct 2, 2021

  1. Copy the full SHA
    00605ad View commit details

Commits on Oct 11, 2021

  1. Merge pull request #375 from scala-steward/update/scalafmt-core-3.0.6

    Update scalafmt-core to 3.0.6
    ckipp01 authored Oct 11, 2021
    Copy the full SHA
    c190f3d View commit details
  2. Ensure reporting and aggregation still works when disabling modules.

    In the past reporting and aggregation would fail when you tried to
    disable Scoverage for a specific module. This now will only take into
    account the modules that have the keys defined rather than defaulting to
    all of them.
    
    Closes #376
    ckipp01 committed Oct 11, 2021
    Copy the full SHA
    bb99b2c View commit details
  3. Merge pull request #377 from ckipp01/disabled

    Ensure reporting and aggregation still works when disabling modules.
    ckipp01 authored Oct 11, 2021
    Copy the full SHA
    28337aa View commit details

Commits on Oct 23, 2021

  1. Copy the full SHA
    388171c View commit details
  2. Copy the full SHA
    2f34ba2 View commit details
  3. Copy the full SHA
    0fc7eb6 View commit details

Commits on Oct 30, 2021

  1. Copy the full SHA
    ba36cd3 View commit details

Commits on Nov 1, 2021

  1. Copy the full SHA
    454b6fc View commit details
  2. Copy the full SHA
    7f334f7 View commit details
  3. Copy the full SHA
    37e8686 View commit details
  4. Copy the full SHA
    fa11d8d View commit details
  5. Account for M1 of scoverage

    ckipp01 committed Nov 1, 2021
    Copy the full SHA
    c0cf26c View commit details
  6. Only test on 8 and 11

    17 brought some weird issues that seem to stem from sbt. We'll look at
       these later.
    ckipp01 committed Nov 1, 2021
    Copy the full SHA
    c783dde View commit details
  7. Remove plugin version test for now.

    Since this won't work now for anything < 2.x the test won't make sense until
    we release more versions
    ckipp01 committed Nov 1, 2021
    Copy the full SHA
    f9232bd View commit details
  8. Copy the full SHA
    33d6cf1 View commit details

Commits on Nov 2, 2021

  1. Bump default version of scoverage to 2.0.0-M3

    This is to support 2.13.7
    ckipp01 committed Nov 2, 2021
    Copy the full SHA
    a4cb3d3 View commit details
Showing with 1,233 additions and 236 deletions.
  1. +3 −0 .git-blame-ignore-revs
  2. +17 −11 .github/workflows/ci.yml
  3. +1 −1 .github/workflows/release-drafter.yml
  4. +5 −4 .github/workflows/release.yml
  5. +4 −3 .gitignore
  6. +3 −1 .scalafmt.conf
  7. +116 −57 README.md
  8. +14 −4 build.sbt
  9. +1 −1 project/build.properties
  10. +3 −3 project/plugins.sbt
  11. +4 −4 src/main/scala/scoverage/CoverageMinimum.scala
  12. +2 −3 src/main/scala/scoverage/ScoverageKeys.scala
  13. +179 −45 src/main/scala/scoverage/ScoverageSbtPlugin.scala
  14. +7 −0 src/sbt-test/scoverage/aggregate-disabled-module/a/src/main/scala/a/AdderScala.scala
  15. +8 −0 src/sbt-test/scoverage/aggregate-disabled-module/a/src/test/scala/AdderTestSuite.scala
  16. +7 −0 src/sbt-test/scoverage/aggregate-disabled-module/b/src/main/scala/b/AdderScala.scala
  17. +8 −0 src/sbt-test/scoverage/aggregate-disabled-module/b/src/test/scala/AdderTestSuite.scala
  18. +17 −0 src/sbt-test/scoverage/aggregate-disabled-module/build.sbt
  19. +7 −0 src/sbt-test/scoverage/aggregate-disabled-module/c/src/main/scala/c/AdderScala.scala
  20. +8 −0 src/sbt-test/scoverage/aggregate-disabled-module/c/src/test/scala/AdderTestSuite.scala
  21. +1 −0 src/sbt-test/scoverage/aggregate-disabled-module/project/build.properties
  22. +3 −1 src/sbt-test/scoverage/{scalac-plugin-version → aggregate-disabled-module}/project/plugins.sbt
  23. +16 −0 src/sbt-test/scoverage/aggregate-disabled-module/test
  24. +3 −3 src/sbt-test/scoverage/aggregate-only/build.sbt
  25. +2 −3 ...-test/scoverage/aggregate-only/partA/src/main/scala/org/scoverage/issue53/part/a/AdderScala.scala
  26. +2 −4 .../scoverage/aggregate-only/partB/src/main/scala/org/scoverage/issue53/part/b/SubtractorScala.scala
  27. +3 −1 src/sbt-test/scoverage/aggregate-only/project/plugins.sbt
  28. +3 −3 src/sbt-test/scoverage/aggregate/build.sbt
  29. +2 −3 src/sbt-test/scoverage/aggregate/partA/src/main/scala/org/scoverage/issue53/part/a/AdderScala.scala
  30. +2 −4 ...-test/scoverage/aggregate/partB/src/main/scala/org/scoverage/issue53/part/b/SubtractorScala.scala
  31. +1 −1 src/sbt-test/scoverage/aggregate/project/build.properties
  32. +3 −1 src/sbt-test/scoverage/aggregate/project/plugins.sbt
  33. +8 −3 src/sbt-test/scoverage/bad-coverage-file-branch/build.sbt
  34. +3 −1 src/sbt-test/scoverage/bad-coverage-file-branch/project/plugins.sbt
  35. +8 −3 src/sbt-test/scoverage/bad-coverage-file-stmt/build.sbt
  36. +3 −1 src/sbt-test/scoverage/bad-coverage-file-stmt/project/plugins.sbt
  37. +8 −3 src/sbt-test/scoverage/bad-coverage-package-branch/build.sbt
  38. +3 −1 src/sbt-test/scoverage/bad-coverage-package-branch/project/plugins.sbt
  39. +8 −3 src/sbt-test/scoverage/bad-coverage-package-stmt/build.sbt
  40. +3 −1 src/sbt-test/scoverage/bad-coverage-package-stmt/project/plugins.sbt
  41. +8 −3 src/sbt-test/scoverage/bad-coverage-total-branch/build.sbt
  42. +3 −1 src/sbt-test/scoverage/bad-coverage-total-branch/project/plugins.sbt
  43. +8 −3 src/sbt-test/scoverage/bad-coverage-total-stmt/build.sbt
  44. +3 −1 src/sbt-test/scoverage/bad-coverage-total-stmt/project/plugins.sbt
  45. +4 −4 src/sbt-test/scoverage/bad-coverage/build.sbt
  46. +3 −1 src/sbt-test/scoverage/bad-coverage/project/plugins.sbt
  47. +1 −1 src/sbt-test/scoverage/bad-coverage/src/main/scala/BadCoverage.scala
  48. +13 −0 src/sbt-test/scoverage/coverage-excluded-files/build.sbt
  49. +1 −0 src/sbt-test/scoverage/coverage-excluded-files/project/build.properties
  50. +16 −0 src/sbt-test/scoverage/coverage-excluded-files/project/plugins.sbt
  51. +7 −0 src/sbt-test/scoverage/coverage-excluded-files/src/main/scala/GoodCoverage.scala
  52. +9 −0 src/sbt-test/scoverage/coverage-excluded-files/src/main/scala/two/GoodCoverage.scala
  53. +19 −0 src/sbt-test/scoverage/coverage-excluded-files/src/test/scala/GoodCoverageSpec.scala
  54. +9 −0 src/sbt-test/scoverage/coverage-excluded-files/test
  55. +13 −0 src/sbt-test/scoverage/coverage-excluded-packages/build.sbt
  56. +1 −0 src/sbt-test/scoverage/coverage-excluded-packages/project/build.properties
  57. +16 −0 src/sbt-test/scoverage/coverage-excluded-packages/project/plugins.sbt
  58. +7 −0 src/sbt-test/scoverage/coverage-excluded-packages/src/main/scala/GoodCoverage.scala
  59. +9 −0 src/sbt-test/scoverage/coverage-excluded-packages/src/main/scala/two/GoodCoverage.scala
  60. +19 −0 src/sbt-test/scoverage/coverage-excluded-packages/src/test/scala/GoodCoverageSpec.scala
  61. +9 −0 src/sbt-test/scoverage/coverage-excluded-packages/test
  62. +3 −4 src/sbt-test/scoverage/coverage-off/build.sbt
  63. +1 −0 src/sbt-test/scoverage/coverage-off/project/build.properties
  64. +3 −1 src/sbt-test/scoverage/coverage-off/project/plugins.sbt
  65. +1 −1 src/sbt-test/scoverage/coverage-off/test
  66. +17 −0 src/sbt-test/scoverage/data-dir/build.sbt
  67. +1 −0 src/sbt-test/scoverage/data-dir/project/build.properties
  68. +16 −0 src/sbt-test/scoverage/data-dir/project/plugins.sbt
  69. +6 −0 src/sbt-test/scoverage/data-dir/src/main/scala/GoodCoverage.scala
  70. +12 −0 src/sbt-test/scoverage/data-dir/src/test/scala/GoodCoverageSpec.scala
  71. +7 −0 src/sbt-test/scoverage/data-dir/test
  72. +3 −4 src/sbt-test/scoverage/good-coverage/build.sbt
  73. +3 −1 src/sbt-test/scoverage/good-coverage/project/plugins.sbt
  74. +4 −4 src/sbt-test/scoverage/preserve-set/build.sbt
  75. +3 −1 src/sbt-test/scoverage/preserve-set/project/plugins.sbt
  76. +2 −2 src/sbt-test/scoverage/preserve-set/test
  77. +17 −0 src/sbt-test/scoverage/scala3-bad/build.sbt
  78. +16 −0 src/sbt-test/scoverage/scala3-bad/project/plugins.sbt
  79. +10 −0 src/sbt-test/scoverage/scala3-bad/src/main/scala/BadCoverage.scala
  80. +10 −0 src/sbt-test/scoverage/scala3-bad/src/test/scala/BadCoverageSpec.scala
  81. +5 −0 src/sbt-test/scoverage/scala3-bad/test
  82. +13 −0 src/sbt-test/scoverage/scala3-coverage-excluded-files/build.sbt
  83. +1 −0 src/sbt-test/scoverage/scala3-coverage-excluded-files/project/build.properties
  84. +16 −0 src/sbt-test/scoverage/scala3-coverage-excluded-files/project/plugins.sbt
  85. +7 −0 src/sbt-test/scoverage/scala3-coverage-excluded-files/src/main/scala/GoodCoverage.scala
  86. +9 −0 src/sbt-test/scoverage/scala3-coverage-excluded-files/src/main/scala/three/GoodCoverage.scala
  87. +9 −0 src/sbt-test/scoverage/scala3-coverage-excluded-files/src/main/scala/two/GoodCoverage.scala
  88. +19 −0 src/sbt-test/scoverage/scala3-coverage-excluded-files/src/test/scala/GoodCoverageSpec.scala
  89. +9 −0 src/sbt-test/scoverage/scala3-coverage-excluded-files/test
  90. +13 −0 src/sbt-test/scoverage/scala3-coverage-excluded-packages/build.sbt
  91. +1 −0 src/sbt-test/scoverage/scala3-coverage-excluded-packages/project/build.properties
  92. +16 −0 src/sbt-test/scoverage/scala3-coverage-excluded-packages/project/plugins.sbt
  93. +7 −0 src/sbt-test/scoverage/scala3-coverage-excluded-packages/src/main/scala/GoodCoverage.scala
  94. +9 −0 src/sbt-test/scoverage/scala3-coverage-excluded-packages/src/main/scala/three/GoodCoverage.scala
  95. +9 −0 src/sbt-test/scoverage/scala3-coverage-excluded-packages/src/main/scala/two/GoodCoverage.scala
  96. +19 −0 src/sbt-test/scoverage/scala3-coverage-excluded-packages/src/test/scala/GoodCoverageSpec.scala
  97. +9 −0 src/sbt-test/scoverage/scala3-coverage-excluded-packages/test
  98. +20 −0 src/sbt-test/scoverage/scala3-good/build.sbt
  99. +16 −0 src/sbt-test/scoverage/scala3-good/project/plugins.sbt
  100. +7 −0 src/sbt-test/scoverage/scala3-good/src/main/scala/GoodCoverage.scala
  101. +9 −0 src/sbt-test/scoverage/scala3-good/src/main/scala/two/GoodCoverage.scala
  102. +19 −0 src/sbt-test/scoverage/scala3-good/src/test/scala/GoodCoverageSpec.scala
  103. +5 −0 src/sbt-test/scoverage/scala3-good/test
  104. +13 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/build.sbt
  105. +1 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/project/build.properties
  106. +16 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/project/plugins.sbt
  107. +7 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/GoodCoverage.scala
  108. +9 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/three/GoodCoverage.scala
  109. +9 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/main/scala/two/GoodCoverage.scala
  110. +19 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/src/test/scala/GoodCoverageSpec.scala
  111. +9 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-files/test
  112. +13 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/build.sbt
  113. +1 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/project/build.properties
  114. +16 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/project/plugins.sbt
  115. +7 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/GoodCoverage.scala
  116. +9 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/three/GoodCoverage.scala
  117. +9 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/main/scala/two/GoodCoverage.scala
  118. +19 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/src/test/scala/GoodCoverageSpec.scala
  119. +9 −0 src/sbt-test/scoverage/scala3.3.4-coverage-excluded-packages/test
  120. +0 −17 src/sbt-test/scoverage/scalac-plugin-version/build.sbt
  121. +0 −3 src/sbt-test/scoverage/scalac-plugin-version/test
  122. +3 −3 src/sbt-test/scoverage/scalajs/build.sbt
  123. +5 −3 src/sbt-test/scoverage/scalajs/project/plugins.sbt
  124. +0 −1 src/sbt-test/scoverage/scalajs/sjstest/shared/src/main/scala/UnderTest.scala
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -4,3 +4,6 @@
#
# Added scalafmt
af2396558918fea00eaa2da12906a3012eb72153

# Scala Steward: Reformat with scalafmt 3.5.9
e233420d8f4cdd863932d3c1c41deb2da6c1bace
28 changes: 17 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -6,44 +6,50 @@ on:
- '*.md'
branches:
- main
- V2
pull_request:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '8', '11' ]
java: [ '8', '17' ]
os: [ 'ubuntu-latest' ]

steps:
- name: checkout the repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: sbt/setup-sbt@v1

- name: Set up JVM
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Run tests
run: sbt scripted
run: sbt scripted "++ 3.x" test

formatting:
runs-on: ubuntu-latest

steps:
- name: checkout the repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JVM
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '8'
distribution: 'temurin'
java-version: '11'

- uses: sbt/setup-sbt@v1

- name: Check Formatting
run: sbt scalafmtCheckAll
run: sbt scalafmtSbtCheck "+ scalafmtCheckAll"
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -9,6 +9,6 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -6,15 +6,16 @@ on:
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: '11'
- uses: sbt/setup-sbt@v1
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,9 +8,10 @@ target/
.project
.settings/

# Scala-IDE specific
.cache-main
.cache-tests
# Metals specific
.bsp
metals.sbt
.metals

# IntelliJ IDEA specific
.idea
4 changes: 3 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
version = "2.7.5"
version = "3.9.4"
project.git = true
runner.dialect = "scala213"
173 changes: 116 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
# sbt-scoverage

[![Gitter](https://img.shields.io/gitter/room/scoverage/scoverage.svg)](https://gitter.im/scoverage/scoverage)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.scoverage/sbt-scoverage/badge.svg?kill_cache=1)](https://search.maven.org/artifact/org.scoverage/sbt-scoverage/)
[![License](http://img.shields.io/:license-Apache%202-red.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)
[![gitter-badge][]][gitter]
[![maven-badge][]][maven]
[![license-badge][]][license]

sbt-scoverage is a plugin for sbt that integrates the scoverage code coverage
library. Find out more about
[scoverage here](https://github.com/scoverage/scalac-scoverage-plugin).
sbt-scoverage is an sbt plugin that offers support for Scala code
coverage using [scoverage][]. This plugin supports Scala 2.12, 2.13,
and 3.

**NOTE**: ScalaJS and Scala Native support is limited to Scala 2.

**NOTE**: Scala 3 support starts with 3.2.x.

## Setup

**Requirements**: Requires sbt 1.2.8 or above
**Requirements**: Requires sbt 1.2.8 or above.

In `project/plugins.sbt`:
```scala
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "x.x.x")
```

If you are in an enterprise environment, and the above does not work, try:
```scala
libraryDependencies += "org.scoverage" % "sbt-scoverage_2.12_1.0" % "x.x.x"
```

## Usage

Run the tests with enabled coverage:
```
$ sbt clean coverage test
sbt clean coverage test
```
or if you have integration tests as well
```
$ sbt clean coverage it:test
sbt clean coverage it:test
```

To enable coverage directly in your build, use:
@@ -35,43 +44,57 @@ coverageEnabled := true

To generate the coverage reports run
```
$ sbt coverageReport
sbt coverageReport
```

Coverage reports will be in your `target/scala-<scala-version>/scoverage-report`
directory. There are HTML and XML reports. The XML is useful if you need to
programatically use the results, or if you're writing a tool.
Coverage reports will be in your
`target/scala-<scala-version>/scoverage-report` directory. There are
HTML and XML reports. The XML is useful if you need to programatically
use the results, or if you're writing a tool.

**NOTE**: If you're running the coverage reports from within an sbt console
session (as opposed to one command per sbt launch), then the `coverage` command
is sticky. To turn it back off when you're done running reports, use the
`coverageOff` command or reset `coverageEnabled` with `set coverageEnabled :=
false`.
**NOTE**: If you're running the coverage reports from within an sbt
console session (as opposed to one command per sbt launch), then the
`coverage` command is sticky. To turn it back off when you're done
running reports, use the `coverageOff` command or reset
`coverageEnabled` with `set coverageEnabled := false`.

### Multi project reports

By default, scoverage will generate reports for each project separately. You can
merge them into an aggregated report by using the following:
By default, scoverage will generate reports for each project
separately. You can merge them into an aggregated report by using the
following:

```
$ sbt coverageAggregate
```

**NOTE**: You do not need to run `coverageReport` before `coverageAggregate`; it
aggregates over the sub-projects' coverage data directly, not the report xml.
**NOTE**: You do not need to run `coverageReport` before
`coverageAggregate`; it aggregates over the sub-projects' coverage
data directly, not the report xml.

### Exclude classes and packages
### Exclude classes and packages and files

You can exclude classes from being considered for coverage measurement by
providing semicolon-separated list of regular expressions.
You can exclude classes from being considered for coverage measurement
by providing semicolon-separated list of regular expressions.

```scala
coverageExcludedPackages := "<empty>;Reverse.*;.*AuthService.*;models\\.data\\..*"
```

The regular expressions are matched against the fully qualified class name, and
must match the entire string to take effect. Any matched classes will not be
instrumented or included in the coverage report.
The regular expressions are matched against the fully qualified class
name, and must match the entire string to take effect. Any matched
classes will not be instrumented or included in the coverage report.

You can also exclude files and file paths.

```scala
coverageExcludedFiles := ".*\\/two\\/GoodCoverage;.*\\/three\\/.*"
```

**NOTE**: The `.scala` file extension needs to be omitted from the
filename, if one is given.

**NOTE**: These two options only work for Scala2, Scala 3.3.4+ and Scala 3.4.2+.

You can also mark sections of code with comments like:

@@ -84,6 +107,8 @@ You can also mark sections of code with comments like:
Any code between two such comments will not be instrumented or included in the
coverage report.

**NOTE**: Comments exclusion works only for Scala2.

### Minimum coverage

Based on minimum coverage, you can fail the build with the following keys:
@@ -98,55 +123,89 @@ coverageMinimumStmtPerFile := 85
coverageMinimumBranchPerFile := 80
```

These settings will be enforced when the reports are generated. If you generate
an aggregate report using `coverageAggregate` then these settings will apply to
that report.
These settings will be enforced when the reports are generated. If
you generate an aggregate report using `coverageAggregate` then these
settings will apply to that report.

### Override Location for Coverage Data And Report

If desired, one could override the default location for generating the
sbt report and data through setting `coverageDataDir`:

Example in data-dir test:
```scala
coverageDataDir := target.value / "custom-test"
```

Can also be set through the sbt set directive
```scala
set coverageDataDir := file("/tmp")
```

## Trouble-shooting failing tests

scoverage does a lot of file writing behind the scenes in order to track which
statements have been executed. If you are running into a scenario where your
tests normally pass, but fail when scoverage is enabled, then the culprit can be
one of the following:
scoverage does a lot of file writing behind the scenes in order to
track which statements have been executed. If you are running into a
scenario where your tests normally pass, but fail when scoverage is
enabled, then the culprit can be one of the following:

* timing issues on futures and other async operations, try upping the timeouts by an order of magnitude.
* tests are run in a sandbox mode (such as with `java.security.PrivilegedAction<T>`), try running the tests outside of the sandbox.
* timing issues on futures and other async operations, try upping the
timeouts by an order of magnitude.
* tests are run in a sandbox mode (such as with
`java.security.PrivilegedAction<T>`), try running the tests outside
of the sandbox.

## Example project

[the scoverage samples project](https://github.com/scoverage/sbt-scoverage-samples).
To see the plugin in action you can checkout the scoverage [samples][]
project.

## Integrations

### Codacy

[Codacy](https://www.codacy.com) integrates with your favorite coverage tool to
provide an in-depth overlook of your project status. scoverage information can
be integrated into Codacy through the
[codacy-coverage-reporter](https://github.com/codacy/codacy-coverage-reporter).
[Codacy][] integrates with your favorite coverage tool to provide an
in-depth overlook of your project status. scoverage information can be
integrated into Codacy through the [codacy-coverage-reporter][].

### Coveralls

If you have an open source project then you can add code coverage metrics with
the [Coveralls](https://coveralls.io/). scoverage will integrate with coveralls
using the [sbt-coveralls](https://github.com/scoverage/sbt-coveralls) plugin.
If you have an open source project then you can publish the code
coverage metrics with [Coveralls][]. This plugin will integrate with
coveralls using the [sbt-coveralls][] plugin.

### Codecov

You can integrate with [Codecov](https://about.codecov.io/) easily sending your
reports there via your CI. You can see an example of this here in
[codecov/example-scala](https://github.com/codecov/example-scala).
You can also integrate with [Codecov][] by sending your reports there
via your CI. You can see an example in [codecov-example-scala][].

### Plugin for SonarQube
### SonarQube

If you want to visually browse statement coverage reports then use this [plugin
for SonarQube](https://github.com/RadoBuransky/sonar-scoverage-plugin). It
allows you to review overall project statement coverage as well as dig deeper
into sub-modules, directories and source code files to see uncovered statements.
Statement coverage measurement can become an integral part of your team's
continuous integration process and a required quality standard.
If you want to visually browse coverage reports then you can use the
[SonarQube][] plugin. It allows you to review overall project
statement coverage as well as dig deeper into sub-modules, directories
and source code files to see uncovered statements. Statement coverage
measurement can become an integral part of your team's continuous
integration process and a required quality standard.

## Release Notes

For any information on releases and upgrading, please refer to the [release
page](https://github.com/scoverage/sbt-scoverage/releases).
For any information on releases and upgrading, please refer to the
[release][] page.

[Codacy]: https://www.codacy.com
[Codecov]: https://about.codecov.io
[Coveralls]: https://coveralls.io
[SonarQube]: https://github.com/RadoBuransky/sonar-scoverage-plugin
[codacy-coverage-reporter]: https://github.com/codacy/codacy-coverage-reporter
[codecov-example-scala]: https://github.com/codecov/example-scala
[gitter-badge]: https://img.shields.io/gitter/room/scoverage/scoverage.svg
[gitter]: https://gitter.im/scoverage/scoverage
[license-badge]: http://img.shields.io/:license-Apache%202-red.svg
[license]: http://www.apache.org/licenses/LICENSE-2.0.txt
[maven-badge]: https://index.scala-lang.org/scoverage/sbt-scoverage/sbt-scoverage/latest.svg
[maven]: https://search.maven.org/artifact/org.scoverage/sbt-scoverage
[release]: https://github.com/scoverage/sbt-scoverage/releases
[samples]: https://github.com/scoverage/sbt-scoverage-samples
[sbt-coveralls]: https://github.com/scoverage/sbt-coveralls
[scoverage]: https://github.com/scoverage/scalac-scoverage-plugin
Loading