Skip to content

Commit

Permalink
Add doc
Browse files Browse the repository at this point in the history
Signed-off-by: hoangtungdinh <[email protected]>
  • Loading branch information
hoangtungdinh committed Sep 16, 2024
1 parent 71e5dd1 commit 603f87b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions qc_baselib/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ def load_from_file(self, xml_file_path: str, override: bool = False) -> None:
self._report_results = result.CheckerResults.from_xml(xml_text)

def write_to_file(self, xml_output_file_path: str, generate_summary=False) -> None:
"""
generate_summary : bool
Automatically generate a summary for each checker and checker bundle.
The generated summary will be appended to the current summary.
"""
if self._report_results is None:
raise RuntimeError(
"Report dump with empty report, the report needs to be loaded first"
Expand Down Expand Up @@ -216,6 +221,10 @@ def _generate_checker_summary(self) -> None:
def add_checker_bundle_summary(
self, checker_bundle_name: str, content: str
) -> None:
"""
Add content to the existing summary of a checker bundle.
The content will be appended to the current summary.
"""
bundle = self._get_checker_bundle(checker_bundle_name)
if bundle.summary == "":
bundle.summary = content
Expand All @@ -225,6 +234,10 @@ def add_checker_bundle_summary(
def add_checker_summary(
self, checker_bundle_name: str, checker_id: str, content: str
) -> None:
"""
Add content to the existing summary of a checker.
The content will be appended to the current summary.
"""
bundle = self._get_checker_bundle(checker_bundle_name)
checker = self._get_checker(bundle, checker_id)
if checker.summary == "":
Expand Down

0 comments on commit 603f87b

Please sign in to comment.