Skip to content

Commit

Permalink
Record base kind usage for coverage
Browse files Browse the repository at this point in the history
Reviewed By: dkgi

Differential Revision: D50718253

fbshipit-source-id: b85ed7dfd018ce56fdb9bfbd046f1449d0fd293b
  • Loading branch information
Manuel Fahndrich authored and facebook-github-bot committed Nov 13, 2023
1 parent 2bcb366 commit babda86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sapp/analysis_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Metadata:
# pyre-ignore: we don't have a shape for rules yet.
rules: Dict[int, Any] = dataclasses.field(default_factory=dict)
class_type_intervals_filenames: List[str] = dataclasses.field(default_factory=list)
category_coverage: Dict[str, Any] = dataclasses.field(default_factory=dict)

def merge(self, o: "Metadata") -> "Metadata":
return Metadata(
Expand All @@ -45,6 +46,7 @@ def merge(self, o: "Metadata") -> "Metadata":
rules={**self.rules, **o.rules},
class_type_intervals_filenames=self.class_type_intervals_filenames
+ o.class_type_intervals_filenames,
category_coverage=self.category_coverage, # should all be the same
)


Expand Down Expand Up @@ -156,6 +158,7 @@ def from_directories(cls, directories: List[str]) -> "AnalysisOutput":
project=metadata.get("project"),
rules=rules,
class_type_intervals_filenames=class_type_intervals_filenames,
category_coverage=metadata.get("category_coverage", []),
)
if not main_metadata:
main_metadata = this_metadata
Expand Down Expand Up @@ -213,6 +216,7 @@ def from_directory(cls, directory: str) -> "AnalysisOutput":
project=metadata.get("project"),
rules=rules,
class_type_intervals_filenames=class_type_intervals_filenames,
category_coverage=metadata.get("category_coverage", []),
),
)

Expand Down

0 comments on commit babda86

Please sign in to comment.