ai-cr 3.2.2__py3-none-any.whl → 3.3.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.
Files changed (40) hide show
  1. {ai_cr-3.2.2.dist-info → ai_cr-3.3.0.dist-info}/LICENSE +21 -21
  2. {ai_cr-3.2.2.dist-info → ai_cr-3.3.0.dist-info}/METADATA +1 -1
  3. ai_cr-3.3.0.dist-info/RECORD +41 -0
  4. {ai_cr-3.2.2.dist-info → ai_cr-3.3.0.dist-info}/WHEEL +1 -1
  5. gito/__main__.py +4 -4
  6. gito/bootstrap.py +90 -90
  7. gito/cli.py +255 -244
  8. gito/cli_base.py +104 -94
  9. gito/commands/__init__.py +1 -1
  10. gito/commands/deploy.py +138 -138
  11. gito/commands/fix.py +160 -160
  12. gito/commands/gh_post_review_comment.py +111 -111
  13. gito/commands/gh_react_to_comment.py +217 -217
  14. gito/commands/linear_comment.py +53 -53
  15. gito/commands/repl.py +30 -30
  16. gito/commands/version.py +8 -8
  17. gito/config.toml +450 -448
  18. gito/constants.py +15 -14
  19. gito/context.py +19 -19
  20. gito/core.py +520 -508
  21. gito/env.py +8 -7
  22. gito/gh_api.py +116 -116
  23. gito/issue_trackers.py +50 -50
  24. gito/pipeline.py +83 -83
  25. gito/pipeline_steps/jira.py +62 -62
  26. gito/pipeline_steps/linear.py +85 -85
  27. gito/project_config.py +85 -85
  28. gito/report_struct.py +136 -136
  29. gito/tpl/answer.j2 +25 -25
  30. gito/tpl/github_workflows/components/env-vars.j2 +11 -11
  31. gito/tpl/github_workflows/components/installs.j2 +23 -23
  32. gito/tpl/github_workflows/gito-code-review.yml.j2 +32 -32
  33. gito/tpl/github_workflows/gito-react-to-comments.yml.j2 +70 -70
  34. gito/tpl/partial/aux_files.j2 +8 -8
  35. gito/tpl/questions/changes_summary.j2 +55 -55
  36. gito/tpl/questions/release_notes.j2 +26 -26
  37. gito/tpl/questions/test_cases.j2 +37 -37
  38. gito/utils.py +267 -267
  39. ai_cr-3.2.2.dist-info/RECORD +0 -41
  40. {ai_cr-3.2.2.dist-info → ai_cr-3.3.0.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: 3.2.2
3
+ Version: 3.3.0
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
@@ -0,0 +1,41 @@
1
+ gito/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ gito/__main__.py,sha256=EClCwCzb6h6YBpt0hrnG4h0mlNhNePyg_xBNNSVm1os,65
3
+ gito/bootstrap.py,sha256=QSDYrk-HQsB6srXW_vaKAU77zoouUf5tnJj3ZXabETk,3307
4
+ gito/cli.py,sha256=yHS4jiGPB8Tcbt7eJwjRyhqL1FTZvhOSiUzhMyVZOqQ,8962
5
+ gito/cli_base.py,sha256=W-OsKAdhHWyRSRpgfrOAD7ESIJbVCrSLkP2lXsmXVGo,2995
6
+ gito/commands/__init__.py,sha256=NKUUDskR6taZGbHk5qR9msDS22aHpdzAZlUDxzRdMYA,56
7
+ gito/commands/deploy.py,sha256=3t-ktVEwMcU54U82_SZcc8Jv9j6mDCniSzhGJMbBPsk,5103
8
+ gito/commands/fix.py,sha256=U7lLNUlEPKIRNPw-E-6bqI1eQRml9AaAVCGEezJk-h8,5535
9
+ gito/commands/gh_post_review_comment.py,sha256=qSfWdUlhWfrDUs2VFM0G1JRV844Jf_1oRRpC4VlpfFE,3906
10
+ gito/commands/gh_react_to_comment.py,sha256=nlqjdvRdTEl8Y0H7mIqvkHQmq0ZHZn56j6JBC9FNr9U,7307
11
+ gito/commands/linear_comment.py,sha256=OabFFR6v2okfi5elr3u8HCP49RshCiVc9bHsoTmunw4,1537
12
+ gito/commands/repl.py,sha256=PA-ZZpIwQIyKEQ8SHunC2KK69-59d4l2AeU6OQoQjG8,661
13
+ gito/commands/version.py,sha256=LUdGS_Nmn9d6lmtLr5E2X_AH7M0SnUUVr9bsm6dOJLA,186
14
+ gito/config.toml,sha256=HWBKt4AUZNAaKSLmQYFR9vczgkhqEIndUwrC8CCREn0,18257
15
+ gito/constants.py,sha256=9iQY1ZI6IL0RyBTWwGJN40Upflqqj7m8ApixBOwpTVM,858
16
+ gito/context.py,sha256=P6r2O4SgAdW68WH2gRgxUHIYOIBQH1TFBAQOu9W1DrU,465
17
+ gito/core.py,sha256=W9M4R1G25RXtQA0VQevW6EwZoILk4qFg_cszlmtPbUE,18868
18
+ gito/env.py,sha256=BgqjuYxtx10epa7BL_RN5xNal2WTzY_muemW_M6UwIw,179
19
+ gito/gh_api.py,sha256=x9A40BHm7jGF410cJq6-dFsKN1I6krOv_qFz50vLfp4,4168
20
+ gito/issue_trackers.py,sha256=T9aqfpRx_aEJbJNZO-0FcA_WUQPBKuO_YEgb0UZgBnk,1601
21
+ gito/pipeline.py,sha256=bFEyzqpEr9j-HQmGHGEPPi-WFwL-IqH6g3-EmrLiQ3g,2693
22
+ gito/pipeline_steps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ gito/pipeline_steps/jira.py,sha256=c_kEI3v66qbcUG4eSal36ytSj4bGYJzx5rZPWt_SQo8,1924
24
+ gito/pipeline_steps/linear.py,sha256=7-u0vfEdruJPJwvaqJeAI0AvsUcrRqnh6C9DPKePQpI,2530
25
+ gito/project_config.py,sha256=ZLdDSibxVNBfzpihYBG0R_v36-7MoeyIuaZ-OkoCUvg,3322
26
+ gito/report_struct.py,sha256=QolfBnkY8PJid5IE7lSJxss0tBgfynR2fbTT7bFaLPI,4535
27
+ gito/tpl/answer.j2,sha256=VfJGSQVdR-JmdlNurG7ott6a49kyuO_xyVNF0mphpIk,725
28
+ gito/tpl/github_workflows/components/env-vars.j2,sha256=J6C8zeE4swizLcCAd0sMLbF-N4JD0rf2aPwQYVowac8,417
29
+ gito/tpl/github_workflows/components/installs.j2,sha256=ZtC5UxObwyeZzbboyf0rWTQ8E71BMIFkvqDaJfPzMtE,716
30
+ gito/tpl/github_workflows/gito-code-review.yml.j2,sha256=QbyUaCbF2zTXSUCbIBh_Fsc9Xm69W7hjIpy1LYXLdMk,995
31
+ gito/tpl/github_workflows/gito-react-to-comments.yml.j2,sha256=bCRJ6RPDs0M9bLhE9nx3hHaG6du6zrQx-Ve-TIZCdXs,2199
32
+ gito/tpl/partial/aux_files.j2,sha256=DBH7o1nrAznQSYThIbrjAL0_4kmvEZQNoYq7BRTGN9I,199
33
+ gito/tpl/questions/changes_summary.j2,sha256=5H2RFNtKirHEIfPbh3OE6g-BNySU30NyXwEC7xy4JRo,2268
34
+ gito/tpl/questions/release_notes.j2,sha256=dBlWJLhh9YB_4pPaEcS4zMHzB49NVP3uoR6xP7-vfC8,915
35
+ gito/tpl/questions/test_cases.j2,sha256=cngnr0ZSB9Hnb6yJPHTtIzR7R1LVfJi0MexcZj2OwxA,1447
36
+ gito/utils.py,sha256=0Vh2s1Z9rL8-5pvK5KD1kX6AjoLt9Qio5PnqfdmZbko,8028
37
+ ai_cr-3.3.0.dist-info/entry_points.txt,sha256=Ua1DxkhJJ8TZuLgnH-IlWCkrre_0S0dq_GtYRaYupWk,38
38
+ ai_cr-3.3.0.dist-info/LICENSE,sha256=XATf3zv-CppUSJqI18KLhwnPEomUXEl5WbBzFyb9OSU,1096
39
+ ai_cr-3.3.0.dist-info/METADATA,sha256=J-ScElV68dc1pRx5IPGKmf9oOQuRpc8GIYfI5CW453s,8874
40
+ ai_cr-3.3.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
41
+ ai_cr-3.3.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
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,90 +1,90 @@
1
- import os
2
- import sys
3
- import io
4
- import logging
5
- from datetime import datetime
6
- from pathlib import Path
7
-
8
- import microcore as mc
9
-
10
- from .utils import is_running_in_github_action
11
- from .constants import HOME_ENV_PATH, EXECUTABLE, PROJECT_GITO_FOLDER
12
- from .env import Env
13
-
14
-
15
- def setup_logging(log_level: int = logging.INFO):
16
- class CustomFormatter(logging.Formatter):
17
- def format(self, record):
18
- dt = datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S")
19
- message, level_name = record.getMessage(), record.levelname
20
- if record.levelno == logging.WARNING:
21
- message = mc.ui.yellow(message)
22
- level_name = mc.ui.yellow(level_name)
23
- if record.levelno >= logging.ERROR:
24
- message = mc.ui.red(message)
25
- level_name = mc.ui.red(level_name)
26
- return f"{dt} {level_name}: {message}"
27
-
28
- handler = logging.StreamHandler()
29
- handler.setFormatter(CustomFormatter())
30
- logging.basicConfig(level=log_level, handlers=[handler])
31
-
32
-
33
- def bootstrap(verbosity: int = 1):
34
- """Bootstrap the application with the environment configuration."""
35
- log_levels_by_verbosity = {
36
- 0: logging.CRITICAL,
37
- 1: logging.INFO,
38
- 2: logging.INFO,
39
- 3: logging.DEBUG,
40
- }
41
- Env.verbosity = verbosity
42
- Env.logging_level = log_levels_by_verbosity.get(verbosity, logging.INFO)
43
- setup_logging(Env.logging_level)
44
- logging.info(
45
- f"Bootstrapping Gito v{Env.gito_version}... "
46
- + mc.ui.gray(f"[verbosity={verbosity}]")
47
- )
48
-
49
- # cp1251 is used on Windows when redirecting output
50
- if sys.stdout.encoding and sys.stdout.encoding.lower() != "utf-8":
51
- sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
52
-
53
- try:
54
- mc.configure(
55
- DOT_ENV_FILE=HOME_ENV_PATH,
56
- USE_LOGGING=verbosity >= 1,
57
- EMBEDDING_DB_TYPE=mc.EmbeddingDbType.NONE,
58
- PROMPT_TEMPLATES_PATH=[
59
- PROJECT_GITO_FOLDER,
60
- Path(__file__).parent / "tpl"
61
- ],
62
- )
63
- if verbosity > 1:
64
- mc.logging.LoggingConfig.STRIP_REQUEST_LINES = None
65
- else:
66
- mc.logging.LoggingConfig.STRIP_REQUEST_LINES = [300, 15]
67
-
68
- except mc.LLMConfigError as e:
69
- msg = str(e)
70
- if is_running_in_github_action():
71
- ref = os.getenv("GITHUB_WORKFLOW_REF", "")
72
- if ref:
73
- # example value: 'owner/repo/.github/workflows/ai-code-review.yml@refs/pull/1/merge'
74
- ref = ref.split("@")[0]
75
- ref = ref.split(".github/workflows/")[-1]
76
- ref = f" (.github/workflows/{ref})"
77
- msg += (
78
- f"\nPlease check your GitHub Action Secrets "
79
- f"and `env` configuration section of the corresponding workflow step{ref}."
80
- )
81
- else:
82
- msg += (
83
- f"\nPlease run '{EXECUTABLE} setup' "
84
- "to configure LLM API access (API keys, model, etc)."
85
- )
86
- print(mc.ui.red(msg))
87
- raise SystemExit(2)
88
- except Exception as e:
89
- logging.error(f"Unexpected configuration error: {e}")
90
- raise SystemExit(3)
1
+ import os
2
+ import sys
3
+ import io
4
+ import logging
5
+ from datetime import datetime
6
+ from pathlib import Path
7
+
8
+ import microcore as mc
9
+
10
+ from .utils import is_running_in_github_action
11
+ from .constants import HOME_ENV_PATH, EXECUTABLE, PROJECT_GITO_FOLDER
12
+ from .env import Env
13
+
14
+
15
+ def setup_logging(log_level: int = logging.INFO):
16
+ class CustomFormatter(logging.Formatter):
17
+ def format(self, record):
18
+ dt = datetime.fromtimestamp(record.created).strftime("%Y-%m-%d %H:%M:%S")
19
+ message, level_name = record.getMessage(), record.levelname
20
+ if record.levelno == logging.WARNING:
21
+ message = mc.ui.yellow(message)
22
+ level_name = mc.ui.yellow(level_name)
23
+ if record.levelno >= logging.ERROR:
24
+ message = mc.ui.red(message)
25
+ level_name = mc.ui.red(level_name)
26
+ return f"{dt} {level_name}: {message}"
27
+
28
+ handler = logging.StreamHandler()
29
+ handler.setFormatter(CustomFormatter())
30
+ logging.basicConfig(level=log_level, handlers=[handler])
31
+
32
+
33
+ def bootstrap(verbosity: int = 1):
34
+ """Bootstrap the application with the environment configuration."""
35
+ log_levels_by_verbosity = {
36
+ 0: logging.CRITICAL,
37
+ 1: logging.INFO,
38
+ 2: logging.INFO,
39
+ 3: logging.DEBUG,
40
+ }
41
+ Env.verbosity = verbosity
42
+ Env.logging_level = log_levels_by_verbosity.get(verbosity, logging.INFO)
43
+ setup_logging(Env.logging_level)
44
+ logging.info(
45
+ f"Bootstrapping Gito v{Env.gito_version}... "
46
+ + mc.ui.gray(f"[verbosity={verbosity}]")
47
+ )
48
+
49
+ # cp1251 is used on Windows when redirecting output
50
+ if sys.stdout.encoding and sys.stdout.encoding.lower() != "utf-8":
51
+ sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
52
+
53
+ try:
54
+ mc.configure(
55
+ DOT_ENV_FILE=HOME_ENV_PATH,
56
+ USE_LOGGING=verbosity >= 1,
57
+ EMBEDDING_DB_TYPE=mc.EmbeddingDbType.NONE,
58
+ PROMPT_TEMPLATES_PATH=[
59
+ PROJECT_GITO_FOLDER,
60
+ Path(__file__).parent / "tpl"
61
+ ],
62
+ )
63
+ if verbosity > 1:
64
+ mc.logging.LoggingConfig.STRIP_REQUEST_LINES = None
65
+ else:
66
+ mc.logging.LoggingConfig.STRIP_REQUEST_LINES = [300, 15]
67
+
68
+ except mc.LLMConfigError as e:
69
+ msg = str(e)
70
+ if is_running_in_github_action():
71
+ ref = os.getenv("GITHUB_WORKFLOW_REF", "")
72
+ if ref:
73
+ # example value: 'owner/repo/.github/workflows/ai-code-review.yml@refs/pull/1/merge'
74
+ ref = ref.split("@")[0]
75
+ ref = ref.split(".github/workflows/")[-1]
76
+ ref = f" (.github/workflows/{ref})"
77
+ msg += (
78
+ f"\nPlease check your GitHub Action Secrets "
79
+ f"and `env` configuration section of the corresponding workflow step{ref}."
80
+ )
81
+ else:
82
+ msg += (
83
+ f"\nPlease run '{EXECUTABLE} setup' "
84
+ "to configure LLM API access (API keys, model, etc)."
85
+ )
86
+ print(mc.ui.red(msg))
87
+ raise SystemExit(2)
88
+ except Exception as e:
89
+ logging.error(f"Unexpected configuration error: {e}")
90
+ raise SystemExit(3)