Skip to content

Commit e038ce3

Browse files
authored
Merge pull request #48 from fastruby/warn-missing-coverage
Warn about missing coverage information and SkunkScore impact
2 parents e74a0eb + f08c0fa commit e038ce3

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

Gemfile.lock

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@ GEM
1111
addressable (2.7.0)
1212
public_suffix (>= 2.0.2, < 5.0)
1313
ansi (1.5.0)
14-
ast (2.4.0)
14+
ast (2.4.1)
1515
axiom-types (0.1.1)
1616
descendants_tracker (~> 0.0.4)
1717
ice_nine (~> 0.11.0)
1818
thread_safe (~> 0.3, >= 0.3.1)
19-
byebug (11.1.1)
19+
byebug (11.1.3)
2020
codeclimate-engine-rb (0.4.1)
2121
virtus (~> 1.0)
22-
codecov (0.1.16)
22+
codecov (0.1.21)
2323
json
2424
simplecov
25-
url
2625
coercible (1.0.0)
2726
descendants_tracker (~> 0.0.1)
2827
descendants_tracker (0.0.4)
@@ -41,19 +40,19 @@ GEM
4140
sexp_processor (~> 4.8)
4241
ice_nine (0.11.2)
4342
jaro_winkler (1.5.4)
44-
json (2.3.0)
43+
json (2.3.1)
4544
kwalify (0.7.2)
4645
launchy (2.4.3)
4746
addressable (~> 2.3)
4847
minitest (5.8.5)
4948
minitest-around (0.5.0)
5049
minitest (~> 5.0)
51-
parallel (1.19.1)
50+
parallel (1.19.2)
5251
parser (2.6.5.0)
5352
ast (~> 2.4.0)
5453
path_expander (1.1.0)
5554
psych (3.1.0)
56-
public_suffix (4.0.5)
55+
public_suffix (4.0.6)
5756
rainbow (3.0.0)
5857
rake (13.0.1)
5958
reek (5.4.1)
@@ -70,7 +69,7 @@ GEM
7069
ruby-progressbar (~> 1.7)
7170
unicode-display_width (>= 1.4.0, < 1.7)
7271
ruby-progressbar (1.10.1)
73-
ruby_parser (3.14.2)
72+
ruby_parser (3.15.0)
7473
sexp_processor (~> 4.9)
7574
rubycritic (4.4.1)
7675
flay (~> 2.8)
@@ -83,7 +82,7 @@ GEM
8382
simplecov (>= 0.17.0)
8483
tty-which (~> 0.4.0)
8584
virtus (~> 1.0)
86-
sexp_processor (4.15.0)
85+
sexp_processor (4.15.1)
8786
simplecov (0.18.5)
8887
docile (~> 1.1)
8988
simplecov-html (~> 0.11)
@@ -97,7 +96,6 @@ GEM
9796
thread_safe (0.3.6)
9897
tty-which (0.4.2)
9998
unicode-display_width (1.6.1)
100-
url (0.3.2)
10199
virtus (1.0.5)
102100
axiom-types (~> 0.1)
103101
coercible (~> 1.0)
@@ -108,7 +106,6 @@ PLATFORMS
108106
ruby
109107

110108
DEPENDENCIES
111-
bundler (~> 2.0)
112109
byebug (~> 11)
113110
codecov (~> 0.1.16)
114111
minitest (~> 5.8.4)

lib/skunk/cli/application.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ module Skunk
1212
module Cli
1313
# Knows how to execute command line commands
1414
class Application < RubyCritic::Cli::Application
15+
COVERAGE_FILE = "coverage/.resultset.json"
16+
1517
def initialize(argv)
1618
@options = Skunk::Cli::Options.new(argv)
1719
end
1820

1921
def execute
22+
warn_coverage_info unless File.exist?(COVERAGE_FILE)
23+
2024
parsed_options = @options.parse.to_h
2125
reporter = Skunk::Cli::CommandFactory.create(parsed_options).execute
2226
print(reporter.status_message)
@@ -25,6 +29,13 @@ def execute
2529
warn "Error: #{error}"
2630
STATUS_ERROR
2731
end
32+
33+
private
34+
35+
def warn_coverage_info
36+
warn "warning: Couldn't find coverage info at #{COVERAGE_FILE}."
37+
warn "warning: Having no coverage metrics will make your SkunkScore worse."
38+
end
2839
end
2940
end
3041
end

skunk.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Gem::Specification.new do |spec|
4141
spec.add_dependency "rubycritic", ">= 4.4", "< 5.0"
4242
spec.add_dependency "terminal-table", "~> 1.8.0"
4343

44-
spec.add_development_dependency "bundler", "~> 2.0"
4544
spec.add_development_dependency "byebug", "~> 11"
4645
spec.add_development_dependency "codecov", "~> 0.1.16"
4746
spec.add_development_dependency "minitest", "~> 5.8.4"

0 commit comments

Comments
 (0)