Skip to content

Commit

Permalink
fix(cobertura): handle files without coverage gracefully (#266)
Browse files Browse the repository at this point in the history
Signed-off-by: eran-gil2 <[email protected]>
  • Loading branch information
eran-gil2 authored Nov 29, 2024
1 parent 15646de commit 0626e7f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cobertura/opa_coverage_to_cobertura.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def generate_package(coverage: OPACoverage) -> ET.Element:
package.append(classes)
for path, data in coverage.files.items():
if isinstance(data, dict):
data["coverage"] = data.get("coverage", 0)
data = FileCoverage(**data)
class_data = ET.Element("class", attrib={
"complexity": "0",
Expand Down

0 comments on commit 0626e7f

Please sign in to comment.