git-llm-tool 0.1.3__tar.gz → 0.1.4__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.
Potentially problematic release.
This version of git-llm-tool might be problematic. Click here for more details.
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/PKG-INFO +1 -1
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/core/config.py +11 -11
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/core/jira_helper.py +27 -16
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/pyproject.toml +1 -1
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/LICENSE +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/README.md +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/__init__.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/__main__.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/cli.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/commands/__init__.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/commands/changelog_cmd.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/commands/commit_cmd.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/core/__init__.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/core/exceptions.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/core/git_helper.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/providers/__init__.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/providers/anthropic.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/providers/azure_openai.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/providers/base.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/providers/factory.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/providers/gemini.py +0 -0
- {git_llm_tool-0.1.3 → git_llm_tool-0.1.4}/git_llm_tool/providers/openai.py +0 -0
|
@@ -22,7 +22,7 @@ class LlmConfig:
|
|
|
22
22
|
class JiraConfig:
|
|
23
23
|
"""Jira integration configuration."""
|
|
24
24
|
enabled: bool = False
|
|
25
|
-
|
|
25
|
+
ticket_pattern: Optional[str] = None # Jira ticket regex pattern
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
@dataclass
|
|
@@ -161,7 +161,7 @@ class ConfigLoader:
|
|
|
161
161
|
jira_data = config_data.get("jira", {})
|
|
162
162
|
jira_config = JiraConfig(
|
|
163
163
|
enabled=jira_data.get("enabled", False),
|
|
164
|
-
|
|
164
|
+
ticket_pattern=jira_data.get("ticket_pattern")
|
|
165
165
|
)
|
|
166
166
|
|
|
167
167
|
# Create Editor config
|
|
@@ -191,7 +191,7 @@ class ConfigLoader:
|
|
|
191
191
|
},
|
|
192
192
|
"jira": {
|
|
193
193
|
"enabled": self._config.jira.enabled,
|
|
194
|
-
"
|
|
194
|
+
"ticket_pattern": self._config.jira.ticket_pattern
|
|
195
195
|
},
|
|
196
196
|
"editor": {
|
|
197
197
|
"preferred_editor": self._config.editor.preferred_editor
|
|
@@ -205,8 +205,8 @@ class ConfigLoader:
|
|
|
205
205
|
del config_dict["llm"]["azure_openai"]
|
|
206
206
|
|
|
207
207
|
# Remove None values from jira config
|
|
208
|
-
if config_dict["jira"]["
|
|
209
|
-
del config_dict["jira"]["
|
|
208
|
+
if config_dict["jira"]["ticket_pattern"] is None:
|
|
209
|
+
del config_dict["jira"]["ticket_pattern"]
|
|
210
210
|
|
|
211
211
|
# Remove None values from editor config
|
|
212
212
|
if config_dict["editor"]["preferred_editor"] is None:
|
|
@@ -242,9 +242,9 @@ class ConfigLoader:
|
|
|
242
242
|
# Handle jira.enabled
|
|
243
243
|
elif keys[0] == "jira" and keys[1] == "enabled":
|
|
244
244
|
self._config.jira.enabled = value.lower() in ("true", "1", "yes", "on")
|
|
245
|
-
# Handle jira.
|
|
246
|
-
elif keys[0] == "jira" and keys[1] == "
|
|
247
|
-
self._config.jira.
|
|
245
|
+
# Handle jira.ticket_pattern
|
|
246
|
+
elif keys[0] == "jira" and keys[1] == "ticket_pattern":
|
|
247
|
+
self._config.jira.ticket_pattern = value
|
|
248
248
|
# Handle editor.preferred_editor
|
|
249
249
|
elif keys[0] == "editor" and keys[1] == "preferred_editor":
|
|
250
250
|
self._config.editor.preferred_editor = value
|
|
@@ -273,9 +273,9 @@ class ConfigLoader:
|
|
|
273
273
|
# Handle jira.enabled
|
|
274
274
|
elif keys[0] == "jira" and keys[1] == "enabled":
|
|
275
275
|
return self._config.jira.enabled
|
|
276
|
-
# Handle jira.
|
|
277
|
-
elif keys[0] == "jira" and keys[1] == "
|
|
278
|
-
return self._config.jira.
|
|
276
|
+
# Handle jira.ticket_pattern
|
|
277
|
+
elif keys[0] == "jira" and keys[1] == "ticket_pattern":
|
|
278
|
+
return self._config.jira.ticket_pattern
|
|
279
279
|
# Handle editor.preferred_editor
|
|
280
280
|
elif keys[0] == "editor" and keys[1] == "preferred_editor":
|
|
281
281
|
return self._config.editor.preferred_editor
|
|
@@ -57,21 +57,19 @@ class JiraHelper:
|
|
|
57
57
|
Returns:
|
|
58
58
|
Jira ticket number if found, None otherwise
|
|
59
59
|
"""
|
|
60
|
-
if not self.config.jira.branch_regex:
|
|
61
|
-
return None
|
|
62
|
-
|
|
63
60
|
try:
|
|
64
61
|
branch_name = self.git_helper.get_current_branch()
|
|
65
|
-
pattern = self.config.jira.branch_regex
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
if
|
|
69
|
-
|
|
70
|
-
if match
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
# Use ticket pattern to extract Jira ticket
|
|
64
|
+
if self.config.jira.ticket_pattern:
|
|
65
|
+
match = re.search(self.config.jira.ticket_pattern, branch_name)
|
|
66
|
+
if match:
|
|
67
|
+
# If the pattern has capture groups, use the first one
|
|
68
|
+
if match.groups():
|
|
69
|
+
return match.group(1)
|
|
70
|
+
else:
|
|
71
|
+
# If no capture groups, use the whole match
|
|
72
|
+
return match.group(0)
|
|
75
73
|
|
|
76
74
|
except Exception:
|
|
77
75
|
# Ignore any errors in regex matching or git operations
|
|
@@ -79,6 +77,19 @@ class JiraHelper:
|
|
|
79
77
|
|
|
80
78
|
return None
|
|
81
79
|
|
|
80
|
+
def _is_jira_ticket_format(self, text: str) -> bool:
|
|
81
|
+
"""Check if text matches typical Jira ticket format.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
text: Text to check
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
True if text looks like a Jira ticket (e.g., PROJECT-123)
|
|
88
|
+
"""
|
|
89
|
+
import re
|
|
90
|
+
# Common Jira ticket format: UPPERCASE-DIGITS
|
|
91
|
+
return bool(re.match(r'^[A-Z]+-\d+$', text))
|
|
92
|
+
|
|
82
93
|
def _prompt_for_ticket(self) -> Optional[str]:
|
|
83
94
|
"""Interactively prompt user for Jira ticket.
|
|
84
95
|
|
|
@@ -158,11 +169,11 @@ class JiraHelper:
|
|
|
158
169
|
if not self.config.jira.enabled:
|
|
159
170
|
return True
|
|
160
171
|
|
|
161
|
-
# Validate regex if provided
|
|
162
|
-
if self.config.jira.
|
|
172
|
+
# Validate ticket pattern regex if provided
|
|
173
|
+
if self.config.jira.ticket_pattern:
|
|
163
174
|
try:
|
|
164
|
-
re.compile(self.config.jira.
|
|
175
|
+
re.compile(self.config.jira.ticket_pattern)
|
|
165
176
|
except re.error as e:
|
|
166
|
-
raise JiraError(f"Invalid
|
|
177
|
+
raise JiraError(f"Invalid ticket pattern regex: {e}")
|
|
167
178
|
|
|
168
179
|
return True
|
|
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
|