Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opahk/d6d4e6bc51aef4d865c8 to your computer and use it in GitHub Desktop.
Save opahk/d6d4e6bc51aef4d865c8 to your computer and use it in GitHub Desktop.
code coverage build thresholds
bundle exec cane --no-doc --gte "path/to/coverage/covered_percent,99" --lte "path/to/coverage/missed_lines,28"
class SimpleCov::Formatter::QualityFormatter
def format(result)
SimpleCov::Formatter::HTMLFormatter.new.format(result)
File.open("#{SimpleCov.coverage_dir}/covered_percent", 'w') do |f|
f.puts result.source_files.covered_percent.to_f
end
File.open("#{SimpleCov.coverage_dir}/missed_lines", 'w') do |f|
f.puts result.source_files.missed_lines
end
end
end
SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment