commitwise 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.
- {commitwise-0.1.3 → commitwise-0.1.4}/PKG-INFO +1 -1
- commitwise-0.1.4/commitwise/__init__.py +1 -0
- commitwise-0.1.4/commitwise/ai/base.py +60 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise.egg-info/PKG-INFO +1 -1
- {commitwise-0.1.3 → commitwise-0.1.4}/pyproject.toml +1 -1
- commitwise-0.1.3/commitwise/__init__.py +0 -1
- commitwise-0.1.3/commitwise/ai/base.py +0 -37
- {commitwise-0.1.3 → commitwise-0.1.4}/README.md +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/ai/__init__.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/ai/local_engine.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/ai/openai_engine.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/ai_source.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/cli.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/cli_utils.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/config.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/file_source.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise/git_utils.py +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise.egg-info/SOURCES.txt +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise.egg-info/dependency_links.txt +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise.egg-info/entry_points.txt +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise.egg-info/requires.txt +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/commitwise.egg-info/top_level.txt +0 -0
- {commitwise-0.1.3 → commitwise-0.1.4}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__='0.1.4'
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class AIEngine(ABC):
|
|
5
|
+
"""
|
|
6
|
+
Base interface for AI enignes used by CommitWise
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
default_prompt: str = """
|
|
10
|
+
You are generating a Git commit message.
|
|
11
|
+
|
|
12
|
+
STRICT RULES:
|
|
13
|
+
- Output ONLY the commit message text.
|
|
14
|
+
- Do NOT include explanations, markdown, code fences, or extra text.
|
|
15
|
+
- Do NOT say things like "Here is" or "This commit message".
|
|
16
|
+
|
|
17
|
+
FORMAT:
|
|
18
|
+
1. Use Conventional Commits format:
|
|
19
|
+
<type>(<optional scope>): <short imperative summary>
|
|
20
|
+
|
|
21
|
+
2. Allowed types:
|
|
22
|
+
feat, fix, refactor, docs, test, chore
|
|
23
|
+
|
|
24
|
+
3. The first line:
|
|
25
|
+
- Must be imperative (e.g. add, fix, refactor, remove)
|
|
26
|
+
- Must be concise and clear
|
|
27
|
+
- Must be at most 72 characters
|
|
28
|
+
|
|
29
|
+
4. If a body is needed:
|
|
30
|
+
- Leave exactly one blank line after the title
|
|
31
|
+
- Each line MUST start with "- "
|
|
32
|
+
- Describe WHAT changed (not why)
|
|
33
|
+
- Keep lines short and scannable
|
|
34
|
+
|
|
35
|
+
5. Do NOT invent changes.
|
|
36
|
+
- Only describe what is present in the staged diff.
|
|
37
|
+
|
|
38
|
+
EXAMPLE OUTPUT:
|
|
39
|
+
|
|
40
|
+
refactor(ai): centralize and enforce strict commit prompt
|
|
41
|
+
|
|
42
|
+
- move AI commit prompt to base AIEngine
|
|
43
|
+
- enforce clean, git-ready output rules
|
|
44
|
+
- remove duplicated prompt logic from AI engines
|
|
45
|
+
|
|
46
|
+
STAGED DIFF:
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
def __init__(self, prompt: str):
|
|
51
|
+
# use provided prompt or default
|
|
52
|
+
self.prompt = prompt or self.default_prompt
|
|
53
|
+
|
|
54
|
+
@abstractmethod
|
|
55
|
+
def generate_commit(self, diff: str) -> str:
|
|
56
|
+
"""
|
|
57
|
+
Generate a git commit message from a staged diff
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
raise NotImplementedError
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__='0.1.3'
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class AIEngine(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Base interface for AI enignes used by CommitWise
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
default_prompt: str = """
|
|
10
|
-
You are generating a git commit message.
|
|
11
|
-
|
|
12
|
-
Rules:
|
|
13
|
-
- Output ONLY the commit message text.
|
|
14
|
-
- Do NOT include explanations.
|
|
15
|
-
- Do NOT include markdown.
|
|
16
|
-
- Do NOT include code fences.
|
|
17
|
-
- Do NOT include phrases like "Here is" or "This commit message".
|
|
18
|
-
|
|
19
|
-
Format:
|
|
20
|
-
- First line: short imperative summary (max 72 chars)
|
|
21
|
-
- Blank line
|
|
22
|
-
- Optional detailed description
|
|
23
|
-
|
|
24
|
-
Staged diff:
|
|
25
|
-
"""
|
|
26
|
-
|
|
27
|
-
def __init__(self, prompt: str):
|
|
28
|
-
# use provided prompt or default
|
|
29
|
-
self.prompt = prompt or self.default_prompt
|
|
30
|
-
|
|
31
|
-
@abstractmethod
|
|
32
|
-
def generate_commit(self, diff: str) -> str:
|
|
33
|
-
"""
|
|
34
|
-
Generate a git commit message from a staged diff
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
raise NotImplementedError
|
|
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
|