git-llm-tool 0.1.2__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.

Files changed (22) hide show
  1. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/PKG-INFO +3 -3
  2. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/README.md +2 -2
  3. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/core/config.py +11 -11
  4. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/core/jira_helper.py +27 -16
  5. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/pyproject.toml +1 -1
  6. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/LICENSE +0 -0
  7. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/__init__.py +0 -0
  8. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/__main__.py +0 -0
  9. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/cli.py +0 -0
  10. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/commands/__init__.py +0 -0
  11. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/commands/changelog_cmd.py +0 -0
  12. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/commands/commit_cmd.py +0 -0
  13. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/core/__init__.py +0 -0
  14. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/core/exceptions.py +0 -0
  15. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/core/git_helper.py +0 -0
  16. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/providers/__init__.py +0 -0
  17. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/providers/anthropic.py +0 -0
  18. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/providers/azure_openai.py +0 -0
  19. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/providers/base.py +0 -0
  20. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/providers/factory.py +0 -0
  21. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/providers/gemini.py +0 -0
  22. {git_llm_tool-0.1.2 → git_llm_tool-0.1.4}/git_llm_tool/providers/openai.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: git-llm-tool
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: AI-powered git commit message and changelog generator
5
5
  License: MIT
6
6
  Keywords: git,commit,llm,ai,automation,jira,conventional-commits
@@ -71,7 +71,7 @@ pip install git-llm-tool
71
71
 
72
72
  ### From Source
73
73
  ```bash
74
- git clone https://github.com/your-username/git-llm-tool.git
74
+ git clone https://github.com/z0890142/git-llm-tool.git
75
75
  cd git-llm-tool
76
76
  poetry install
77
77
  ```
@@ -332,7 +332,7 @@ jira:
332
332
  ### Setup Development Environment
333
333
  ```bash
334
334
  # Clone repository
335
- git clone https://github.com/your-username/git-llm-tool.git
335
+ git clone https://github.com/z0890142/git-llm-tool.git
336
336
  cd git-llm-tool
337
337
 
338
338
  # Install dependencies
@@ -42,7 +42,7 @@ pip install git-llm-tool
42
42
 
43
43
  ### From Source
44
44
  ```bash
45
- git clone https://github.com/your-username/git-llm-tool.git
45
+ git clone https://github.com/z0890142/git-llm-tool.git
46
46
  cd git-llm-tool
47
47
  poetry install
48
48
  ```
@@ -303,7 +303,7 @@ jira:
303
303
  ### Setup Development Environment
304
304
  ```bash
305
305
  # Clone repository
306
- git clone https://github.com/your-username/git-llm-tool.git
306
+ git clone https://github.com/z0890142/git-llm-tool.git
307
307
  cd git-llm-tool
308
308
 
309
309
  # Install dependencies
@@ -22,7 +22,7 @@ class LlmConfig:
22
22
  class JiraConfig:
23
23
  """Jira integration configuration."""
24
24
  enabled: bool = False
25
- branch_regex: Optional[str] = None
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
- branch_regex=jira_data.get("branch_regex")
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
- "branch_regex": self._config.jira.branch_regex
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"]["branch_regex"] is None:
209
- del config_dict["jira"]["branch_regex"]
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.branch_regex
246
- elif keys[0] == "jira" and keys[1] == "branch_regex":
247
- self._config.jira.branch_regex = value
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.branch_regex
277
- elif keys[0] == "jira" and keys[1] == "branch_regex":
278
- return self._config.jira.branch_regex
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
- match = re.search(pattern, branch_name)
68
- if match:
69
- # If regex has capture groups, use the first one
70
- if match.groups():
71
- return match.group(1)
72
- else:
73
- # If no capture groups, use the whole match
74
- return match.group(0)
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.branch_regex:
172
+ # Validate ticket pattern regex if provided
173
+ if self.config.jira.ticket_pattern:
163
174
  try:
164
- re.compile(self.config.jira.branch_regex)
175
+ re.compile(self.config.jira.ticket_pattern)
165
176
  except re.error as e:
166
- raise JiraError(f"Invalid branch regex pattern: {e}")
177
+ raise JiraError(f"Invalid ticket pattern regex: {e}")
167
178
 
168
179
  return True
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "git-llm-tool"
3
- version = "0.1.2"
3
+ version = "0.1.4"
4
4
  description = "AI-powered git commit message and changelog generator"
5
5
  authors = ["skyler-gogolook <skyler.lo@gogolook.com>"]
6
6
  readme = "README.md"
File without changes