dashingrocket / simplecov-cobertura

Ruby SimpleCov Cobertura Formatter
Apache License 2.0
52 stars 38 forks source link

Add support for custom report filename #26

Closed jeremiemv closed 2 years ago

jeremiemv commented 2 years ago

What This PR add support for custom report filenames.

Why We use Codacy and there reporter is expecting a filename of cobertura.xml https://github.com/codacy/codacy-coverage-reporter/blob/a6b918179125a474d1ea0b0b581859920348cfba/src/main/scala/com/codacy/rules/ReportRules.scala#L210

My hack for the longest time has been to redefine the constant.

  SimpleCov::Formatter::CoberturaFormatter::RESULT_FILE_NAME = "cobertura.xml".freeze
  SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter

It works but ruby complains...

/app/vendor/bundle/ruby/3.0.0/gems/simplecov-cobertura-2.0.0/lib/simplecov-cobertura.rb:12: warning: previous definition of RESULT_FILE_NAME was here
jessebs commented 2 years ago

Thank you for your contribution. I'll release a new version later this week with your change.

jeremiemv commented 2 years ago

Thanks for your useful gem @jessebs