code-review-ai-cli 1.3.6__tar.gz → 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/PKG-INFO +2 -25
  2. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/README.md +1 -24
  3. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/code_review_ai_cli.egg-info/PKG-INFO +2 -25
  4. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/pyproject.toml +1 -1
  5. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/tests/test_llm_client.py +10 -10
  6. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/code_review_ai_cli.egg-info/SOURCES.txt +0 -0
  7. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/code_review_ai_cli.egg-info/dependency_links.txt +0 -0
  8. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/code_review_ai_cli.egg-info/entry_points.txt +0 -0
  9. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/code_review_ai_cli.egg-info/requires.txt +0 -0
  10. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/code_review_ai_cli.egg-info/top_level.txt +0 -0
  11. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/setup.cfg +0 -0
  12. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/__init__.py +0 -0
  13. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/ai_review.py +0 -0
  14. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/config.py +0 -0
  15. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/formatter.py +0 -0
  16. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/git_utils.py +0 -0
  17. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/llm_client.py +0 -0
  18. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/prompt_utils.py +0 -0
  19. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/prompts/config.yaml.template +0 -0
  20. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/prompts/review_prompt.md.template +0 -0
  21. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/src/tfs_client.py +0 -0
  22. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/tests/test_ai_review.py +0 -0
  23. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/tests/test_config.py +0 -0
  24. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/tests/test_formatter.py +0 -0
  25. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/tests/test_git_utils.py +0 -0
  26. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/tests/test_prompt_utils.py +0 -0
  27. {code_review_ai_cli-1.3.6 → code_review_ai_cli-2.0.0}/tests/test_tfs_client.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-review-ai-cli
3
- Version: 1.3.6
3
+ Version: 2.0.0
4
4
  Summary: Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests
5
5
  License: MIT
6
6
  Keywords: code-review,ai,azure-devops,tfs,pull-request,llm
@@ -89,19 +89,6 @@ This copies two bundled templates:
89
89
  - **`config.yaml`** — all available options with inline documentation
90
90
  - **`review_prompt.md`** — default review style rules, injected into every LLM prompt
91
91
 
92
- ```text
93
- ✅ config.yaml created at: /home/user/my-project/config.yaml
94
- ✅ review_prompt.md created at: /home/user/my-project/review_prompt.md
95
- Edit them to add your credentials, preferences and review rules.
96
- ```
97
-
98
- If either file already exists you will be prompted individually before it is overwritten:
99
-
100
- ```text
101
- config.yaml already exists in the current directory.
102
- Overwrite? [y/N]
103
- ```
104
-
105
92
  The tool looks for `config.yaml` in the **current working directory** at runtime. You can also pass a different path with `--config`:
106
93
 
107
94
  ```bash
@@ -156,7 +143,7 @@ output:
156
143
  | `diff_only` | Default. Unified diff (changed lines only) + full file content as read-only context. |
157
144
  | `full_code` | All lines of the new file version, every line prefixed with `+`. No baseline. |
158
145
 
159
- #### `diff_only` — diff with full-file context (default)
146
+ #### `diff_only` — diff with context (default)
160
147
 
161
148
  ```yaml
162
149
  review:
@@ -164,16 +151,6 @@ review:
164
151
  scope: full_code
165
152
  ```
166
153
 
167
- When `diff_only` is active, the tool:
168
-
169
- 1. Generates a standard unified diff (added/removed lines with 3 lines of surrounding context) for each changed file.
170
- 2. Appends the **complete new-version file content** as a clearly-marked, read-only context block immediately after the diff for that file:
171
- 3. Strips all context lines and deleted lines (`-`) before sending to the LLM, so only added lines (`+`) and structural headers remain in the diff section.
172
- 4. Instructs the LLM (via the system prompt) to **use the full-file block as read-only background** and to focus the review exclusively on the `+` lines.
173
-
174
- #### `full_code` — entire new file as added lines
175
- Every line of the new file version is prefixed with `+` and sent without a `-` baseline. The LLM receives the complete content and is asked to review only the new code. This is more expensive and slower but may catch issues in unchanged lines that are affected by the changes.
176
-
177
154
  ### Filter by File Extension
178
155
 
179
156
  `file_extensions_filter` works as an **allowlist**: only files with listed extensions are sent to the LLM for review. Remaining files are excluded from the diff before any processing.
@@ -52,19 +52,6 @@ This copies two bundled templates:
52
52
  - **`config.yaml`** — all available options with inline documentation
53
53
  - **`review_prompt.md`** — default review style rules, injected into every LLM prompt
54
54
 
55
- ```text
56
- ✅ config.yaml created at: /home/user/my-project/config.yaml
57
- ✅ review_prompt.md created at: /home/user/my-project/review_prompt.md
58
- Edit them to add your credentials, preferences and review rules.
59
- ```
60
-
61
- If either file already exists you will be prompted individually before it is overwritten:
62
-
63
- ```text
64
- config.yaml already exists in the current directory.
65
- Overwrite? [y/N]
66
- ```
67
-
68
55
  The tool looks for `config.yaml` in the **current working directory** at runtime. You can also pass a different path with `--config`:
69
56
 
70
57
  ```bash
@@ -119,7 +106,7 @@ output:
119
106
  | `diff_only` | Default. Unified diff (changed lines only) + full file content as read-only context. |
120
107
  | `full_code` | All lines of the new file version, every line prefixed with `+`. No baseline. |
121
108
 
122
- #### `diff_only` — diff with full-file context (default)
109
+ #### `diff_only` — diff with context (default)
123
110
 
124
111
  ```yaml
125
112
  review:
@@ -127,16 +114,6 @@ review:
127
114
  scope: full_code
128
115
  ```
129
116
 
130
- When `diff_only` is active, the tool:
131
-
132
- 1. Generates a standard unified diff (added/removed lines with 3 lines of surrounding context) for each changed file.
133
- 2. Appends the **complete new-version file content** as a clearly-marked, read-only context block immediately after the diff for that file:
134
- 3. Strips all context lines and deleted lines (`-`) before sending to the LLM, so only added lines (`+`) and structural headers remain in the diff section.
135
- 4. Instructs the LLM (via the system prompt) to **use the full-file block as read-only background** and to focus the review exclusively on the `+` lines.
136
-
137
- #### `full_code` — entire new file as added lines
138
- Every line of the new file version is prefixed with `+` and sent without a `-` baseline. The LLM receives the complete content and is asked to review only the new code. This is more expensive and slower but may catch issues in unchanged lines that are affected by the changes.
139
-
140
117
  ### Filter by File Extension
141
118
 
142
119
  `file_extensions_filter` works as an **allowlist**: only files with listed extensions are sent to the LLM for review. Remaining files are excluded from the diff before any processing.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-review-ai-cli
3
- Version: 1.3.6
3
+ Version: 2.0.0
4
4
  Summary: Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests
5
5
  License: MIT
6
6
  Keywords: code-review,ai,azure-devops,tfs,pull-request,llm
@@ -89,19 +89,6 @@ This copies two bundled templates:
89
89
  - **`config.yaml`** — all available options with inline documentation
90
90
  - **`review_prompt.md`** — default review style rules, injected into every LLM prompt
91
91
 
92
- ```text
93
- ✅ config.yaml created at: /home/user/my-project/config.yaml
94
- ✅ review_prompt.md created at: /home/user/my-project/review_prompt.md
95
- Edit them to add your credentials, preferences and review rules.
96
- ```
97
-
98
- If either file already exists you will be prompted individually before it is overwritten:
99
-
100
- ```text
101
- config.yaml already exists in the current directory.
102
- Overwrite? [y/N]
103
- ```
104
-
105
92
  The tool looks for `config.yaml` in the **current working directory** at runtime. You can also pass a different path with `--config`:
106
93
 
107
94
  ```bash
@@ -156,7 +143,7 @@ output:
156
143
  | `diff_only` | Default. Unified diff (changed lines only) + full file content as read-only context. |
157
144
  | `full_code` | All lines of the new file version, every line prefixed with `+`. No baseline. |
158
145
 
159
- #### `diff_only` — diff with full-file context (default)
146
+ #### `diff_only` — diff with context (default)
160
147
 
161
148
  ```yaml
162
149
  review:
@@ -164,16 +151,6 @@ review:
164
151
  scope: full_code
165
152
  ```
166
153
 
167
- When `diff_only` is active, the tool:
168
-
169
- 1. Generates a standard unified diff (added/removed lines with 3 lines of surrounding context) for each changed file.
170
- 2. Appends the **complete new-version file content** as a clearly-marked, read-only context block immediately after the diff for that file:
171
- 3. Strips all context lines and deleted lines (`-`) before sending to the LLM, so only added lines (`+`) and structural headers remain in the diff section.
172
- 4. Instructs the LLM (via the system prompt) to **use the full-file block as read-only background** and to focus the review exclusively on the `+` lines.
173
-
174
- #### `full_code` — entire new file as added lines
175
- Every line of the new file version is prefixed with `+` and sent without a `-` baseline. The LLM receives the complete content and is asked to review only the new code. This is more expensive and slower but may catch issues in unchanged lines that are affected by the changes.
176
-
177
154
  ### Filter by File Extension
178
155
 
179
156
  `file_extensions_filter` works as an **allowlist**: only files with listed extensions are sent to the LLM for review. Remaining files are excluded from the diff before any processing.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "code-review-ai-cli"
7
- version = "1.3.6"
7
+ version = "2.0.0"
8
8
  description = "Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -258,9 +258,9 @@ def test_review_omits_custom_instructions_header_when_filter_empties_prompt(mock
258
258
  )
259
259
  config = make_llm_config(custom_prompt_file=str(prompt_file))
260
260
  client = LLMClient(config)
261
- openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value="review text")
261
+ openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value='{"summary": "review text", "comments": []}')
262
262
 
263
- client.review("+code", [{"file": "component.ts", "additions": 1, "deletions": 0}])
263
+ client.review_pr("+code", [{"file": "component.ts", "additions": 1, "deletions": 0}])
264
264
 
265
265
  system_prompt, user_message = openai.call_args.args[:2]
266
266
  assert "Custom user instructions" not in system_prompt
@@ -285,9 +285,9 @@ def test_review_filters_custom_prompt_sections_by_changed_extensions(mocker, tmp
285
285
  )
286
286
  config = make_llm_config(custom_prompt_file=str(prompt_file))
287
287
  client = LLMClient(config)
288
- openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value="review text")
288
+ openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value='{"summary": "review text", "comments": []}')
289
289
 
290
- client.review("+code", [{"file": "app.py", "additions": 1, "deletions": 0}])
290
+ client.review_pr("+code", [{"file": "app.py", "additions": 1, "deletions": 0}])
291
291
 
292
292
  system_prompt, _ = openai.call_args.args[:2]
293
293
  assert "General" in system_prompt
@@ -310,9 +310,9 @@ def test_review_keeps_only_all_sections_when_no_matching_extension(mocker, tmp_p
310
310
  )
311
311
  config = make_llm_config(custom_prompt_file=str(prompt_file))
312
312
  client = LLMClient(config)
313
- openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value="review text")
313
+ openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value='{"summary": "review text", "comments": []}')
314
314
 
315
- client.review("+code", [{"file": "component.ts", "additions": 1, "deletions": 0}])
315
+ client.review_pr("+code", [{"file": "component.ts", "additions": 1, "deletions": 0}])
316
316
 
317
317
  system_prompt, _ = openai.call_args.args[:2]
318
318
  assert "General" in system_prompt
@@ -334,9 +334,9 @@ def test_review_includes_multiple_extension_sections(mocker, tmp_path: Path) ->
334
334
  )
335
335
  config = make_llm_config(custom_prompt_file=str(prompt_file))
336
336
  client = LLMClient(config)
337
- openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value="review text")
337
+ openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value='{"summary": "review text", "comments": []}')
338
338
 
339
- client.review(
339
+ client.review_pr(
340
340
  "+code",
341
341
  [
342
342
  {"file": "foo.component.ts", "additions": 1, "deletions": 0},
@@ -355,9 +355,9 @@ def test_review_without_lang_tags_keeps_full_custom_prompt(mocker, tmp_path: Pat
355
355
  prompt_file.write_text("Always mention tests", encoding="utf-8")
356
356
  config = make_llm_config(custom_prompt_file=str(prompt_file))
357
357
  client = LLMClient(config)
358
- openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value="review text")
358
+ openai = mocker.patch("src.llm_client.LLMClient._call_openai", return_value='{"summary": "review text", "comments": []}')
359
359
 
360
- client.review("+code", [{"file": "a.py", "additions": 1, "deletions": 0}])
360
+ client.review_pr("+code", [{"file": "a.py", "additions": 1, "deletions": 0}])
361
361
 
362
362
  system_prompt, _ = openai.call_args.args[:2]
363
363
  assert "Always mention tests" in system_prompt