ai-cr 3.2.1__tar.gz → 3.2.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.
- {ai_cr-3.2.1 → ai_cr-3.2.2}/PKG-INFO +1 -1
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/report_struct.py +5 -5
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/utils.py +25 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/pyproject.toml +1 -1
- {ai_cr-3.2.1 → ai_cr-3.2.2}/LICENSE +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/README.md +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/__init__.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/__main__.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/bootstrap.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/cli.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/cli_base.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/commands/__init__.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/commands/deploy.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/commands/fix.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/commands/gh_post_review_comment.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/commands/gh_react_to_comment.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/commands/linear_comment.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/commands/repl.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/commands/version.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/config.toml +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/constants.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/context.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/core.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/env.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/gh_api.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/issue_trackers.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/pipeline.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/pipeline_steps/__init__.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/pipeline_steps/jira.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/pipeline_steps/linear.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/project_config.py +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/answer.j2 +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/github_workflows/components/env-vars.j2 +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/github_workflows/components/installs.j2 +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/github_workflows/gito-code-review.yml.j2 +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/github_workflows/gito-react-to-comments.yml.j2 +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/partial/aux_files.j2 +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/questions/changes_summary.j2 +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/questions/release_notes.j2 +0 -0
- {ai_cr-3.2.1 → ai_cr-3.2.2}/gito/tpl/questions/test_cases.j2 +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: ai-cr
|
3
|
-
Version: 3.2.
|
3
|
+
Version: 3.2.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
|
@@ -12,7 +12,7 @@ import textwrap
|
|
12
12
|
|
13
13
|
from .constants import JSON_REPORT_FILE_NAME, HTML_TEXT_ICON, HTML_CR_COMMENT_MARKER
|
14
14
|
from .project_config import ProjectConfig
|
15
|
-
from .utils import syntax_hint, block_wrap_lr, max_line_len, remove_html_comments
|
15
|
+
from .utils import syntax_hint, block_wrap_lr, max_line_len, remove_html_comments, filter_kwargs
|
16
16
|
|
17
17
|
|
18
18
|
@dataclass
|
@@ -40,7 +40,7 @@ class Issue:
|
|
40
40
|
|
41
41
|
def __post_init__(self):
|
42
42
|
self.affected_lines = [
|
43
|
-
Issue.AffectedCode(**dict(file=self.file) | i)
|
43
|
+
Issue.AffectedCode(**filter_kwargs(Issue.AffectedCode, dict(file=self.file) | i))
|
44
44
|
for i in self.affected_lines
|
45
45
|
]
|
46
46
|
|
@@ -63,7 +63,7 @@ class Report:
|
|
63
63
|
MARKDOWN = "md"
|
64
64
|
CLI = "cli"
|
65
65
|
|
66
|
-
issues: dict[str, list[Issue]] = field(default_factory=dict)
|
66
|
+
issues: dict[str, list[Issue | dict]] = field(default_factory=dict)
|
67
67
|
summary: str = field(default="")
|
68
68
|
number_of_processed_files: int = field(default=0)
|
69
69
|
total_issues: int = field(init=False)
|
@@ -84,10 +84,10 @@ class Report:
|
|
84
84
|
for file in self.issues.keys():
|
85
85
|
self.issues[file] = [
|
86
86
|
Issue(
|
87
|
-
**{
|
87
|
+
**filter_kwargs(Issue, {
|
88
88
|
"id": (issue_id := issue_id + 1),
|
89
89
|
"file": file,
|
90
|
-
} | issue
|
90
|
+
} | issue)
|
91
91
|
)
|
92
92
|
for issue in self.issues[file]
|
93
93
|
]
|
@@ -1,6 +1,8 @@
|
|
1
|
+
import logging
|
1
2
|
import re
|
2
3
|
import sys
|
3
4
|
import os
|
5
|
+
from dataclasses import fields
|
4
6
|
from pathlib import Path
|
5
7
|
import importlib.metadata
|
6
8
|
from typing import Optional
|
@@ -240,3 +242,26 @@ def remove_html_comments(text):
|
|
240
242
|
Removes all HTML comments (<!-- ... -->) from the input text.
|
241
243
|
"""
|
242
244
|
return re.sub(r'<!--.*?-->\s*', '', text, flags=re.DOTALL)
|
245
|
+
|
246
|
+
|
247
|
+
def filter_kwargs(cls, kwargs, log_warnings=True):
|
248
|
+
"""
|
249
|
+
Filters the keyword arguments to only include those that are fields of the given dataclass.
|
250
|
+
Args:
|
251
|
+
cls: The dataclass type to filter against.
|
252
|
+
kwargs: A dictionary of keyword arguments.
|
253
|
+
log_warnings: If True, logs warnings for fields not in the dataclass.
|
254
|
+
Returns:
|
255
|
+
A dictionary containing only the fields that are defined in the dataclass.
|
256
|
+
"""
|
257
|
+
cls_fields = {f.name for f in fields(cls)}
|
258
|
+
filtered = {}
|
259
|
+
for k, v in kwargs.items():
|
260
|
+
if k in cls_fields:
|
261
|
+
filtered[k] = v
|
262
|
+
else:
|
263
|
+
if log_warnings:
|
264
|
+
logging.warning(
|
265
|
+
f"Warning: field '{k}' not in {cls.__name__}, dropping."
|
266
|
+
)
|
267
|
+
return filtered
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "ai-cr"
|
3
|
-
version = "3.2.
|
3
|
+
version = "3.2.2"
|
4
4
|
description = "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
|
authors = ["Nayjest <mail@vitaliy.in>"]
|
6
6
|
readme = "README.md"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|