Skip to content

Commit

Permalink
Don't add empty classes
Browse files Browse the repository at this point in the history
XML nodes were being added for empty class lists when they didn't need to be. This was causing issues for some parsers when trying to parse them empty class list. This commit simply ommits a package if it has no applicable files
  • Loading branch information
growpathjadamson committed May 4, 2021
1 parent 9c07643 commit 8266fa1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/simplecov-cobertura.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def result_to_xml(result)
end

groups.map do |name, files|
next if files.empty?
packages.add_element(package = REXML::Element.new('package'))
set_package_attributes(package, name, files)

Expand Down

0 comments on commit 8266fa1

Please sign in to comment.