Skip to content

Commit dd78792

Browse files
committed
warn when there's no test coverage
1 parent e74a0eb commit dd78792

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

0 commit comments

Comments
 (0)