Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CodeClimate::TestReporter patched to handle the absence of a .git
require 'simplecov'
require 'codeclimate-test-reporter'
module Extensions
module Git
module ClassMethods
def info
{
head: head,
committed_at: committed_at_or_now,
branch: branch_from_git_or_ci,
}
end
def committed_at_or_now
committed_at || Time.now.to_i
end
end
end
end
CodeClimate::TestReporter::Git.singleton_class.prepend Extensions::Git::ClassMethods
CodeClimate::TestReporter::Formatter.new.format SimpleCov.result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.