File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,13 +63,15 @@ def read_bugs() -> list[dict]:
6363 severity = classify_severity (content )
6464 priority = classify_priority (severity )
6565
66- bugs .append ({
67- "id" : f"BUG-{ i + 1 :03} " ,
68- "file" : file_path ,
69- "severity" : severity ,
70- "priority" : priority ,
71- "summary" : content .strip ().split ("\n " )[0 ][:80 ]
72- })
66+ bugs .append (
67+ {
68+ "id" : f"BUG-{ i + 1 :03} " ,
69+ "file" : file_path ,
70+ "severity" : severity ,
71+ "priority" : priority ,
72+ "summary" : content .strip ().split ("\n " )[0 ][:80 ],
73+ }
74+ )
7375 except OSError as e :
7476 print (f"⚠️ Could not read file { file_path } : { e } " )
7577
@@ -87,10 +89,10 @@ def generate_report(bugs: list[dict]) -> None:
8789 return
8890
8991 date = datetime .now (timezone .utc ).strftime ("%Y-%m-%d" )
90-
92+
9193 if not os .path .exists (OUTPUT_PATH ):
9294 os .makedirs (OUTPUT_PATH )
93-
95+
9496 output_file = os .path .join (OUTPUT_PATH , f"bug-triage-{ date } .md" )
9597
9698 p1 = [b for b in bugs if b ["priority" ] == "P1" ]
@@ -111,7 +113,7 @@ def generate_report(bugs: list[dict]) -> None:
111113 f"| P3 | { len (p3 )} |" ,
112114 f"| P4 | { len (p4 )} |" ,
113115 "\n ---\n " ,
114- "## P1 Bugs (Critical)"
116+ "## P1 Bugs (Critical)" ,
115117 ]
116118
117119 for b in p1 :
@@ -133,6 +135,7 @@ def generate_report(bugs: list[dict]) -> None:
133135
134136if __name__ == "__main__" :
135137 import doctest
138+
136139 doctest .testmod ()
137140 extracted_bugs = read_bugs ()
138141 generate_report (extracted_bugs )
You can’t perform that action at this time.
0 commit comments