Skip to content

Commit e5c04fe

Browse files
rolandtritschckipp01
authored andcommitted
README: Fix maven badge. Use footnotes for links. Reformat/Refresh.
1 parent 2118fda commit e5c04fe

File tree

1 file changed

+84
-59
lines changed

1 file changed

+84
-59
lines changed

README.md

+84-59
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# sbt-scoverage
22

3-
[![Gitter](https://img.shields.io/gitter/room/scoverage/scoverage.svg)](https://gitter.im/scoverage/scoverage)
4-
[![Maven Central](https://img.shields.io/github/v/release/scoverage/sbt-scoverage?label=maven-central)](https://search.maven.org/artifact/org.scoverage/sbt-scoverage/)
5-
[![License](http://img.shields.io/:license-Apache%202-red.svg)](http://www.apache.org/licenses/LICENSE-2.0.txt)
3+
[![gitter-badge][]][gitter]
4+
[![maven-badge][]][maven]
5+
[![license-badge][]][license]
66

7-
sbt-scoverage is an sbt plugin that offers support for Scala code coverage using
8-
[scoverage](https://github.com/scoverage/scalac-scoverage-plugin). This plugin
9-
supports Scala 2.12, 2.13, and 3.
7+
sbt-scoverage is an sbt plugin that offers support for Scala code
8+
coverage using [scoverage][]. This plugin supports Scala 2.12, 2.13,
9+
and 3.
1010

11-
**NOTE**: that ScalaJS and Scala Native support is limited to Scala 2.
12-
**NOTE**: that Scala 3 support starts with 3.2.x.
11+
**NOTE**: ScalaJS and Scala Native support is limited to Scala 2.
12+
13+
**NOTE**: Scala 3 support starts with 3.2.x.
1314

1415
## Setup
1516

16-
**Requirements**: Requires sbt 1.2.8 or above
17+
**Requirements**: Requires sbt 1.2.8 or above.
1718

1819
In `project/plugins.sbt`:
1920
```scala
@@ -46,50 +47,54 @@ To generate the coverage reports run
4647
sbt coverageReport
4748
```
4849

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

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

5961
### Multi project reports
6062

61-
By default, scoverage will generate reports for each project separately. You can
62-
merge them into an aggregated report by using the following:
63+
By default, scoverage will generate reports for each project
64+
separately. You can merge them into an aggregated report by using the
65+
following:
6366

6467
```
6568
$ sbt coverageAggregate
6669
```
6770

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

7175
### Exclude classes and packages and files
7276

73-
You can exclude classes from being considered for coverage measurement by
74-
providing semicolon-separated list of regular expressions.
77+
You can exclude classes from being considered for coverage measurement
78+
by providing semicolon-separated list of regular expressions.
7579

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

80-
The regular expressions are matched against the fully qualified class name, and
81-
must match the entire string to take effect. Any matched classes will not be
82-
instrumented or included in the coverage report.
84+
The regular expressions are matched against the fully qualified class
85+
name, and must match the entire string to take effect. Any matched
86+
classes will not be instrumented or included in the coverage report.
8387

8488
You can also exclude files and file paths.
8589

8690
```scala
8791
coverageExcludedFiles := ".*\\/two\\/GoodCoverage;.*\\/three\\/.*"
8892
```
8993

90-
Note: The `.scala` file extension needs to be omitted from the filename, if one is given.
94+
**NOTE**: The `.scala` file extension needs to be omitted from the
95+
filename, if one is given.
9196

92-
Note: These two options only work for Scala2 and Scala 3.4.2+.
97+
**NOTE**: These two options only work for Scala2 and Scala 3.4.2+.
9398

9499
You can also mark sections of code with comments like:
95100

@@ -102,7 +107,7 @@ You can also mark sections of code with comments like:
102107
Any code between two such comments will not be instrumented or included in the
103108
coverage report.
104109

105-
Note: Comments exclusion works only for Scala2.
110+
**NOTE**: Comments exclusion works only for Scala2.
106111

107112
### Minimum coverage
108113

@@ -118,13 +123,14 @@ coverageMinimumStmtPerFile := 85
118123
coverageMinimumBranchPerFile := 80
119124
```
120125

121-
These settings will be enforced when the reports are generated. If you generate
122-
an aggregate report using `coverageAggregate` then these settings will apply to
123-
that report.
126+
These settings will be enforced when the reports are generated. If
127+
you generate an aggregate report using `coverageAggregate` then these
128+
settings will apply to that report.
124129

125130
### Override Location for Coverage Data And Report
126131

127-
If desired, one could override the default location for generating the sbt report and data through setting `coverageDataDir`:
132+
If desired, one could override the default location for generating the
133+
sbt report and data through setting `coverageDataDir`:
128134

129135
Example in data-dir test:
130136
```scala
@@ -138,49 +144,68 @@ set coverageDataDir := file("/tmp")
138144

139145
## Trouble-shooting failing tests
140146

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

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

149158
## Example project
150159

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

153163
## Integrations
154164

155165
### Codacy
156166

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

162171
### Coveralls
163172

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

168177
### Codecov
169178

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

174-
### Plugin for SonarQube
182+
### SonarQube
175183

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

183191
## Release Notes
184192

185-
For any information on releases and upgrading, please refer to the [release
186-
page](https://github.com/scoverage/sbt-scoverage/releases).
193+
For any information on releases and upgrading, please refer to the
194+
[release][] page.
195+
196+
[gitter]: https://gitter.im/scoverage/scoverage
197+
[gitter-badge]: https://img.shields.io/gitter/room/scoverage/scoverage.svg
198+
[maven]: https://search.maven.org/artifact/org.scoverage/sbt-scoverage
199+
[maven-badge]: https://index.scala-lang.org/scoverage/sbt-scoverage/sbt-scoverage/latest.svg&label=maven-central
200+
[license]: http://www.apache.org/licenses/LICENSE-2.0.txt
201+
[license-badge]: http://img.shields.io/:license-Apache%202-red.svg
202+
[scoverage]: https://github.com/scoverage/scalac-scoverage-plugin
203+
[samples]: https://github.com/scoverage/sbt-scoverage-samples
204+
[codacy-coverage-reporter]: https://github.com/codacy/codacy-coverage-reporter
205+
[Codacy]: https://www.codacy.com
206+
[Coveralls]: https://coveralls.io
207+
[sbt-coveralls]: https://github.com/scoverage/sbt-coveralls
208+
[Codecov]: https://about.codecov.io
209+
[codecov-example-scala]: https://github.com/codecov/example-scala
210+
[SonarQube]: https://github.com/RadoBuransky/sonar-scoverage-plugin
211+
[release]: https://github.com/scoverage/sbt-scoverage/releases

0 commit comments

Comments
 (0)