File tree Expand file tree Collapse file tree 6 files changed +11
-8
lines changed Expand file tree Collapse file tree 6 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 41
41
uses : actions/setup-python@v5
42
42
with : { python-version: "3.13" }
43
43
- name : Install AI Code Review tool
44
- run : pip install ai-code-review==0.4.0
44
+ run : pip install ai-code-review==0.4.1
45
45
- name : Run AI code review
46
46
env :
47
47
LLM_API_KEY : ${{ secrets.LLM_API_KEY }}
Original file line number Diff line number Diff line change @@ -5,11 +5,10 @@ report_template_md = """
5
5
{{ report.summary }}
6
6
{%- endif %}
7
7
8
- **
9
- {%- if report.total_issues > 0 %}⚠️{% endif -%}
10
- Total issues: `{{ report.total_issues }}`**
8
+ **{%- if report.total_issues > 0 %}⚠️{% endif -%}
9
+ Total issues: `{{ report.total_issues }}`
11
10
{{- ' ' -}}
12
- **reviewed files: `{{ report.issues | count }}`**
11
+ in `{{ report.number_of_processed_files }}` files **
13
12
14
13
{%- for issue in report.plain_issues -%}
15
14
{{"\n "}}## `#{{ issue.id}}` {{ issue.title -}}
@@ -66,7 +65,7 @@ Respond with a valid JSON array of issues in the following format:
66
65
"affected_lines": [ // optional; list of affected lines
67
66
{
68
67
"start_line": <start_line:int>,
69
- "end_line": <end_line:int>
68
+ "end_line": <end_line:int>,
70
69
"proposal": "<proposed code to replace the affected lines (optional)>"
71
70
},
72
71
...
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ async def review(filters: str | list[str] = ""):
106
106
f_lines [i ["start_line" ]: i ["end_line" ]+ 1 ]
107
107
)
108
108
exec (cfg .post_process , {"mc" : mc , ** locals ()})
109
- report = Report (issues = issues )
109
+ report = Report (issues = issues , number_of_processed_files = len ( diff ) )
110
110
report .summary = make_cr_summary (cfg , report , diff )
111
111
report .save ()
112
112
report_text = report .render (cfg , Report .Format .MARKDOWN )
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ class Format(StrEnum):
60
60
61
61
issues : dict = field (default_factory = dict )
62
62
summary : str = field (default = "" )
63
+ number_of_processed_files : int = field (default = 0 )
63
64
total_issues : int = field (init = False )
64
65
created_at : str = field (default_factory = lambda : datetime .now ().strftime ("%Y-%m-%d %H:%M:%S" ))
65
66
model : str = field (default_factory = lambda : mc .config ().MODEL )
Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " ai-code-review"
3
- version = " 0.4.0 "
3
+ version = " 0.4.1 "
4
4
description = " LLM-agnostic GitHub AI Code Review Tool with integration to GitHub actions"
5
5
authors = [" Nayjest <mail@vitaliy.in>" ]
6
6
readme = " README.md"
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ def test_report_save_load(tmp_path):
58
58
]
59
59
},
60
60
"summary" : "SUMMARY" ,
61
+ "number_of_processed_files" : 2 ,
61
62
}
62
63
file_name = tmp_path / "report.json"
63
64
report = Report (** data )
@@ -67,9 +68,11 @@ def test_report_save_load(tmp_path):
67
68
with open (file_name , "r" ) as f :
68
69
loaded = json .load (f )
69
70
assert loaded ["summary" ] == "SUMMARY"
71
+ assert loaded ["number_of_processed_files" ] == 2
70
72
# test reload with .load
71
73
loaded_report = Report .load (file_name )
72
74
assert loaded_report .summary == "SUMMARY"
75
+ assert loaded_report .number_of_processed_files == 2
73
76
assert loaded_report .total_issues == 1
74
77
assert loaded_report .issues ["file.py" ][0 ].title == "Bug"
75
78
You can’t perform that action at this time.
0 commit comments