gito.bot 1.0.1__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.
gito_bot-1.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Vitalii Stepanenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.3
2
+ Name: gito.bot
3
+ Version: 1.0.1
4
+ Summary: LLM-agnostic GitHub AI Code Review Tool with integration to GitHub actions
5
+ License: MIT
6
+ Keywords: static code analysis,code review,code quality,ai,coding,assistant,llm,github,automation,devops,developer tools,github actions,workflows,git
7
+ Author: Nayjest
8
+ Author-email: mail@vitaliy.in
9
+ Requires-Python: >=3.11,<4.0
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Software Development
18
+ Requires-Dist: GitPython (>=3.1.44,<4.0.0)
19
+ Requires-Dist: ai-microcore (==4.0.0.dev19)
20
+ Requires-Dist: anthropic (>=0.52.2,<0.53.0)
21
+ Requires-Dist: google-generativeai (>=0.8.5,<0.9.0)
22
+ Requires-Dist: typer (>=0.16.0,<0.17.0)
23
+ Requires-Dist: unidiff (>=0.7.5,<0.8.0)
24
+ Project-URL: Homepage, https://github.com/Nayjest/github-ai-code-review
25
+ Project-URL: Repository, https://github.com/Nayjest/github-ai-code-review
26
+ Description-Content-Type: text/markdown
27
+
28
+ <p align="right">
29
+ <a href="https://pypi.org/project/ai-code-review/" target="_blank"><img src="https://img.shields.io/pypi/v/ai-code-review" alt="PYPI Release"></a>
30
+ <a href="https://github.com/Nayjest/ai-code-review/actions/workflows/code-style.yml" target="_blank"><img src="https://github.com/Nayjest/ai-code-review/actions/workflows/code-style.yml/badge.svg" alt="Pylint"></a>
31
+ <a href="https://github.com/Nayjest/ai-code-review/actions/workflows/tests.yml" target="_blank"><img src="https://github.com/Nayjest/ai-code-review/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
32
+ <img src="https://github.com/Nayjest/ai-code-review/blob/main/coverage.svg" alt="Code Coverage">
33
+ <a href="https://github.com/Nayjest/ai-code-review/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/static/v1?label=license&message=MIT&color=d08aff" alt="License"></a>
34
+ </p>
35
+
36
+ # 🤖 AI Code Review
37
+
38
+ An AI-powered GitHub code review tool that automatically detects issues in pull requests or local changes. Uses language models to provide instant, comprehensive analysis human reviewers may overlook.
39
+
40
+ Get consistent, thorough code reviews in seconds—no waiting for human availability.
41
+
42
+ ## ✨ Features
43
+
44
+ - Automatically reviews pull requests via GitHub Actions
45
+ - Focuses on critical issues (e.g., bugs, security risks, design flaws)
46
+ - Posts review results as a comment on your PR
47
+ - Can be used locally; works with both local and remote Git repositories
48
+ - Optional, fun AI-generated code awards 🏆
49
+ - Easily configurable via [`.ai-code-review.toml`](https://github.com/Nayjest/ai-code-review/blob/main/ai_code_review/.ai-code-review.toml) in your repository root
50
+ - Extremely fast, parallel LLM usage
51
+ - Model-agnostic (OpenAI, Anthropic, Google, local PyTorch inference, etc.)
52
+
53
+ See code review in action: [example](https://github.com/Nayjest/ai-code-review/pull/39#issuecomment-2906968729)
54
+
55
+ ## 🚀 Quickstart
56
+
57
+ ### 1. Review Pull Requests via GitHub Actions
58
+
59
+ Create a `.github/workflows/ai-code-review.yml` file:
60
+
61
+ ```yaml
62
+ name: AI Code Review
63
+ on: { pull_request: { types: [opened, synchronize, reopened] } }
64
+ jobs:
65
+ review:
66
+ runs-on: ubuntu-latest
67
+ permissions: { contents: read, pull-requests: write } # 'write' for leaving the summary comment
68
+ steps:
69
+ - uses: actions/checkout@v4
70
+ with: { fetch-depth: 0 }
71
+ - name: Set up Python
72
+ uses: actions/setup-python@v5
73
+ with: { python-version: "3.13" }
74
+ - name: Install AI Code Review tool
75
+ run: pip install ai-code-review~=1.0
76
+ - name: Run AI code analysis
77
+ env:
78
+ LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
79
+ LLM_API_TYPE: openai
80
+ MODEL: "gpt-4.1"
81
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82
+ run: |
83
+ ai-code-review
84
+ ai-code-review github-comment --token ${{ secrets.GITHUB_TOKEN }}
85
+ - uses: actions/upload-artifact@v4
86
+ with:
87
+ name: ai-code-review-results
88
+ path: |
89
+ code-review-report.md
90
+ code-review-report.json
91
+ ```
92
+
93
+ > ⚠️ Make sure to add `LLM_API_KEY` to your repository’s GitHub secrets.
94
+
95
+ 💪 Done!
96
+ PRs to your repository will now receive AI code reviews automatically. ✨
97
+ See [GitHub Setup Guide](https://github.com/Nayjest/ai-code-review/blob/main/documentation/github_setup.md) for more details.
98
+
99
+ ### 2. Running Code Analysis Locally
100
+
101
+ #### Initial Local Setup
102
+
103
+ **Prerequisites:** [Python](https://www.python.org/downloads/) 3.11 / 3.12 / 3.13
104
+
105
+ **Step1:** Install [ai-code-review](https://github.com/Nayjest/ai-code-review) using [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)).
106
+ ```bash
107
+ pip install ai-code-review
108
+ ```
109
+
110
+ > **Troubleshooting:**
111
+ > pip may be also available via cli as `pip3` depending on your Python installation.
112
+
113
+ **Step2:** Perform initial setup
114
+
115
+ The following command will perform one-time setup using an interactive wizard.
116
+ You will be prompted to enter LLM configuration details (API type, API key, etc).
117
+ Configuration will be saved to ~/.env.ai-code-review.
118
+
119
+ ```bash
120
+ ai-code-review setup
121
+ ```
122
+
123
+ > **Troubleshooting:**
124
+ > On some systems, `ai-code-review` command may not became available immediately after installation.
125
+ > Try restarting your terminal or running `python -m ai_code_review` instead.
126
+
127
+
128
+ #### Perform your first AI code review locally
129
+
130
+ **Step1:** Navigate to your repository root directory.
131
+ **Step2:** Switch to the branch you want to review.
132
+ **Step3:** Run following command
133
+ ```bash
134
+ ai-code-review
135
+ ```
136
+
137
+ > **Note:** This will analyze the current branch against the repository main branch by default.
138
+ > Files that are not staged for commit will be ignored.
139
+ > See `ai-code-review --help` for more options.
140
+
141
+ **Reviewing remote repository**
142
+
143
+ ```bash
144
+ ai-code-review remote git@github.com:owner/repo.git <FEATURE_BRANCH>..<MAIN_BRANCH>
145
+ ```
146
+ Use interactive help for details:
147
+ ```bash
148
+ ai-code-review remote --help
149
+ ```
150
+
151
+ ## 🔧 Configuration
152
+
153
+ Change behavior via `.ai-code-review.toml`:
154
+
155
+ - Prompt templates, filtering and post-processing using Python code snippets
156
+ - Tagging, severity, and confidence settings
157
+ - Custom AI awards for developer brilliance
158
+ - Output customization
159
+
160
+ You can override the default config by placing `.ai-code-review.toml` in your repo root.
161
+
162
+
163
+ See default configuration [here](https://github.com/Nayjest/ai-code-review/blob/main/ai_code_review/.ai-code-review.toml).
164
+
165
+ More details can be found in [📖 Configuration Cookbook](https://github.com/Nayjest/ai-code-review/blob/main/documentation/config_cookbook.md)
166
+
167
+ ## 💻 Development Setup
168
+
169
+ Install dependencies:
170
+
171
+ ```bash
172
+ make install
173
+ ```
174
+
175
+ Format code and check style:
176
+
177
+ ```bash
178
+ make black
179
+ make cs
180
+ ```
181
+
182
+ Run tests:
183
+
184
+ ```bash
185
+ pytest
186
+ ```
187
+
188
+ ## 🤝 Contributing
189
+
190
+ **Looking for a specific feature or having trouble?**
191
+ Contributions are welcome! ❤️
192
+ See [CONTRIBUTING.md](https://github.com/Nayjest/ai-code-review/blob/main/CONTRIBUTING.md) for details.
193
+
194
+ ## 📝 License
195
+
196
+ Licensed under the [MIT License](https://github.com/Nayjest/ai-code-review/blob/main/LICENSE).
197
+
198
+ © 2025 [Vitalii Stepanenko](mailto:mail@vitaliy.in)
199
+
@@ -0,0 +1,171 @@
1
+ <p align="right">
2
+ <a href="https://pypi.org/project/ai-code-review/" target="_blank"><img src="https://img.shields.io/pypi/v/ai-code-review" alt="PYPI Release"></a>
3
+ <a href="https://github.com/Nayjest/ai-code-review/actions/workflows/code-style.yml" target="_blank"><img src="https://github.com/Nayjest/ai-code-review/actions/workflows/code-style.yml/badge.svg" alt="Pylint"></a>
4
+ <a href="https://github.com/Nayjest/ai-code-review/actions/workflows/tests.yml" target="_blank"><img src="https://github.com/Nayjest/ai-code-review/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
5
+ <img src="https://github.com/Nayjest/ai-code-review/blob/main/coverage.svg" alt="Code Coverage">
6
+ <a href="https://github.com/Nayjest/ai-code-review/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/static/v1?label=license&message=MIT&color=d08aff" alt="License"></a>
7
+ </p>
8
+
9
+ # 🤖 AI Code Review
10
+
11
+ An AI-powered GitHub code review tool that automatically detects issues in pull requests or local changes. Uses language models to provide instant, comprehensive analysis human reviewers may overlook.
12
+
13
+ Get consistent, thorough code reviews in seconds—no waiting for human availability.
14
+
15
+ ## ✨ Features
16
+
17
+ - Automatically reviews pull requests via GitHub Actions
18
+ - Focuses on critical issues (e.g., bugs, security risks, design flaws)
19
+ - Posts review results as a comment on your PR
20
+ - Can be used locally; works with both local and remote Git repositories
21
+ - Optional, fun AI-generated code awards 🏆
22
+ - Easily configurable via [`.ai-code-review.toml`](https://github.com/Nayjest/ai-code-review/blob/main/ai_code_review/.ai-code-review.toml) in your repository root
23
+ - Extremely fast, parallel LLM usage
24
+ - Model-agnostic (OpenAI, Anthropic, Google, local PyTorch inference, etc.)
25
+
26
+ See code review in action: [example](https://github.com/Nayjest/ai-code-review/pull/39#issuecomment-2906968729)
27
+
28
+ ## 🚀 Quickstart
29
+
30
+ ### 1. Review Pull Requests via GitHub Actions
31
+
32
+ Create a `.github/workflows/ai-code-review.yml` file:
33
+
34
+ ```yaml
35
+ name: AI Code Review
36
+ on: { pull_request: { types: [opened, synchronize, reopened] } }
37
+ jobs:
38
+ review:
39
+ runs-on: ubuntu-latest
40
+ permissions: { contents: read, pull-requests: write } # 'write' for leaving the summary comment
41
+ steps:
42
+ - uses: actions/checkout@v4
43
+ with: { fetch-depth: 0 }
44
+ - name: Set up Python
45
+ uses: actions/setup-python@v5
46
+ with: { python-version: "3.13" }
47
+ - name: Install AI Code Review tool
48
+ run: pip install ai-code-review~=1.0
49
+ - name: Run AI code analysis
50
+ env:
51
+ LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
52
+ LLM_API_TYPE: openai
53
+ MODEL: "gpt-4.1"
54
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55
+ run: |
56
+ ai-code-review
57
+ ai-code-review github-comment --token ${{ secrets.GITHUB_TOKEN }}
58
+ - uses: actions/upload-artifact@v4
59
+ with:
60
+ name: ai-code-review-results
61
+ path: |
62
+ code-review-report.md
63
+ code-review-report.json
64
+ ```
65
+
66
+ > ⚠️ Make sure to add `LLM_API_KEY` to your repository’s GitHub secrets.
67
+
68
+ 💪 Done!
69
+ PRs to your repository will now receive AI code reviews automatically. ✨
70
+ See [GitHub Setup Guide](https://github.com/Nayjest/ai-code-review/blob/main/documentation/github_setup.md) for more details.
71
+
72
+ ### 2. Running Code Analysis Locally
73
+
74
+ #### Initial Local Setup
75
+
76
+ **Prerequisites:** [Python](https://www.python.org/downloads/) 3.11 / 3.12 / 3.13
77
+
78
+ **Step1:** Install [ai-code-review](https://github.com/Nayjest/ai-code-review) using [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)).
79
+ ```bash
80
+ pip install ai-code-review
81
+ ```
82
+
83
+ > **Troubleshooting:**
84
+ > pip may be also available via cli as `pip3` depending on your Python installation.
85
+
86
+ **Step2:** Perform initial setup
87
+
88
+ The following command will perform one-time setup using an interactive wizard.
89
+ You will be prompted to enter LLM configuration details (API type, API key, etc).
90
+ Configuration will be saved to ~/.env.ai-code-review.
91
+
92
+ ```bash
93
+ ai-code-review setup
94
+ ```
95
+
96
+ > **Troubleshooting:**
97
+ > On some systems, `ai-code-review` command may not became available immediately after installation.
98
+ > Try restarting your terminal or running `python -m ai_code_review` instead.
99
+
100
+
101
+ #### Perform your first AI code review locally
102
+
103
+ **Step1:** Navigate to your repository root directory.
104
+ **Step2:** Switch to the branch you want to review.
105
+ **Step3:** Run following command
106
+ ```bash
107
+ ai-code-review
108
+ ```
109
+
110
+ > **Note:** This will analyze the current branch against the repository main branch by default.
111
+ > Files that are not staged for commit will be ignored.
112
+ > See `ai-code-review --help` for more options.
113
+
114
+ **Reviewing remote repository**
115
+
116
+ ```bash
117
+ ai-code-review remote git@github.com:owner/repo.git <FEATURE_BRANCH>..<MAIN_BRANCH>
118
+ ```
119
+ Use interactive help for details:
120
+ ```bash
121
+ ai-code-review remote --help
122
+ ```
123
+
124
+ ## 🔧 Configuration
125
+
126
+ Change behavior via `.ai-code-review.toml`:
127
+
128
+ - Prompt templates, filtering and post-processing using Python code snippets
129
+ - Tagging, severity, and confidence settings
130
+ - Custom AI awards for developer brilliance
131
+ - Output customization
132
+
133
+ You can override the default config by placing `.ai-code-review.toml` in your repo root.
134
+
135
+
136
+ See default configuration [here](https://github.com/Nayjest/ai-code-review/blob/main/ai_code_review/.ai-code-review.toml).
137
+
138
+ More details can be found in [📖 Configuration Cookbook](https://github.com/Nayjest/ai-code-review/blob/main/documentation/config_cookbook.md)
139
+
140
+ ## 💻 Development Setup
141
+
142
+ Install dependencies:
143
+
144
+ ```bash
145
+ make install
146
+ ```
147
+
148
+ Format code and check style:
149
+
150
+ ```bash
151
+ make black
152
+ make cs
153
+ ```
154
+
155
+ Run tests:
156
+
157
+ ```bash
158
+ pytest
159
+ ```
160
+
161
+ ## 🤝 Contributing
162
+
163
+ **Looking for a specific feature or having trouble?**
164
+ Contributions are welcome! ❤️
165
+ See [CONTRIBUTING.md](https://github.com/Nayjest/ai-code-review/blob/main/CONTRIBUTING.md) for details.
166
+
167
+ ## 📝 License
168
+
169
+ Licensed under the [MIT License](https://github.com/Nayjest/ai-code-review/blob/main/LICENSE).
170
+
171
+ © 2025 [Vitalii Stepanenko](mailto:mail@vitaliy.in)