lgit-cli 5.4.0__py3-none-any.whl → 5.6.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.
- lgit/__init__.py +1 -1
- lgit/api.py +12 -10
- lgit/changelog.py +612 -221
- lgit/cli.py +185 -25
- lgit/compose.py +367 -75
- lgit/config.py +63 -0
- lgit/diffing.py +42 -0
- lgit/format_build.py +316 -0
- lgit/format_data.py +371 -0
- lgit/format_infra.py +538 -0
- lgit/format_markdown.py +203 -0
- lgit/format_markup.py +195 -0
- lgit/format_paths.py +103 -0
- lgit/format_tree.py +328 -0
- lgit/format_web.py +591 -0
- lgit/git.py +34 -0
- lgit/judgment.py +330 -0
- lgit/mechanical.py +337 -0
- lgit/models.py +41 -0
- lgit/patch.py +53 -14
- lgit/reformat.py +1164 -0
- lgit/resources/commit_types.json +7 -7
- lgit/resources/model_pricing.json +2 -1
- lgit/resources/prompts/analysis.md +2 -0
- lgit/resources/prompts/fast.md +2 -0
- lgit/resources/prompts/map.md +2 -0
- lgit/resources/prompts/summary.md +13 -16
- lgit/resources/prompts/synthesis.md +116 -0
- lgit/resources/validation_data.json +1 -1
- lgit/style.py +11 -0
- lgit/syntax_tree.py +179 -0
- lgit/synthesis.py +285 -0
- lgit/templates.py +70 -5
- lgit/validation.py +22 -2
- {lgit_cli-5.4.0.dist-info → lgit_cli-5.6.0.dist-info}/METADATA +79 -2
- lgit_cli-5.6.0.dist-info/RECORD +63 -0
- {lgit_cli-5.4.0.dist-info → lgit_cli-5.6.0.dist-info}/WHEEL +1 -1
- lgit_cli-5.4.0.dist-info/RECORD +0 -49
- {lgit_cli-5.4.0.dist-info → lgit_cli-5.6.0.dist-info}/entry_points.txt +0 -0
- {lgit_cli-5.4.0.dist-info → lgit_cli-5.6.0.dist-info}/licenses/LICENSE +0 -0
lgit/__init__.py
CHANGED
lgit/api.py
CHANGED
|
@@ -207,19 +207,19 @@ def strip_type_prefix(summary: str, commit_type: str | None = None, scope: str |
|
|
|
207
207
|
|
|
208
208
|
|
|
209
209
|
def summary_from_holistic_analysis(analysis: ConventionalAnalysis, config: CommitConfig, stat: str = "") -> str | None:
|
|
210
|
-
"""
|
|
211
|
-
|
|
212
|
-
del stat
|
|
210
|
+
"""Reuse a compliant analysis summary, repairing tense; return None when a summary call is needed."""
|
|
213
211
|
if not analysis.summary or not str(analysis.summary).strip():
|
|
214
212
|
return None
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
commit_type = str(analysis.commit_type)
|
|
214
|
+
scope = None if analysis.scope is None else str(analysis.scope)
|
|
215
|
+
draft = strip_type_prefix(str(analysis.summary).strip(), commit_type, scope).rstrip(" .")
|
|
216
|
+
summary, _ = _accept_summary(draft, commit_type, stat)
|
|
217
|
+
if summary is None:
|
|
218
|
+
return None
|
|
219
|
+
prefix = f"{commit_type}({scope}): " if scope else f"{commit_type}: "
|
|
220
|
+
if len((prefix + summary).encode("utf-8")) > min(config.summary_soft_limit, config.summary_hard_limit):
|
|
221
221
|
return None
|
|
222
|
-
return
|
|
222
|
+
return summary
|
|
223
223
|
|
|
224
224
|
|
|
225
225
|
async def generate_summary_from_analysis(
|
|
@@ -238,6 +238,7 @@ async def generate_summary_from_analysis(
|
|
|
238
238
|
prefix_len = len(commit_type) + 2 + (len(scope) + 2 if scope else 0)
|
|
239
239
|
chars = max(20, config.summary_guideline - prefix_len)
|
|
240
240
|
details = "\n".join(f"- {detail}" for detail in analysis.body_texts()) or f"- {analysis.summary or ''}"
|
|
241
|
+
heading = strip_type_prefix(str(analysis.summary or ""), commit_type, scope).rstrip(" .")
|
|
241
242
|
system_prompt, user_prompt = render_prompt(
|
|
242
243
|
"summary",
|
|
243
244
|
{
|
|
@@ -245,6 +246,7 @@ async def generate_summary_from_analysis(
|
|
|
245
246
|
"scope": scope,
|
|
246
247
|
"chars": chars,
|
|
247
248
|
"user_context": user_context or "",
|
|
249
|
+
"draft": heading,
|
|
248
250
|
"details": details,
|
|
249
251
|
"stat": condense_stat(stat, max_files=30),
|
|
250
252
|
},
|