ai-cr 2.0.0.dev2__py3-none-any.whl → 2.0.2__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_cr-2.0.0.dev2.dist-info → ai_cr-2.0.2.dist-info}/LICENSE +21 -21
- {ai_cr-2.0.0.dev2.dist-info → ai_cr-2.0.2.dist-info}/METADATA +13 -5
- ai_cr-2.0.2.dist-info/RECORD +26 -0
- {ai_cr-2.0.0.dev2.dist-info → ai_cr-2.0.2.dist-info}/WHEEL +1 -1
- gito/__main__.py +4 -4
- gito/bootstrap.py +66 -66
- gito/cli.py +217 -255
- gito/commands/__init__.py +1 -1
- gito/commands/fix.py +157 -157
- gito/commands/gh_post_review_comment.py +63 -0
- gito/commands/{gh_comment.py → gh_react_to_comment.py} +194 -157
- gito/commands/repl.py +5 -2
- gito/config.toml +453 -415
- gito/constants.py +12 -9
- gito/core.py +288 -239
- gito/gh_api.py +35 -0
- gito/issue_trackers.py +49 -15
- gito/pipeline.py +82 -70
- gito/pipeline_steps/jira.py +57 -83
- gito/pipeline_steps/linear.py +85 -0
- gito/project_config.py +73 -71
- gito/report_struct.py +134 -133
- gito/utils.py +226 -214
- ai_cr-2.0.0.dev2.dist-info/RECORD +0 -23
- {ai_cr-2.0.0.dev2.dist-info → ai_cr-2.0.2.dist-info}/entry_points.txt +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.
|
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://
|
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/
|
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:
|
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 }}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
gito/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
gito/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
|
3
|
+
gito/bootstrap.py,sha256=ceeoSCD8RX4xKxWri_n0xx00aTFS6xPUHhAs3rKVP5o,2337
|
4
|
+
gito/cli.py,sha256=qFY1ObA0-Ep19bNSEcwjn6KIu2OOSWDj6QGe_o7Ujoc,6555
|
5
|
+
gito/commands/__init__.py,sha256=B2uUQsLMEsHfNT1N3lWYm38WSuQIHFmjiGs2tdBuDBA,55
|
6
|
+
gito/commands/fix.py,sha256=OS829xVrLMLQqlol9AoxJMZ9qaAWRCSbUkVNszK96ws,5305
|
7
|
+
gito/commands/gh_post_review_comment.py,sha256=oZh3kSRBx3cSMozI2llDEOVZ2WeT_5msXMLLCiLina4,1984
|
8
|
+
gito/commands/gh_react_to_comment.py,sha256=4uUb39FnM45DO-wESQq6pUlO5AFvh0FSluCCTxkl8_g,6442
|
9
|
+
gito/commands/repl.py,sha256=wDHWl2VyRK32hLZHImrhqpQNkWV3u3358fwDiA6D3iA,521
|
10
|
+
gito/config.toml,sha256=iK0CeP3mynTnWIEsCi_jA9Gtb_UdAqwLC5nWHSTc-zc,17367
|
11
|
+
gito/constants.py,sha256=9G4sZbqLBg13FYieJqkq_hzek4-smmL4KKYF64tovQQ,698
|
12
|
+
gito/core.py,sha256=tp-eB_FIsZ2wffTiMrRLc_9MaFaGIky_ExWHWTf1DTk,9341
|
13
|
+
gito/gh_api.py,sha256=syhM8sbs_lLNG53bfRHQpusO818nwXCl4jDxVY__IK0,1204
|
14
|
+
gito/issue_trackers.py,sha256=nfib6zhvmL_zjRDCdZ0d6rMT4ZFJ3PxO5UORaJzb6gk,1495
|
15
|
+
gito/pipeline.py,sha256=Nq5VUVrXVDXVVYX6nVSMX1CyhoWsNtSeTOQyNgQAsdE,2672
|
16
|
+
gito/pipeline_steps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
+
gito/pipeline_steps/jira.py,sha256=cgRSHoU6j0lcK6hQfhg950PEmIu3uWLGMKZbW3-H3mg,1683
|
18
|
+
gito/pipeline_steps/linear.py,sha256=6UDc8nGKGpwHruPq8VItE2QBWshWxaTapoMhu_qjN_g,2445
|
19
|
+
gito/project_config.py,sha256=XdpXsRDFWBNNpktbZDp9p-nbijyKjG_oD6UWzGZSLjM,2580
|
20
|
+
gito/report_struct.py,sha256=tLhdmCPse3Jbo56y752vuGlndWY2f2g_mNFQ-BmJZGw,4160
|
21
|
+
gito/utils.py,sha256=HpterYtjceVhklJe0w1n7PIQJk8MJFUYi4FiG-CzMqg,6418
|
22
|
+
ai_cr-2.0.2.dist-info/LICENSE,sha256=VbdF_GbbDK24JvdTfnsxa2M6jmhsxmRSFeHCx-lICGE,1075
|
23
|
+
ai_cr-2.0.2.dist-info/METADATA,sha256=K8YJPk8Mv3GwYKbGe3gpE4qJgoWfv2wQBemoXOe-awc,7989
|
24
|
+
ai_cr-2.0.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
25
|
+
ai_cr-2.0.2.dist-info/entry_points.txt,sha256=Ua1DxkhJJ8TZuLgnH-IlWCkrre_0S0dq_GtYRaYupWk,38
|
26
|
+
ai_cr-2.0.2.dist-info/RECORD,,
|
gito/__main__.py
CHANGED
@@ -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()
|
gito/bootstrap.py
CHANGED
@@ -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)
|