You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-12Lines changed: 22 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,19 @@
12
12
13
13
A tool for defining and enforcing test coverage thresholds locally as well as in CI pipelines - similar to the coverage thresholds in JavaScripts popular Testing Framework [Jest](https://jestjs.io/docs/configuration#coveragethreshold-object).
14
14
15
-
`limgo` builds on top of the code coverage file generated by `go test` and extends it by a configuration file to define thresholds on directories and files using regular expressions. If those thresholds are not met, `limgo` will exit with code 1.
16
-
17
-
Currently, a coverage percentage as threshold can be defined for
18
-
- Statements
19
-
- Lines of Code
20
-
- Branches
15
+
`limgo` builds on top of the code coverage file generated by `go test` and extends it by a configuration file to define thresholds on directories and files using regular expressions. If those thresholds are not met, `limgo` will exit with code 1 and displays the coverage statistic for the module as well as a message which files do not meet any thresholds.
'pkg/model/coverage/line.go': expected coverage threshold for statements of 100.00%, but only got 82.76%
27
+
```
21
28
22
29
## Installation
23
30
@@ -59,7 +66,7 @@ The following snippet shows a basic example usage of `limgo`:
59
66
go test ./... -coverprofile=cov.out
60
67
61
68
# verify that the coverage is not below the thresholds defined in .limgo.json
62
-
limgo -coverfile=cov.out -config=.limgo.json -v=1
69
+
limgo -coverfile=cov.out -config=.limgo.json -v=3
63
70
```
64
71
65
72
An overview as well as a short description of all supported flags can be displayed via
@@ -71,7 +78,7 @@ limgo -help
71
78
72
79
Coverage thresholds are defined in a configuration file. By default, `limgo` will search for a file named `.limgo.json`. This can be overridden by the `-config` flag.
73
80
74
-
Currently, coverage thresholds for `statements`and `functions` are supported. In the configuration file example below, thresholds are defined
81
+
Currently, coverage thresholds for `statements`, `lines`and `branches` are supported. In the configuration file example below, thresholds are defined
75
82
- on a global (project) level
76
83
- for all files in the "coverage" directory
77
84
- for all files in the "gosrc" directory starting with g
@@ -80,16 +87,19 @@ Currently, coverage thresholds for `statements` and `functions` are supported. I
0 commit comments