Skip to content

Commit 72e5ff0

Browse files
sacca97copernico
authored andcommitted
renamed report methods
1 parent d4029ef commit 72e5ff0

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

prospector/client/cli/report.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def default(self, obj):
1919
return json.JSONEncoder.default(self, obj)
2020

2121

22-
def as_json(
22+
def json(
2323
results: List[Commit],
2424
advisory_record: AdvisoryRecord,
2525
filename: str = "prospector-report.json",
@@ -38,7 +38,7 @@ def as_json(
3838
return fn
3939

4040

41-
def as_html(
41+
def html(
4242
results: List[Commit],
4343
advisory_record: AdvisoryRecord,
4444
filename: str = "prospector-report.html",
@@ -47,14 +47,11 @@ def as_html(
4747
fn = filename if filename.endswith(".html") else f"{filename}.html"
4848

4949
annotations_count = {}
50-
# annotation: Commit
51-
# Match number per rules
50+
5251
for commit in results:
5352
for rule in commit.matched_rules:
5453
id = rule.get("id")
5554
annotations_count[id] = annotations_count.get(id, 0) + 1
56-
# for annotation in commit.annotations.keys():
57-
# annotations_count[annotation] = annotations_count.get(annotation, 0) + 1
5855

5956
logger.info(f"Writing results to {fn}")
6057
environment = jinja2.Environment(
@@ -77,9 +74,7 @@ def as_html(
7774
return fn
7875

7976

80-
def report_on_console(
81-
results: List[Commit], advisory_record: AdvisoryRecord, verbose=False
82-
):
77+
def console(results: List[Commit], advisory_record: AdvisoryRecord, verbose=False):
8378
def format_annotations(commit: Commit) -> str:
8479
out = ""
8580
if verbose:

0 commit comments

Comments
 (0)