ai-cr 0.6.0__py3-none-any.whl → 1.0.0__py3-none-any.whl
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.
- ai_code_review/.ai-code-review.toml +11 -6
- ai_code_review/cli.py +3 -1
- ai_code_review/commands/repl.py +22 -0
- {ai_cr-0.6.0.dist-info → ai_cr-1.0.0.dist-info}/METADATA +43 -10
- {ai_cr-0.6.0.dist-info → ai_cr-1.0.0.dist-info}/RECORD +8 -7
- {ai_cr-0.6.0.dist-info → ai_cr-1.0.0.dist-info}/LICENSE +0 -0
- {ai_cr-0.6.0.dist-info → ai_cr-1.0.0.dist-info}/WHEEL +0 -0
- {ai_cr-0.6.0.dist-info → ai_cr-1.0.0.dist-info}/entry_points.txt +0 -0
@@ -38,21 +38,23 @@ prompt = """
|
|
38
38
|
----TASK----
|
39
39
|
Review the provided code diff carefully and identify *only* highly confident issues which are relevant to any code context.
|
40
40
|
|
41
|
-
----
|
41
|
+
----CODEBASE CHANGES TO REVIEW----
|
42
42
|
{{ input }}
|
43
43
|
--------
|
44
44
|
|
45
45
|
{% if file_lines -%}
|
46
|
-
----ADDITIONAL CONTEXT----
|
46
|
+
----ADDITIONAL CONTEXT: FULL FILE CONTENT AFTER APPLYING REVIEWED CHANGES----
|
47
47
|
{{ file_lines }}
|
48
48
|
{%- endif %}
|
49
49
|
|
50
50
|
----TASK GUIDELINES----
|
51
51
|
- Only report issues you are **100% confident** are relevant to any context.
|
52
|
+
- Never report issues about using software versions that have not yet been released.
|
52
53
|
- Only include issues that are **significantly valuable** to the maintainers (e.g., bugs, security flaws, or clear maintainability concerns).
|
53
54
|
- Do **not** report vague, theoretical, or overly generic advice.
|
54
55
|
- Do **not** report anything with medium or lower confidence.
|
55
|
-
- Typographical errors have highest severity
|
56
|
+
- Typographical errors have highest severity.
|
57
|
+
{{ requirements -}}
|
56
58
|
{{ json_requirements }}
|
57
59
|
|
58
60
|
Respond with a valid JSON array of issues in the following format:
|
@@ -124,8 +126,9 @@ If code changes contains exceptional achievements, you may additionally present
|
|
124
126
|
--Available Awards--
|
125
127
|
{{ awards }}
|
126
128
|
---
|
127
|
-
Your response will be parsed programmatically, so do not include any additional text.
|
128
|
-
Use Markdown formatting in your response.
|
129
|
+
- Your response will be parsed programmatically, so do not include any additional text.
|
130
|
+
- Use Markdown formatting in your response.
|
131
|
+
{{ summary_requirements -}}
|
129
132
|
"""
|
130
133
|
|
131
134
|
[prompt_vars]
|
@@ -303,4 +306,6 @@ restored lost knowledge and now bestow it upon a new generation."
|
|
303
306
|
decorators add depth and texture, and observer masterfully completes the composition.
|
304
307
|
The Gang of Four gives a standing ovation from the stalls."
|
305
308
|
```
|
306
|
-
"""
|
309
|
+
"""
|
310
|
+
requirements = ""
|
311
|
+
summary_requirements = ""
|
ai_code_review/cli.py
CHANGED
@@ -32,7 +32,9 @@ def main():
|
|
32
32
|
|
33
33
|
|
34
34
|
@app.callback(invoke_without_command=True)
|
35
|
-
def cli(ctx: typer.Context):
|
35
|
+
def cli(ctx: typer.Context, verbose: bool = typer.Option(default=False)):
|
36
|
+
if verbose:
|
37
|
+
mc.logging.LoggingConfig.STRIP_REQUEST_LINES = None
|
36
38
|
if ctx.invoked_subcommand != "setup":
|
37
39
|
bootstrap()
|
38
40
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"""
|
2
|
+
Python REPL
|
3
|
+
"""
|
4
|
+
# flake8: noqa: F401
|
5
|
+
import code
|
6
|
+
from ema.cli import app
|
7
|
+
|
8
|
+
# Imports for usage in REPL
|
9
|
+
import os
|
10
|
+
import sys
|
11
|
+
from dataclasses import dataclass
|
12
|
+
from datetime import datetime
|
13
|
+
from enum import Enum
|
14
|
+
from time import time
|
15
|
+
from rich.pretty import pprint
|
16
|
+
|
17
|
+
import microcore as mc
|
18
|
+
from microcore import ui
|
19
|
+
|
20
|
+
@app.command(help="python REPL")
|
21
|
+
def repl():
|
22
|
+
code.interact(local=globals())
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: ai-cr
|
3
|
-
Version: 0.
|
3
|
+
Version: 1.0.0
|
4
4
|
Summary: LLM-agnostic GitHub AI Code Review Tool with integration to GitHub actions
|
5
5
|
License: MIT
|
6
6
|
Keywords: static code analysis,code review,code quality,ai,coding,assistant,llm,github,automation,devops,developer tools,github actions,workflows,git
|
@@ -70,7 +70,7 @@ jobs:
|
|
70
70
|
uses: actions/setup-python@v5
|
71
71
|
with: { python-version: "3.13" }
|
72
72
|
- name: Install AI Code Review tool
|
73
|
-
run: pip install ai-code-review
|
73
|
+
run: pip install ai-code-review~=1.0
|
74
74
|
- name: Run AI code analysis
|
75
75
|
env:
|
76
76
|
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
|
@@ -84,7 +84,7 @@ jobs:
|
|
84
84
|
with:
|
85
85
|
name: ai-code-review-results
|
86
86
|
path: |
|
87
|
-
code-review-report.
|
87
|
+
code-review-report.md
|
88
88
|
code-review-report.json
|
89
89
|
```
|
90
90
|
|
@@ -94,25 +94,56 @@ jobs:
|
|
94
94
|
PRs to your repository will now receive AI code reviews automatically. ✨
|
95
95
|
See [GitHub Setup Guide](https://github.com/Nayjest/ai-code-review/blob/main/documentation/github_setup.md) for more details.
|
96
96
|
|
97
|
-
### 2.
|
97
|
+
### 2. Running Code Analysis Locally
|
98
98
|
|
99
|
-
|
99
|
+
#### Initial Local Setup
|
100
100
|
|
101
|
+
**Prerequisites:** [Python](https://www.python.org/downloads/) 3.11 / 3.12 / 3.13
|
102
|
+
|
103
|
+
**Step1:** Install [ai-code-review](https://github.com/Nayjest/ai-code-review) using [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)).
|
101
104
|
```bash
|
102
|
-
# Prerequisites: Python 3.11+
|
103
105
|
pip install ai-code-review
|
106
|
+
```
|
107
|
+
|
108
|
+
> **Troubleshooting:**
|
109
|
+
> pip may be also available via cli as `pip3` depending on your Python installation.
|
110
|
+
|
111
|
+
**Step2:** Perform initial setup
|
104
112
|
|
105
|
-
|
113
|
+
The following command will perform one-time setup using an interactive wizard.
|
114
|
+
You will be prompted to enter LLM configuration details (API type, API key, etc).
|
115
|
+
Configuration will be saved to ~/.env.ai-code-review.
|
116
|
+
|
117
|
+
```bash
|
106
118
|
ai-code-review setup
|
119
|
+
```
|
120
|
+
|
121
|
+
> **Troubleshooting:**
|
122
|
+
> On some systems, `ai-code-review` command may not became available immediately after installation.
|
123
|
+
> Try restarting your terminal or running `python -m ai_code_review` instead.
|
107
124
|
|
108
|
-
|
125
|
+
|
126
|
+
#### Perform your first AI code review locally
|
127
|
+
|
128
|
+
**Step1:** Navigate to your repository root directory.
|
129
|
+
**Step2:** Switch to the branch you want to review.
|
130
|
+
**Step3:** Run following command
|
131
|
+
```bash
|
109
132
|
ai-code-review
|
110
133
|
```
|
111
134
|
|
112
|
-
|
135
|
+
> **Note:** This will analyze the current branch against the repository main branch by default.
|
136
|
+
> Files that are not staged for commit will be ignored.
|
137
|
+
> See `ai-code-review --help` for more options.
|
138
|
+
|
139
|
+
**Reviewing remote repository**
|
113
140
|
|
114
141
|
```bash
|
115
|
-
ai-code-review remote
|
142
|
+
ai-code-review remote git@github.com:owner/repo.git <FEATURE_BRANCH>..<MAIN_BRANCH>
|
143
|
+
```
|
144
|
+
Use interactive help for details:
|
145
|
+
```bash
|
146
|
+
ai-code-review remote --help
|
116
147
|
```
|
117
148
|
|
118
149
|
## 🔧 Configuration
|
@@ -129,6 +160,8 @@ You can override the default config by placing `.ai-code-review.toml` in your re
|
|
129
160
|
|
130
161
|
See default configuration [here](https://github.com/Nayjest/ai-code-review/blob/main/ai_code_review/.ai-code-review.toml).
|
131
162
|
|
163
|
+
More details can be found in [📖 Configuration Cookbook](https://github.com/Nayjest/ai-code-review/blob/main/documentation/config_cookbook.md)
|
164
|
+
|
132
165
|
## 💻 Development Setup
|
133
166
|
|
134
167
|
Install dependencies:
|
@@ -1,15 +1,16 @@
|
|
1
|
-
ai_code_review/.ai-code-review.toml,sha256=
|
1
|
+
ai_code_review/.ai-code-review.toml,sha256=sIQt7VJWl937VLocF2Vg6bC4qGbHeBgyKF6Bj3XKwIk,10640
|
2
2
|
ai_code_review/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
ai_code_review/__main__.py,sha256=EClCwCzb6h6YBpt0hrnG4h0mlNhNePyg_xBNNSVm1os,65
|
4
4
|
ai_code_review/bootstrap.py,sha256=jqioR_UtTsn5nXezmjMLU3aB8tzlVz73ZRBk33ud5F4,2336
|
5
|
-
ai_code_review/cli.py,sha256=
|
5
|
+
ai_code_review/cli.py,sha256=9OWQP2voQOfrhVfJsCzP-nQ9RtLU1cHhMi81QY56vzc,7441
|
6
|
+
ai_code_review/commands/repl.py,sha256=Ms5p6vgcf0EBAUUWKQfJu3X9XFvzJXB018qcvSiJ-oI,396
|
6
7
|
ai_code_review/constants.py,sha256=K9mNxTq9seTG3aVm__3r1lXb5oCOQjH24Cl3hfX9FsE,281
|
7
8
|
ai_code_review/core.py,sha256=BJNs4ZER2-bMulXY2apY6B6hI0nvRCOrLqsJ7L8Bizc,6693
|
8
9
|
ai_code_review/project_config.py,sha256=RDbplmncALKw0zgqSG8POofi300z0DPvtF33wt7_1Sk,3651
|
9
10
|
ai_code_review/report_struct.py,sha256=N-EnNMwBY9LyJ9sdFHpUzn2fwBvxo5TZYYiJagBl8Po,3488
|
10
11
|
ai_code_review/utils.py,sha256=vlzU3M89qK6_mVkBMnppZaOFsXddVsIBVdfmbN3cxDY,2939
|
11
|
-
ai_cr-0.
|
12
|
-
ai_cr-0.
|
13
|
-
ai_cr-0.
|
14
|
-
ai_cr-0.
|
15
|
-
ai_cr-0.
|
12
|
+
ai_cr-1.0.0.dist-info/entry_points.txt,sha256=u0N5NroPYEGqmDGaGqFmiijJ5swzpe7EyKBupnkp1FY,49
|
13
|
+
ai_cr-1.0.0.dist-info/LICENSE,sha256=XATf3zv-CppUSJqI18KLhwnPEomUXEl5WbBzFyb9OSU,1096
|
14
|
+
ai_cr-1.0.0.dist-info/METADATA,sha256=SPJm5aNOWFdwCI7KxtDE2AspsP2Kdn5NLwV6DeBJIeg,7109
|
15
|
+
ai_cr-1.0.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
16
|
+
ai_cr-1.0.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|