Skip to content

Commit

Permalink
Make Diff dataclasses keyword-only
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Sep 13, 2024
1 parent 70d4495 commit 008b1b7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions coverage_comment/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
# The dataclasses in this module are accessible in the template, which is overridable by the user.
# As a coutesy, we should do our best to keep the existing fields for backward compatibility,
# and if we really can't and can't add properties, at least bump the major version.
@dataclasses.dataclass
@dataclasses.dataclass(kw_only=True)
class CoverageMetadata:
version: str
timestamp: datetime.datetime
branch_coverage: bool
show_contexts: bool


@dataclasses.dataclass
@dataclasses.dataclass(kw_only=True)
class CoverageInfo:
covered_lines: int
num_statements: int
Expand All @@ -35,7 +35,7 @@ class CoverageInfo:
missing_branches: int = 0


@dataclasses.dataclass
@dataclasses.dataclass(kw_only=True)
class FileCoverage:
path: pathlib.Path
executed_lines: list[int]
Expand All @@ -59,7 +59,7 @@ class Coverage:
# Maybe in v4, we can change it to a simpler format.


@dataclasses.dataclass
@dataclasses.dataclass(kw_only=True)
class FileDiffCoverage:
path: pathlib.Path
percent_covered: decimal.Decimal
Expand All @@ -76,7 +76,7 @@ def violation_lines(self) -> list[int]:
return self.missing_statements


@dataclasses.dataclass
@dataclasses.dataclass(kw_only=True)
class DiffCoverage:
total_num_lines: int
total_num_violations: int
Expand Down

0 comments on commit 008b1b7

Please sign in to comment.