ai-cr 2.0.0.dev2__tar.gz → 2.0.2__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 (26) hide show
  1. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/LICENSE +21 -21
  2. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/PKG-INFO +13 -5
  3. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/README.md +185 -177
  4. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/__main__.py +4 -4
  5. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/bootstrap.py +66 -66
  6. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/cli.py +217 -255
  7. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/commands/__init__.py +1 -1
  8. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/commands/fix.py +157 -157
  9. ai_cr-2.0.2/gito/commands/gh_post_review_comment.py +63 -0
  10. ai_cr-2.0.0.dev2/gito/commands/gh_comment.py → ai_cr-2.0.2/gito/commands/gh_react_to_comment.py +194 -157
  11. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/commands/repl.py +5 -2
  12. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/config.toml +453 -415
  13. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/constants.py +12 -9
  14. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/core.py +288 -239
  15. ai_cr-2.0.2/gito/gh_api.py +35 -0
  16. ai_cr-2.0.2/gito/issue_trackers.py +49 -0
  17. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/pipeline.py +82 -70
  18. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/pipeline_steps/jira.py +57 -83
  19. ai_cr-2.0.2/gito/pipeline_steps/linear.py +85 -0
  20. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/project_config.py +73 -71
  21. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/report_struct.py +134 -133
  22. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/utils.py +226 -214
  23. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/pyproject.toml +60 -60
  24. ai_cr-2.0.0.dev2/gito/issue_trackers.py +0 -15
  25. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/__init__.py +0 -0
  26. {ai_cr-2.0.0.dev2 → ai_cr-2.0.2}/gito/pipeline_steps/__init__.py +0 -0
@@ -1,21 +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.
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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ai-cr
3
- Version: 2.0.0.dev2
3
+ Version: 2.0.2
4
4
  Summary: AI code review tool that works with any language model provider. It detects issues in GitHub pull requests or local changes—instantly, reliably, and without vendor lock-in.
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
@@ -27,12 +27,12 @@ Project-URL: Homepage, https://github.com/Nayjest/Gito
27
27
  Project-URL: Repository, https://github.com/Nayjest/Gito
28
28
  Description-Content-Type: text/markdown
29
29
 
30
- <h1 align="center"><a href="#"><img alt="Gito: AI Code Reviewer" src="press-kit/logo/gito-ai-code-reviewer_logo-180.png" align="center" width="180"></a></h1>
30
+ <h1 align="center"><a href="#"><img alt="Gito: AI Code Reviewer" src="https://raw.githubusercontent.com/Nayjest/Gito/main/press-kit/logo/gito-ai-code-reviewer_logo-180.png" align="center" width="180"></a></h1>
31
31
  <p align="center">
32
32
  <a href="https://pypi.org/project/gito.bot/" target="_blank"><img src="https://img.shields.io/pypi/v/gito.bot" alt="PYPI Release"></a>
33
33
  <a href="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml/badge.svg" alt="PyLint"></a>
34
34
  <a href="https://github.com/Nayjest/Gito/actions/workflows/tests.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
35
- <img src="https://github.com/Nayjest/Gito/blob/main/coverage.svg" alt="Code Coverage">
35
+ <img src="https://raw.githubusercontent.com/Nayjest/Gito/main/coverage.svg" alt="Code Coverage">
36
36
  <a href="https://github.com/Nayjest/Gito/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/static/v1?label=license&message=MIT&color=d08aff" alt="License"></a>
37
37
  </p>
38
38
 
@@ -58,7 +58,7 @@ Get consistent, thorough code reviews in seconds—no waiting for human availabi
58
58
  - Open source projects maintaining high code quality at scale
59
59
  - CI/CD pipelines requiring automated quality gates
60
60
 
61
- ✨ See [code review in action](https://github.com/Nayjest/Gito/pull/39#issuecomment-2906968729) ✨
61
+ ✨ See [code review in action](https://github.com/Nayjest/Gito/pull/99) ✨
62
62
 
63
63
  ## 🚀 Quickstart
64
64
 
@@ -68,7 +68,14 @@ Create a `.github/workflows/gito-code-review.yml` file:
68
68
 
69
69
  ```yaml
70
70
  name: "Gito: AI Code Review"
71
- on: { pull_request: { types: [opened, synchronize, reopened] } }
71
+ on:
72
+ pull_request:
73
+ types: [opened, synchronize, reopened]
74
+ workflow_dispatch:
75
+ inputs:
76
+ pr_number:
77
+ description: "Pull Request number"
78
+ required: true
72
79
  jobs:
73
80
  review:
74
81
  runs-on: ubuntu-latest
@@ -87,6 +94,7 @@ jobs:
87
94
  LLM_API_TYPE: openai
88
95
  MODEL: "gpt-4.1"
89
96
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97
+ PR_NUMBER_FROM_WORKFLOW_DISPATCH: ${{ github.event.inputs.pr_number }}
90
98
  run: |
91
99
  gito --verbose review
92
100
  gito github-comment --token ${{ secrets.GITHUB_TOKEN }}
@@ -1,177 +1,185 @@
1
- <h1 align="center"><a href="#"><img alt="Gito: AI Code Reviewer" src="press-kit/logo/gito-ai-code-reviewer_logo-180.png" align="center" width="180"></a></h1>
2
- <p align="center">
3
- <a href="https://pypi.org/project/gito.bot/" target="_blank"><img src="https://img.shields.io/pypi/v/gito.bot" alt="PYPI Release"></a>
4
- <a href="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml/badge.svg" alt="PyLint"></a>
5
- <a href="https://github.com/Nayjest/Gito/actions/workflows/tests.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
6
- <img src="https://github.com/Nayjest/Gito/blob/main/coverage.svg" alt="Code Coverage">
7
- <a href="https://github.com/Nayjest/Gito/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/static/v1?label=license&message=MIT&color=d08aff" alt="License"></a>
8
- </p>
9
-
10
- **Gito** is an open-source **AI code reviewer** that works with any language model provider.
11
- It detects issues in GitHub pull requests or local changes—instantly, reliably, and without vendor lock-in.
12
-
13
- Get consistent, thorough code reviews in seconds—no waiting for human availability.
14
-
15
- ## ✨ Why Gito?
16
-
17
- - [⚡] **Lightning Fast:** Get detailed code reviews in seconds, not days — powered by parallelized LLM processing
18
- - [🔧] **Vendor Agnostic:** Works with any language model provider (OpenAI, Anthropic, Google, local models, etc.)
19
- - [🌐] **Universal:** Supports all major programming languages and frameworks
20
- - [🔍] **Comprehensive Analysis:** Detect issues across security, performance, maintainability, best practices, and much more
21
- - [📈] **Consistent Quality:** Never tired, never biased—consistent review quality every time
22
- - [🚀] **Easy Integration:** Automatically reviews pull requests via GitHub Actions and posts results as PR comments
23
- - [🎛️] **Infinitely Flexible:** Adapt to any project's standards—configure review rules, severity levels, and focus areas, build custom workflows
24
-
25
- ## 🎯 Perfect For
26
-
27
- - Solo developers who want expert-level code review without the wait
28
- - Teams looking to catch issues before human review
29
- - Open source projects maintaining high code quality at scale
30
- - CI/CD pipelines requiring automated quality gates
31
-
32
- ✨ See [code review in action](https://github.com/Nayjest/Gito/pull/39#issuecomment-2906968729) ✨
33
-
34
- ## 🚀 Quickstart
35
-
36
- ### 1. Review Pull Requests via GitHub Actions
37
-
38
- Create a `.github/workflows/gito-code-review.yml` file:
39
-
40
- ```yaml
41
- name: "Gito: AI Code Review"
42
- on: { pull_request: { types: [opened, synchronize, reopened] } }
43
- jobs:
44
- review:
45
- runs-on: ubuntu-latest
46
- permissions: { contents: read, pull-requests: write } # 'write' for leaving the summary comment
47
- steps:
48
- - uses: actions/checkout@v4
49
- with: { fetch-depth: 0 }
50
- - name: Set up Python
51
- uses: actions/setup-python@v5
52
- with: { python-version: "3.13" }
53
- - name: Install AI Code Review tool
54
- run: pip install gito.bot~=2.0
55
- - name: Run AI code analysis
56
- env:
57
- LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
58
- LLM_API_TYPE: openai
59
- MODEL: "gpt-4.1"
60
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61
- run: |
62
- gito --verbose review
63
- gito github-comment --token ${{ secrets.GITHUB_TOKEN }}
64
- - uses: actions/upload-artifact@v4
65
- with:
66
- name: ai-code-review-results
67
- path: |
68
- code-review-report.md
69
- code-review-report.json
70
- ```
71
-
72
- > ⚠️ Make sure to add `LLM_API_KEY` to your repository’s GitHub secrets.
73
-
74
- 💪 Done!
75
- PRs to your repository will now receive AI code reviews automatically. ✨
76
- See [GitHub Setup Guide](https://github.com/Nayjest/Gito/blob/main/documentation/github_setup.md) for more details.
77
-
78
- ### 2. Running Code Analysis Locally
79
-
80
- #### Initial Local Setup
81
-
82
- **Prerequisites:** [Python](https://www.python.org/downloads/) 3.11 / 3.12 / 3.13
83
-
84
- **Step1:** Install [gito.bot](https://github.com/Nayjest/Gito) using [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)).
85
- ```bash
86
- pip install gito.bot
87
- ```
88
-
89
- > **Troubleshooting:**
90
- > pip may be also available via cli as `pip3` depending on your Python installation.
91
-
92
- **Step2:** Perform initial setup
93
-
94
- The following command will perform one-time setup using an interactive wizard.
95
- You will be prompted to enter LLM configuration details (API type, API key, etc).
96
- Configuration will be saved to `~/.gito/.env`.
97
-
98
- ```bash
99
- gito setup
100
- ```
101
-
102
- > **Troubleshooting:**
103
- > On some systems, `gito` command may not became available immediately after installation.
104
- > Try restarting your terminal or running `python -m gito` instead.
105
-
106
-
107
- #### Perform your first AI code review locally
108
-
109
- **Step1:** Navigate to your repository root directory.
110
- **Step2:** Switch to the branch you want to review.
111
- **Step3:** Run following command
112
- ```bash
113
- gito review
114
- ```
115
-
116
- > **Note:** This will analyze the current branch against the repository main branch by default.
117
- > Files that are not staged for commit will be ignored.
118
- > See `gito --help` for more options.
119
-
120
- **Reviewing remote repository**
121
-
122
- ```bash
123
- gito remote git@github.com:owner/repo.git <FEATURE_BRANCH>..<MAIN_BRANCH>
124
- ```
125
- Use interactive help for details:
126
- ```bash
127
- gito remote --help
128
- ```
129
-
130
- ## 🔧 Configuration
131
-
132
- Change behavior via `.gito/config.toml`:
133
-
134
- - Prompt templates, filtering and post-processing using Python code snippets
135
- - Tagging, severity, and confidence settings
136
- - Custom AI awards for developer brilliance
137
- - Output customization
138
-
139
- You can override the default config by placing `.gito/config.toml` in your repo root.
140
-
141
-
142
- See default configuration [here](https://github.com/Nayjest/Gito/blob/main/gito/config.toml).
143
-
144
- More details can be found in [📖 Configuration Cookbook](https://github.com/Nayjest/Gito/blob/main/documentation/config_cookbook.md)
145
-
146
- ## 💻 Development Setup
147
-
148
- Install dependencies:
149
-
150
- ```bash
151
- make install
152
- ```
153
-
154
- Format code and check style:
155
-
156
- ```bash
157
- make black
158
- make cs
159
- ```
160
-
161
- Run tests:
162
-
163
- ```bash
164
- pytest
165
- ```
166
-
167
- ## 🤝 Contributing
168
-
169
- **Looking for a specific feature or having trouble?**
170
- Contributions are welcome! ❤️
171
- See [CONTRIBUTING.md](https://github.com/Nayjest/Gito/blob/main/CONTRIBUTING.md) for details.
172
-
173
- ## 📝 License
174
-
175
- Licensed under the [MIT License](https://github.com/Nayjest/Gito/blob/main/LICENSE).
176
-
177
- © 2025 [Vitalii Stepanenko](mailto:mail@vitaliy.in)
1
+ <h1 align="center"><a href="#"><img alt="Gito: AI Code Reviewer" src="https://raw.githubusercontent.com/Nayjest/Gito/main/press-kit/logo/gito-ai-code-reviewer_logo-180.png" align="center" width="180"></a></h1>
2
+ <p align="center">
3
+ <a href="https://pypi.org/project/gito.bot/" target="_blank"><img src="https://img.shields.io/pypi/v/gito.bot" alt="PYPI Release"></a>
4
+ <a href="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/code-style.yml/badge.svg" alt="PyLint"></a>
5
+ <a href="https://github.com/Nayjest/Gito/actions/workflows/tests.yml" target="_blank"><img src="https://github.com/Nayjest/Gito/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
6
+ <img src="https://raw.githubusercontent.com/Nayjest/Gito/main/coverage.svg" alt="Code Coverage">
7
+ <a href="https://github.com/Nayjest/Gito/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/static/v1?label=license&message=MIT&color=d08aff" alt="License"></a>
8
+ </p>
9
+
10
+ **Gito** is an open-source **AI code reviewer** that works with any language model provider.
11
+ It detects issues in GitHub pull requests or local changes—instantly, reliably, and without vendor lock-in.
12
+
13
+ Get consistent, thorough code reviews in seconds—no waiting for human availability.
14
+
15
+ ## ✨ Why Gito?
16
+
17
+ - [⚡] **Lightning Fast:** Get detailed code reviews in seconds, not days — powered by parallelized LLM processing
18
+ - [🔧] **Vendor Agnostic:** Works with any language model provider (OpenAI, Anthropic, Google, local models, etc.)
19
+ - [🌐] **Universal:** Supports all major programming languages and frameworks
20
+ - [🔍] **Comprehensive Analysis:** Detect issues across security, performance, maintainability, best practices, and much more
21
+ - [📈] **Consistent Quality:** Never tired, never biased—consistent review quality every time
22
+ - [🚀] **Easy Integration:** Automatically reviews pull requests via GitHub Actions and posts results as PR comments
23
+ - [🎛️] **Infinitely Flexible:** Adapt to any project's standards—configure review rules, severity levels, and focus areas, build custom workflows
24
+
25
+ ## 🎯 Perfect For
26
+
27
+ - Solo developers who want expert-level code review without the wait
28
+ - Teams looking to catch issues before human review
29
+ - Open source projects maintaining high code quality at scale
30
+ - CI/CD pipelines requiring automated quality gates
31
+
32
+ ✨ See [code review in action](https://github.com/Nayjest/Gito/pull/99) ✨
33
+
34
+ ## 🚀 Quickstart
35
+
36
+ ### 1. Review Pull Requests via GitHub Actions
37
+
38
+ Create a `.github/workflows/gito-code-review.yml` file:
39
+
40
+ ```yaml
41
+ name: "Gito: AI Code Review"
42
+ on:
43
+ pull_request:
44
+ types: [opened, synchronize, reopened]
45
+ workflow_dispatch:
46
+ inputs:
47
+ pr_number:
48
+ description: "Pull Request number"
49
+ required: true
50
+ jobs:
51
+ review:
52
+ runs-on: ubuntu-latest
53
+ permissions: { contents: read, pull-requests: write } # 'write' for leaving the summary comment
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+ with: { fetch-depth: 0 }
57
+ - name: Set up Python
58
+ uses: actions/setup-python@v5
59
+ with: { python-version: "3.13" }
60
+ - name: Install AI Code Review tool
61
+ run: pip install gito.bot~=2.0
62
+ - name: Run AI code analysis
63
+ env:
64
+ LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
65
+ LLM_API_TYPE: openai
66
+ MODEL: "gpt-4.1"
67
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68
+ PR_NUMBER_FROM_WORKFLOW_DISPATCH: ${{ github.event.inputs.pr_number }}
69
+ run: |
70
+ gito --verbose review
71
+ gito github-comment --token ${{ secrets.GITHUB_TOKEN }}
72
+ - uses: actions/upload-artifact@v4
73
+ with:
74
+ name: ai-code-review-results
75
+ path: |
76
+ code-review-report.md
77
+ code-review-report.json
78
+ ```
79
+
80
+ > ⚠️ Make sure to add `LLM_API_KEY` to your repository’s GitHub secrets.
81
+
82
+ 💪 Done!
83
+ PRs to your repository will now receive AI code reviews automatically. ✨
84
+ See [GitHub Setup Guide](https://github.com/Nayjest/Gito/blob/main/documentation/github_setup.md) for more details.
85
+
86
+ ### 2. Running Code Analysis Locally
87
+
88
+ #### Initial Local Setup
89
+
90
+ **Prerequisites:** [Python](https://www.python.org/downloads/) 3.11 / 3.12 / 3.13
91
+
92
+ **Step1:** Install [gito.bot](https://github.com/Nayjest/Gito) using [pip](https://en.wikipedia.org/wiki/Pip_(package_manager)).
93
+ ```bash
94
+ pip install gito.bot
95
+ ```
96
+
97
+ > **Troubleshooting:**
98
+ > pip may be also available via cli as `pip3` depending on your Python installation.
99
+
100
+ **Step2:** Perform initial setup
101
+
102
+ The following command will perform one-time setup using an interactive wizard.
103
+ You will be prompted to enter LLM configuration details (API type, API key, etc).
104
+ Configuration will be saved to `~/.gito/.env`.
105
+
106
+ ```bash
107
+ gito setup
108
+ ```
109
+
110
+ > **Troubleshooting:**
111
+ > On some systems, `gito` command may not became available immediately after installation.
112
+ > Try restarting your terminal or running `python -m gito` instead.
113
+
114
+
115
+ #### Perform your first AI code review locally
116
+
117
+ **Step1:** Navigate to your repository root directory.
118
+ **Step2:** Switch to the branch you want to review.
119
+ **Step3:** Run following command
120
+ ```bash
121
+ gito review
122
+ ```
123
+
124
+ > **Note:** This will analyze the current branch against the repository main branch by default.
125
+ > Files that are not staged for commit will be ignored.
126
+ > See `gito --help` for more options.
127
+
128
+ **Reviewing remote repository**
129
+
130
+ ```bash
131
+ gito remote git@github.com:owner/repo.git <FEATURE_BRANCH>..<MAIN_BRANCH>
132
+ ```
133
+ Use interactive help for details:
134
+ ```bash
135
+ gito remote --help
136
+ ```
137
+
138
+ ## 🔧 Configuration
139
+
140
+ Change behavior via `.gito/config.toml`:
141
+
142
+ - Prompt templates, filtering and post-processing using Python code snippets
143
+ - Tagging, severity, and confidence settings
144
+ - Custom AI awards for developer brilliance
145
+ - Output customization
146
+
147
+ You can override the default config by placing `.gito/config.toml` in your repo root.
148
+
149
+
150
+ See default configuration [here](https://github.com/Nayjest/Gito/blob/main/gito/config.toml).
151
+
152
+ More details can be found in [📖 Configuration Cookbook](https://github.com/Nayjest/Gito/blob/main/documentation/config_cookbook.md)
153
+
154
+ ## 💻 Development Setup
155
+
156
+ Install dependencies:
157
+
158
+ ```bash
159
+ make install
160
+ ```
161
+
162
+ Format code and check style:
163
+
164
+ ```bash
165
+ make black
166
+ make cs
167
+ ```
168
+
169
+ Run tests:
170
+
171
+ ```bash
172
+ pytest
173
+ ```
174
+
175
+ ## 🤝 Contributing
176
+
177
+ **Looking for a specific feature or having trouble?**
178
+ Contributions are welcome! ❤️
179
+ See [CONTRIBUTING.md](https://github.com/Nayjest/Gito/blob/main/CONTRIBUTING.md) for details.
180
+
181
+ ## 📝 License
182
+
183
+ Licensed under the [MIT License](https://github.com/Nayjest/Gito/blob/main/LICENSE).
184
+
185
+ © 2025 [Vitalii Stepanenko](mailto:mail@vitaliy.in)
@@ -1,4 +1,4 @@
1
- from .cli import main
2
-
3
- if __name__ == "__main__":
4
- main()
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
@@ -1,66 +1,66 @@
1
- import logging
2
- import os
3
- from datetime import datetime
4
-
5
- import microcore as mc
6
- import typer
7
-
8
- from .utils import is_running_in_github_action
9
- from .constants import HOME_ENV_PATH, EXECUTABLE
10
-
11
-
12
- def setup_logging():
13
- class CustomFormatter(logging.Formatter):
14
- def format(self, record):
15
- dt = datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S")
16
- message, level_name = record.getMessage(), record.levelname
17
- if record.levelno == logging.WARNING:
18
- message = mc.ui.yellow(message)
19
- level_name = mc.ui.yellow(level_name)
20
- if record.levelno >= logging.ERROR:
21
- message = mc.ui.red(message)
22
- level_name = mc.ui.red(level_name)
23
- return f"{dt} {level_name}: {message}"
24
-
25
- handler = logging.StreamHandler()
26
- handler.setFormatter(CustomFormatter())
27
- logging.basicConfig(level=logging.INFO, handlers=[handler])
28
-
29
-
30
- def bootstrap():
31
- """Bootstrap the application with the environment configuration."""
32
- setup_logging()
33
- logging.info("Bootstrapping...")
34
- try:
35
- mc.configure(
36
- DOT_ENV_FILE=HOME_ENV_PATH,
37
- USE_LOGGING=True,
38
- EMBEDDING_DB_TYPE=mc.EmbeddingDbType.NONE,
39
- )
40
- except mc.LLMConfigError as e:
41
- msg = str(e)
42
- if is_running_in_github_action():
43
- ref = os.getenv("GITHUB_WORKFLOW_REF", "")
44
- if ref:
45
- # example value: 'owner/repo/.github/workflows/ai-code-review.yml@refs/pull/1/merge'
46
- ref = ref.split("@")[0]
47
- ref = ref.split(".github/workflows/")[-1]
48
- ref = f" (.github/workflows/{ref})"
49
- msg += (
50
- f"\nPlease check your GitHub Action Secrets "
51
- f"and `env` configuration section of the corresponding workflow step{ref}."
52
- )
53
- else:
54
- msg += (
55
- f"\nPlease run '{EXECUTABLE} setup' "
56
- "to configure LLM API access (API keys, model, etc)."
57
- )
58
- print(mc.ui.red(msg))
59
- raise SystemExit(2)
60
- except Exception as e:
61
- logging.error(f"Unexpected configuration error: {e}")
62
- raise SystemExit(3)
63
- mc.logging.LoggingConfig.STRIP_REQUEST_LINES = [300, 15]
64
-
65
-
66
- app = typer.Typer(pretty_exceptions_show_locals=False)
1
+ import logging
2
+ import os
3
+ from datetime import datetime
4
+
5
+ import microcore as mc
6
+ import typer
7
+
8
+ from .utils import is_running_in_github_action
9
+ from .constants import HOME_ENV_PATH, EXECUTABLE
10
+
11
+
12
+ def setup_logging():
13
+ class CustomFormatter(logging.Formatter):
14
+ def format(self, record):
15
+ dt = datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S")
16
+ message, level_name = record.getMessage(), record.levelname
17
+ if record.levelno == logging.WARNING:
18
+ message = mc.ui.yellow(message)
19
+ level_name = mc.ui.yellow(level_name)
20
+ if record.levelno >= logging.ERROR:
21
+ message = mc.ui.red(message)
22
+ level_name = mc.ui.red(level_name)
23
+ return f"{dt} {level_name}: {message}"
24
+
25
+ handler = logging.StreamHandler()
26
+ handler.setFormatter(CustomFormatter())
27
+ logging.basicConfig(level=logging.INFO, handlers=[handler])
28
+
29
+
30
+ def bootstrap():
31
+ """Bootstrap the application with the environment configuration."""
32
+ setup_logging()
33
+ logging.info("Bootstrapping...")
34
+ try:
35
+ mc.configure(
36
+ DOT_ENV_FILE=HOME_ENV_PATH,
37
+ USE_LOGGING=True,
38
+ EMBEDDING_DB_TYPE=mc.EmbeddingDbType.NONE,
39
+ )
40
+ except mc.LLMConfigError as e:
41
+ msg = str(e)
42
+ if is_running_in_github_action():
43
+ ref = os.getenv("GITHUB_WORKFLOW_REF", "")
44
+ if ref:
45
+ # example value: 'owner/repo/.github/workflows/ai-code-review.yml@refs/pull/1/merge'
46
+ ref = ref.split("@")[0]
47
+ ref = ref.split(".github/workflows/")[-1]
48
+ ref = f" (.github/workflows/{ref})"
49
+ msg += (
50
+ f"\nPlease check your GitHub Action Secrets "
51
+ f"and `env` configuration section of the corresponding workflow step{ref}."
52
+ )
53
+ else:
54
+ msg += (
55
+ f"\nPlease run '{EXECUTABLE} setup' "
56
+ "to configure LLM API access (API keys, model, etc)."
57
+ )
58
+ print(mc.ui.red(msg))
59
+ raise SystemExit(2)
60
+ except Exception as e:
61
+ logging.error(f"Unexpected configuration error: {e}")
62
+ raise SystemExit(3)
63
+ mc.logging.LoggingConfig.STRIP_REQUEST_LINES = [300, 15]
64
+
65
+
66
+ app = typer.Typer(pretty_exceptions_show_locals=False)