danger-rcov 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rcov/gem_version.rb +1 -1
- data/lib/rcov/plugin.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dad4e0e4d7f72d9ab2b1101baf29b8caeb5c1f7bc2c7385ce96c1f3e521ca82b
|
4
|
+
data.tar.gz: 4eb8c77f703e1ecf302519187cafd61fc38f0b40a955e5239fa4e910f44834f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 920081b083ceed32785b1eef71e0cdd3c251fbeced749b78bacac765a6499e38591fc52c69b1c7fbce526484aa67b580bee40bc89b9d89fe945d0d8576ca0c72
|
7
|
+
data.tar.gz: bb333d40155b44f8cc83943e70cdc344da99a9b4ce8dd9d1d0d29b202d5da5df52d53662530dbc8fa079776e3d557de3d2e508e9575a1620294cd109441f768b
|
data/lib/rcov/gem_version.rb
CHANGED
data/lib/rcov/plugin.rb
CHANGED
@@ -3,11 +3,16 @@ require 'net/http'
|
|
3
3
|
|
4
4
|
module Danger
|
5
5
|
class DangerRcov < Plugin
|
6
|
-
def report(current_url:, master_url:)
|
6
|
+
def report(current_url:, master_url:, show_warning: true)
|
7
7
|
# Get code coverage report as json from url
|
8
8
|
current_report = get_report(url: current_url)
|
9
9
|
|
10
10
|
master_report = get_report(url: master_url)
|
11
|
+
|
12
|
+
if show_warning && master_report && master_report['metrics']['covered_percent'].round(2) > current_report['metrics']['covered_percent'].round(2)
|
13
|
+
warn("Code coverage decreased from #{master_report['metrics']['covered_percent'].round(2).to_s}% to #{current_report['metrics']['covered_percent'].round(2)}%")
|
14
|
+
end
|
15
|
+
|
11
16
|
# Output the processed report
|
12
17
|
output_report(current_report, master_report)
|
13
18
|
end
|