@@ -19,7 +19,7 @@ def default(self, obj):
19
19
return json .JSONEncoder .default (self , obj )
20
20
21
21
22
- def as_json (
22
+ def json (
23
23
results : List [Commit ],
24
24
advisory_record : AdvisoryRecord ,
25
25
filename : str = "prospector-report.json" ,
@@ -38,7 +38,7 @@ def as_json(
38
38
return fn
39
39
40
40
41
- def as_html (
41
+ def html (
42
42
results : List [Commit ],
43
43
advisory_record : AdvisoryRecord ,
44
44
filename : str = "prospector-report.html" ,
@@ -47,14 +47,11 @@ def as_html(
47
47
fn = filename if filename .endswith (".html" ) else f"{ filename } .html"
48
48
49
49
annotations_count = {}
50
- # annotation: Commit
51
- # Match number per rules
50
+
52
51
for commit in results :
53
52
for rule in commit .matched_rules :
54
53
id = rule .get ("id" )
55
54
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
58
55
59
56
logger .info (f"Writing results to { fn } " )
60
57
environment = jinja2 .Environment (
@@ -77,9 +74,7 @@ def as_html(
77
74
return fn
78
75
79
76
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 ):
83
78
def format_annotations (commit : Commit ) -> str :
84
79
out = ""
85
80
if verbose :
0 commit comments