code-review-ai-cli 2.0.1__tar.gz → 2.2.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.
- code_review_ai_cli-2.2.0/PKG-INFO +146 -0
- code_review_ai_cli-2.2.0/README.md +106 -0
- code_review_ai_cli-2.2.0/code_review_ai_cli.egg-info/PKG-INFO +146 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/code_review_ai_cli.egg-info/SOURCES.txt +2 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/code_review_ai_cli.egg-info/requires.txt +4 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/pyproject.toml +3 -1
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/ai_review.py +3 -12
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/config.py +9 -1
- code_review_ai_cli-2.2.0/src/context_extractor.py +728 -0
- code_review_ai_cli-2.2.0/src/git_utils.py +279 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/llm_client.py +118 -30
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/prompt_utils.py +2 -2
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/prompts/config.yaml.template +17 -1
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/prompts/review_prompt.md.template +0 -6
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/tfs_client.py +81 -89
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/tests/test_config.py +386 -360
- code_review_ai_cli-2.2.0/tests/test_context_extractor.py +573 -0
- code_review_ai_cli-2.2.0/tests/test_git_utils.py +156 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/tests/test_llm_client.py +16 -9
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/tests/test_tfs_client.py +124 -38
- code_review_ai_cli-2.0.1/PKG-INFO +0 -419
- code_review_ai_cli-2.0.1/README.md +0 -382
- code_review_ai_cli-2.0.1/code_review_ai_cli.egg-info/PKG-INFO +0 -419
- code_review_ai_cli-2.0.1/src/git_utils.py +0 -518
- code_review_ai_cli-2.0.1/tests/test_git_utils.py +0 -334
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/code_review_ai_cli.egg-info/dependency_links.txt +0 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/code_review_ai_cli.egg-info/entry_points.txt +0 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/code_review_ai_cli.egg-info/top_level.txt +0 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/setup.cfg +0 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/__init__.py +0 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/src/formatter.py +0 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/tests/test_ai_review.py +0 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/tests/test_formatter.py +0 -0
- {code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/tests/test_prompt_utils.py +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: code-review-ai-cli
|
|
3
|
+
Version: 2.2.0
|
|
4
|
+
Summary: Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: code-review,ai,azure-devops,tfs,pull-request,llm
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: requests>=2.28.0
|
|
19
|
+
Requires-Dist: PyYAML>=6.0
|
|
20
|
+
Provides-Extra: bedrock
|
|
21
|
+
Requires-Dist: boto3>=1.34.0; extra == "bedrock"
|
|
22
|
+
Provides-Extra: openai
|
|
23
|
+
Requires-Dist: openai>=1.0.0; extra == "openai"
|
|
24
|
+
Provides-Extra: gemini
|
|
25
|
+
Requires-Dist: google-generativeai>=0.3.0; extra == "gemini"
|
|
26
|
+
Provides-Extra: claude
|
|
27
|
+
Requires-Dist: anthropic>=0.18.0; extra == "claude"
|
|
28
|
+
Provides-Extra: tree-sitter
|
|
29
|
+
Requires-Dist: tree-sitter-languages>=1.10.2; extra == "tree-sitter"
|
|
30
|
+
Provides-Extra: all
|
|
31
|
+
Requires-Dist: boto3>=1.34.0; extra == "all"
|
|
32
|
+
Requires-Dist: openai>=1.0.0; extra == "all"
|
|
33
|
+
Requires-Dist: google-generativeai>=0.3.0; extra == "all"
|
|
34
|
+
Requires-Dist: anthropic>=0.18.0; extra == "all"
|
|
35
|
+
Requires-Dist: tree-sitter-languages>=1.10.2; extra == "all"
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest>=8.3.0; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
|
|
40
|
+
|
|
41
|
+
# AI Code Review
|
|
42
|
+
|
|
43
|
+
AI Code Review is an automated AI-powered code review CLI, compatible with various LLM providers, designed for integration with Azure DevOps, whether in the cloud or on-premises. It allows you to run a review on demand or as part of a pipeline triggered before a commit or when a pull request is created.
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- AI Pull Request review (`pr-review`)
|
|
48
|
+
- Structured PR comments (inline + general summary)
|
|
49
|
+
- `dry-run` mode to validate without posting
|
|
50
|
+
- PR listing with filters (`list-prs`)
|
|
51
|
+
- Configuration exclusively via `config.yaml`
|
|
52
|
+
- Providers LLM: OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
|
|
53
|
+
- Diff filtering by **excluded path prefixes** (`excluded_paths`) and/or **file extensions** (`file_extensions_filter`)
|
|
54
|
+
|
|
55
|
+
## Documentation
|
|
56
|
+
|
|
57
|
+
- [Configuration Guide](docs/configuration.md) - Details on YAML parameters and settings.
|
|
58
|
+
- [Commands Reference](docs/commands.md) - Complete list of CLI commands and arguments.
|
|
59
|
+
- [Execution Flow](docs/execution_flow.md) - Mermaid diagram of the application's lifecycle.
|
|
60
|
+
- [Troubleshooting](docs/troubleshooting.md) - Common issues and solutions.
|
|
61
|
+
|
|
62
|
+
## Output Review Format
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
Install from PyPI:
|
|
69
|
+
s
|
|
70
|
+
```bash
|
|
71
|
+
pip install code-review-ai-cli
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
After installing the package, generate ready-to-edit configuration files in your working directory:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
ai-review init
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This copies two bundled templates:
|
|
81
|
+
|
|
82
|
+
- **`config.yaml`** — all available options with inline documentation
|
|
83
|
+
- **`review_prompt.md`** — default review style rules, injected into every LLM prompt
|
|
84
|
+
|
|
85
|
+
The tool looks for `config.yaml` in the **current working directory** at runtime. You can also pass a different path with `--config`:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
ai-review pr-review --config ~/configs/ai-review.yaml
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
If you plan to run the test suite locally, also install development dependencies:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip install "code-review-ai-cli[dev]"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Minimal Example
|
|
98
|
+
|
|
99
|
+
Example `config.yaml`:
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
llm:
|
|
103
|
+
provider: openai
|
|
104
|
+
model: gpt-4o
|
|
105
|
+
|
|
106
|
+
openai:
|
|
107
|
+
api_key: sk-xxxx
|
|
108
|
+
|
|
109
|
+
tfs:
|
|
110
|
+
base_url: https://dev.azure.com/your-organization
|
|
111
|
+
project: ProjectName
|
|
112
|
+
pat: xxxxxxxxx
|
|
113
|
+
verify_ssl: true
|
|
114
|
+
# ca_bundle: C:/certs/corporate-root-ca.pem
|
|
115
|
+
|
|
116
|
+
review:
|
|
117
|
+
verbosity: detailed
|
|
118
|
+
scope: diff_only
|
|
119
|
+
custom_prompt_file: review_prompt.md
|
|
120
|
+
# file limit sent to the LLM
|
|
121
|
+
max_diff_files: 50
|
|
122
|
+
# per-file limit
|
|
123
|
+
max_diff_lines: 2000
|
|
124
|
+
# extension allowlist (empty list = all files)
|
|
125
|
+
file_extensions_filter: [".cs", ".ts", ".py"]
|
|
126
|
+
# exclude path prefixes from the diff (applied before file_extensions_filter)
|
|
127
|
+
# leading slash is optional; add trailing slash for exact folder boundary
|
|
128
|
+
excluded_paths: ["libs/generated"]
|
|
129
|
+
|
|
130
|
+
pr:
|
|
131
|
+
auto_post_comments: false
|
|
132
|
+
dry_run: false
|
|
133
|
+
comment_mode: structured
|
|
134
|
+
|
|
135
|
+
output:
|
|
136
|
+
format: terminal
|
|
137
|
+
file: ""
|
|
138
|
+
color: true
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Available VS Code Tasks
|
|
142
|
+
|
|
143
|
+
- `AI Review: Pull Request (Interactive)`
|
|
144
|
+
- `AI Review: PR (Dry-Run)`
|
|
145
|
+
- `AI Review: List Active PRs`
|
|
146
|
+
- `AI Review: Interactive Mode`
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# AI Code Review
|
|
2
|
+
|
|
3
|
+
AI Code Review is an automated AI-powered code review CLI, compatible with various LLM providers, designed for integration with Azure DevOps, whether in the cloud or on-premises. It allows you to run a review on demand or as part of a pipeline triggered before a commit or when a pull request is created.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- AI Pull Request review (`pr-review`)
|
|
8
|
+
- Structured PR comments (inline + general summary)
|
|
9
|
+
- `dry-run` mode to validate without posting
|
|
10
|
+
- PR listing with filters (`list-prs`)
|
|
11
|
+
- Configuration exclusively via `config.yaml`
|
|
12
|
+
- Providers LLM: OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
|
|
13
|
+
- Diff filtering by **excluded path prefixes** (`excluded_paths`) and/or **file extensions** (`file_extensions_filter`)
|
|
14
|
+
|
|
15
|
+
## Documentation
|
|
16
|
+
|
|
17
|
+
- [Configuration Guide](docs/configuration.md) - Details on YAML parameters and settings.
|
|
18
|
+
- [Commands Reference](docs/commands.md) - Complete list of CLI commands and arguments.
|
|
19
|
+
- [Execution Flow](docs/execution_flow.md) - Mermaid diagram of the application's lifecycle.
|
|
20
|
+
- [Troubleshooting](docs/troubleshooting.md) - Common issues and solutions.
|
|
21
|
+
|
|
22
|
+
## Output Review Format
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Install from PyPI:
|
|
29
|
+
s
|
|
30
|
+
```bash
|
|
31
|
+
pip install code-review-ai-cli
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
After installing the package, generate ready-to-edit configuration files in your working directory:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
ai-review init
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
This copies two bundled templates:
|
|
41
|
+
|
|
42
|
+
- **`config.yaml`** — all available options with inline documentation
|
|
43
|
+
- **`review_prompt.md`** — default review style rules, injected into every LLM prompt
|
|
44
|
+
|
|
45
|
+
The tool looks for `config.yaml` in the **current working directory** at runtime. You can also pass a different path with `--config`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ai-review pr-review --config ~/configs/ai-review.yaml
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If you plan to run the test suite locally, also install development dependencies:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install "code-review-ai-cli[dev]"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Minimal Example
|
|
58
|
+
|
|
59
|
+
Example `config.yaml`:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
llm:
|
|
63
|
+
provider: openai
|
|
64
|
+
model: gpt-4o
|
|
65
|
+
|
|
66
|
+
openai:
|
|
67
|
+
api_key: sk-xxxx
|
|
68
|
+
|
|
69
|
+
tfs:
|
|
70
|
+
base_url: https://dev.azure.com/your-organization
|
|
71
|
+
project: ProjectName
|
|
72
|
+
pat: xxxxxxxxx
|
|
73
|
+
verify_ssl: true
|
|
74
|
+
# ca_bundle: C:/certs/corporate-root-ca.pem
|
|
75
|
+
|
|
76
|
+
review:
|
|
77
|
+
verbosity: detailed
|
|
78
|
+
scope: diff_only
|
|
79
|
+
custom_prompt_file: review_prompt.md
|
|
80
|
+
# file limit sent to the LLM
|
|
81
|
+
max_diff_files: 50
|
|
82
|
+
# per-file limit
|
|
83
|
+
max_diff_lines: 2000
|
|
84
|
+
# extension allowlist (empty list = all files)
|
|
85
|
+
file_extensions_filter: [".cs", ".ts", ".py"]
|
|
86
|
+
# exclude path prefixes from the diff (applied before file_extensions_filter)
|
|
87
|
+
# leading slash is optional; add trailing slash for exact folder boundary
|
|
88
|
+
excluded_paths: ["libs/generated"]
|
|
89
|
+
|
|
90
|
+
pr:
|
|
91
|
+
auto_post_comments: false
|
|
92
|
+
dry_run: false
|
|
93
|
+
comment_mode: structured
|
|
94
|
+
|
|
95
|
+
output:
|
|
96
|
+
format: terminal
|
|
97
|
+
file: ""
|
|
98
|
+
color: true
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Available VS Code Tasks
|
|
102
|
+
|
|
103
|
+
- `AI Review: Pull Request (Interactive)`
|
|
104
|
+
- `AI Review: PR (Dry-Run)`
|
|
105
|
+
- `AI Review: List Active PRs`
|
|
106
|
+
- `AI Review: Interactive Mode`
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: code-review-ai-cli
|
|
3
|
+
Version: 2.2.0
|
|
4
|
+
Summary: Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: code-review,ai,azure-devops,tfs,pull-request,llm
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: requests>=2.28.0
|
|
19
|
+
Requires-Dist: PyYAML>=6.0
|
|
20
|
+
Provides-Extra: bedrock
|
|
21
|
+
Requires-Dist: boto3>=1.34.0; extra == "bedrock"
|
|
22
|
+
Provides-Extra: openai
|
|
23
|
+
Requires-Dist: openai>=1.0.0; extra == "openai"
|
|
24
|
+
Provides-Extra: gemini
|
|
25
|
+
Requires-Dist: google-generativeai>=0.3.0; extra == "gemini"
|
|
26
|
+
Provides-Extra: claude
|
|
27
|
+
Requires-Dist: anthropic>=0.18.0; extra == "claude"
|
|
28
|
+
Provides-Extra: tree-sitter
|
|
29
|
+
Requires-Dist: tree-sitter-languages>=1.10.2; extra == "tree-sitter"
|
|
30
|
+
Provides-Extra: all
|
|
31
|
+
Requires-Dist: boto3>=1.34.0; extra == "all"
|
|
32
|
+
Requires-Dist: openai>=1.0.0; extra == "all"
|
|
33
|
+
Requires-Dist: google-generativeai>=0.3.0; extra == "all"
|
|
34
|
+
Requires-Dist: anthropic>=0.18.0; extra == "all"
|
|
35
|
+
Requires-Dist: tree-sitter-languages>=1.10.2; extra == "all"
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest>=8.3.0; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
39
|
+
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
|
|
40
|
+
|
|
41
|
+
# AI Code Review
|
|
42
|
+
|
|
43
|
+
AI Code Review is an automated AI-powered code review CLI, compatible with various LLM providers, designed for integration with Azure DevOps, whether in the cloud or on-premises. It allows you to run a review on demand or as part of a pipeline triggered before a commit or when a pull request is created.
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- AI Pull Request review (`pr-review`)
|
|
48
|
+
- Structured PR comments (inline + general summary)
|
|
49
|
+
- `dry-run` mode to validate without posting
|
|
50
|
+
- PR listing with filters (`list-prs`)
|
|
51
|
+
- Configuration exclusively via `config.yaml`
|
|
52
|
+
- Providers LLM: OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
|
|
53
|
+
- Diff filtering by **excluded path prefixes** (`excluded_paths`) and/or **file extensions** (`file_extensions_filter`)
|
|
54
|
+
|
|
55
|
+
## Documentation
|
|
56
|
+
|
|
57
|
+
- [Configuration Guide](docs/configuration.md) - Details on YAML parameters and settings.
|
|
58
|
+
- [Commands Reference](docs/commands.md) - Complete list of CLI commands and arguments.
|
|
59
|
+
- [Execution Flow](docs/execution_flow.md) - Mermaid diagram of the application's lifecycle.
|
|
60
|
+
- [Troubleshooting](docs/troubleshooting.md) - Common issues and solutions.
|
|
61
|
+
|
|
62
|
+
## Output Review Format
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
Install from PyPI:
|
|
69
|
+
s
|
|
70
|
+
```bash
|
|
71
|
+
pip install code-review-ai-cli
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
After installing the package, generate ready-to-edit configuration files in your working directory:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
ai-review init
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This copies two bundled templates:
|
|
81
|
+
|
|
82
|
+
- **`config.yaml`** — all available options with inline documentation
|
|
83
|
+
- **`review_prompt.md`** — default review style rules, injected into every LLM prompt
|
|
84
|
+
|
|
85
|
+
The tool looks for `config.yaml` in the **current working directory** at runtime. You can also pass a different path with `--config`:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
ai-review pr-review --config ~/configs/ai-review.yaml
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
If you plan to run the test suite locally, also install development dependencies:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pip install "code-review-ai-cli[dev]"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Minimal Example
|
|
98
|
+
|
|
99
|
+
Example `config.yaml`:
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
llm:
|
|
103
|
+
provider: openai
|
|
104
|
+
model: gpt-4o
|
|
105
|
+
|
|
106
|
+
openai:
|
|
107
|
+
api_key: sk-xxxx
|
|
108
|
+
|
|
109
|
+
tfs:
|
|
110
|
+
base_url: https://dev.azure.com/your-organization
|
|
111
|
+
project: ProjectName
|
|
112
|
+
pat: xxxxxxxxx
|
|
113
|
+
verify_ssl: true
|
|
114
|
+
# ca_bundle: C:/certs/corporate-root-ca.pem
|
|
115
|
+
|
|
116
|
+
review:
|
|
117
|
+
verbosity: detailed
|
|
118
|
+
scope: diff_only
|
|
119
|
+
custom_prompt_file: review_prompt.md
|
|
120
|
+
# file limit sent to the LLM
|
|
121
|
+
max_diff_files: 50
|
|
122
|
+
# per-file limit
|
|
123
|
+
max_diff_lines: 2000
|
|
124
|
+
# extension allowlist (empty list = all files)
|
|
125
|
+
file_extensions_filter: [".cs", ".ts", ".py"]
|
|
126
|
+
# exclude path prefixes from the diff (applied before file_extensions_filter)
|
|
127
|
+
# leading slash is optional; add trailing slash for exact folder boundary
|
|
128
|
+
excluded_paths: ["libs/generated"]
|
|
129
|
+
|
|
130
|
+
pr:
|
|
131
|
+
auto_post_comments: false
|
|
132
|
+
dry_run: false
|
|
133
|
+
comment_mode: structured
|
|
134
|
+
|
|
135
|
+
output:
|
|
136
|
+
format: terminal
|
|
137
|
+
file: ""
|
|
138
|
+
color: true
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Available VS Code Tasks
|
|
142
|
+
|
|
143
|
+
- `AI Review: Pull Request (Interactive)`
|
|
144
|
+
- `AI Review: PR (Dry-Run)`
|
|
145
|
+
- `AI Review: List Active PRs`
|
|
146
|
+
- `AI Review: Interactive Mode`
|
{code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/code_review_ai_cli.egg-info/SOURCES.txt
RENAMED
|
@@ -9,6 +9,7 @@ code_review_ai_cli.egg-info/top_level.txt
|
|
|
9
9
|
src/__init__.py
|
|
10
10
|
src/ai_review.py
|
|
11
11
|
src/config.py
|
|
12
|
+
src/context_extractor.py
|
|
12
13
|
src/formatter.py
|
|
13
14
|
src/git_utils.py
|
|
14
15
|
src/llm_client.py
|
|
@@ -18,6 +19,7 @@ src/prompts/config.yaml.template
|
|
|
18
19
|
src/prompts/review_prompt.md.template
|
|
19
20
|
tests/test_ai_review.py
|
|
20
21
|
tests/test_config.py
|
|
22
|
+
tests/test_context_extractor.py
|
|
21
23
|
tests/test_formatter.py
|
|
22
24
|
tests/test_git_utils.py
|
|
23
25
|
tests/test_llm_client.py
|
{code_review_ai_cli-2.0.1 → code_review_ai_cli-2.2.0}/code_review_ai_cli.egg-info/requires.txt
RENAMED
|
@@ -6,6 +6,7 @@ boto3>=1.34.0
|
|
|
6
6
|
openai>=1.0.0
|
|
7
7
|
google-generativeai>=0.3.0
|
|
8
8
|
anthropic>=0.18.0
|
|
9
|
+
tree-sitter-languages>=1.10.2
|
|
9
10
|
|
|
10
11
|
[bedrock]
|
|
11
12
|
boto3>=1.34.0
|
|
@@ -23,3 +24,6 @@ google-generativeai>=0.3.0
|
|
|
23
24
|
|
|
24
25
|
[openai]
|
|
25
26
|
openai>=1.0.0
|
|
27
|
+
|
|
28
|
+
[tree-sitter]
|
|
29
|
+
tree-sitter-languages>=1.10.2
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "code-review-ai-cli"
|
|
7
|
-
version = "2.0
|
|
7
|
+
version = "2.2.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"
|
|
@@ -31,11 +31,13 @@ bedrock = ["boto3>=1.34.0"]
|
|
|
31
31
|
openai = ["openai>=1.0.0"]
|
|
32
32
|
gemini = ["google-generativeai>=0.3.0"]
|
|
33
33
|
claude = ["anthropic>=0.18.0"]
|
|
34
|
+
tree-sitter = ["tree-sitter-languages>=1.10.2"]
|
|
34
35
|
all = [
|
|
35
36
|
"boto3>=1.34.0",
|
|
36
37
|
"openai>=1.0.0",
|
|
37
38
|
"google-generativeai>=0.3.0",
|
|
38
39
|
"anthropic>=0.18.0",
|
|
40
|
+
"tree-sitter-languages>=1.10.2",
|
|
39
41
|
]
|
|
40
42
|
dev = [
|
|
41
43
|
"pytest>=8.3.0",
|
|
@@ -79,7 +79,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
79
79
|
PROJECT_ROOT = _ensure_project_root_on_path(__file__)
|
|
80
80
|
|
|
81
81
|
from src.config import ReviewConfig, VALID_PROVIDERS # noqa: E402
|
|
82
|
-
from src.git_utils import GitUtils
|
|
82
|
+
from src.git_utils import GitUtils # noqa: E402
|
|
83
83
|
from src.llm_client import LLMClient, LLMError # noqa: E402
|
|
84
84
|
from src.formatter import ReviewFormatter, Colors, save_output # noqa: E402
|
|
85
85
|
from src import __version__ as VERSION # noqa: E402
|
|
@@ -426,6 +426,8 @@ def run_pr_review_workflow(args: argparse.Namespace, config: ReviewConfig,
|
|
|
426
426
|
repo_name,
|
|
427
427
|
pr_id,
|
|
428
428
|
review_scope=config.review_scope,
|
|
429
|
+
excluded_paths=config.excluded_paths or None,
|
|
430
|
+
file_extensions_filter=config.file_extensions_filter or None,
|
|
429
431
|
)
|
|
430
432
|
except TFSError as exc:
|
|
431
433
|
print(formatter.format_error(str(exc)))
|
|
@@ -451,17 +453,6 @@ def run_pr_review_workflow(args: argparse.Namespace, config: ReviewConfig,
|
|
|
451
453
|
git_utils = GitUtils.__new__(GitUtils)
|
|
452
454
|
git_utils.repo_path = os.getcwd()
|
|
453
455
|
|
|
454
|
-
# Filter extensions before limiting/truncating the diff sent to the LLM
|
|
455
|
-
if config.file_extensions_filter:
|
|
456
|
-
try:
|
|
457
|
-
diff = git_utils.filter_diff_by_extensions(
|
|
458
|
-
diff,
|
|
459
|
-
config.file_extensions_filter,
|
|
460
|
-
)
|
|
461
|
-
except GitError as exc:
|
|
462
|
-
print(formatter.format_warning(str(exc)))
|
|
463
|
-
return 0
|
|
464
|
-
|
|
465
456
|
# Keep only added lines (+): ignore context and removed lines
|
|
466
457
|
diff = git_utils.filter_diff_additions_only(diff)
|
|
467
458
|
if not diff.strip():
|
|
@@ -89,8 +89,12 @@ class ReviewConfig:
|
|
|
89
89
|
review_scope: str = "diff_only" # "diff_only" | "full_code"
|
|
90
90
|
max_diff_files: int = 50 # Max diff files sent to LLM
|
|
91
91
|
max_diff_lines: int = 2000 # Max diff lines
|
|
92
|
+
max_scope_blocks: int = 3 # Max changed blocks for Enclosing Scopes strategy
|
|
93
|
+
max_scope_lines: int = 250 # Max lines in a single scope block before fallback to file_skeleton
|
|
94
|
+
adaptive_context_lines: int = 10 # Context lines for Adaptive Diff fallback
|
|
92
95
|
custom_prompt_file: str = "review_prompt.md" # Markdown file with extra rules/context
|
|
93
|
-
file_extensions_filter: list = field(default_factory=list)
|
|
96
|
+
file_extensions_filter: list = field(default_factory=list) # File extensions to include (empty = all)
|
|
97
|
+
excluded_paths: list = field(default_factory=list) # Folder path segments to exclude from diff
|
|
94
98
|
|
|
95
99
|
# --- PR Review ----------------------------------------------------
|
|
96
100
|
auto_post_comments: bool = False # Post comments automatically
|
|
@@ -214,8 +218,12 @@ class ReviewConfig:
|
|
|
214
218
|
"review_scope": ("review", "scope"),
|
|
215
219
|
"max_diff_files": ("review", "max_diff_files"),
|
|
216
220
|
"max_diff_lines": ("review", "max_diff_lines"),
|
|
221
|
+
"max_scope_blocks": ("review", "max_scope_blocks"),
|
|
222
|
+
"max_scope_lines": ("review", "max_scope_lines"),
|
|
223
|
+
"adaptive_context_lines": ("review", "adaptive_context_lines"),
|
|
217
224
|
"custom_prompt_file": ("review", "custom_prompt_file"),
|
|
218
225
|
"file_extensions_filter": ("review", "file_extensions_filter"),
|
|
226
|
+
"excluded_paths": ("review", "excluded_paths"),
|
|
219
227
|
# PR
|
|
220
228
|
"auto_post_comments": ("pr", "auto_post_comments"),
|
|
221
229
|
"dry_run": ("pr", "dry_run"),
|