commit-check 2.20.0__py3-none-any.whl → 2.20.2__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.
- commit_check/ai_signatures_data.py +89 -2
- commit_check/engine.py +50 -16
- commit_check/main.py +47 -16
- commit_check/rules_catalog.py +6 -0
- {commit_check-2.20.0.dist-info → commit_check-2.20.2.dist-info}/METADATA +16 -3
- {commit_check-2.20.0.dist-info → commit_check-2.20.2.dist-info}/RECORD +10 -10
- {commit_check-2.20.0.dist-info → commit_check-2.20.2.dist-info}/WHEEL +0 -0
- {commit_check-2.20.0.dist-info → commit_check-2.20.2.dist-info}/entry_points.txt +0 -0
- {commit_check-2.20.0.dist-info → commit_check-2.20.2.dist-info}/licenses/LICENSE +0 -0
- {commit_check-2.20.0.dist-info → commit_check-2.20.2.dist-info}/top_level.txt +0 -0
|
@@ -83,6 +83,19 @@ class KnownAiTool:
|
|
|
83
83
|
#: Trailers whose value credits a person who wrote part of the change.
|
|
84
84
|
PERSON_TRAILERS = ("Co-authored-by", "Co-developed-by")
|
|
85
85
|
|
|
86
|
+
#: Trailers that credit a person with some other part in the change: a
|
|
87
|
+
#: review, a test, the idea for it. A tool named in one is a mark of its
|
|
88
|
+
#: use, not a claim of authorship, so it is a stamp: ``forbid`` rejects it,
|
|
89
|
+
#: and ``disclose`` asks for a disclosure beside it. The Linux kernel's
|
|
90
|
+
#: submitting-patches guide lists these keys.
|
|
91
|
+
CREDIT_TRAILERS = (
|
|
92
|
+
"Reviewed-by",
|
|
93
|
+
"Suggested-by",
|
|
94
|
+
"Helped-by",
|
|
95
|
+
"Tested-by",
|
|
96
|
+
"Reported-by",
|
|
97
|
+
)
|
|
98
|
+
|
|
86
99
|
|
|
87
100
|
def _trailer(
|
|
88
101
|
keys: tuple[str, ...], value_pattern: str, role: str, description: str
|
|
@@ -110,9 +123,9 @@ def _trailer(
|
|
|
110
123
|
|
|
111
124
|
|
|
112
125
|
def _identity(value_pattern: str, label: str) -> list[AiSignaturePattern]:
|
|
113
|
-
"""The co-author
|
|
126
|
+
"""The co-author, sign-off and credit patterns for one way a tool names itself.
|
|
114
127
|
|
|
115
|
-
One identity serves
|
|
128
|
+
One identity serves every trailer, so they cannot drift apart.
|
|
116
129
|
"""
|
|
117
130
|
return [
|
|
118
131
|
_trailer(
|
|
@@ -127,6 +140,12 @@ def _identity(value_pattern: str, label: str) -> list[AiSignaturePattern]:
|
|
|
127
140
|
ROLE_SIGNOFF,
|
|
128
141
|
f"``Signed-off-by: {label}`` trailer",
|
|
129
142
|
),
|
|
143
|
+
_trailer(
|
|
144
|
+
CREDIT_TRAILERS,
|
|
145
|
+
value_pattern,
|
|
146
|
+
ROLE_STAMP,
|
|
147
|
+
f"``Reviewed-by: {label}`` (or another credit) trailer",
|
|
148
|
+
),
|
|
130
149
|
]
|
|
131
150
|
|
|
132
151
|
|
|
@@ -196,6 +215,24 @@ CLAUDE_CODE = KnownAiTool(
|
|
|
196
215
|
r"🤖\s*Generated\s+(?:with|by)\s+\[?Claude",
|
|
197
216
|
"``🤖 Generated with Claude`` body marker",
|
|
198
217
|
),
|
|
218
|
+
# The same notice with the emoji taken out, as copied into a pull
|
|
219
|
+
# request description or left by a tool that strips emoji, and the
|
|
220
|
+
# italic ``_Generated by [Claude Code](...)_`` footer of Claude Code
|
|
221
|
+
# on the web. Without the emoji only the product's own name counts,
|
|
222
|
+
# at a line start, so a sentence about Claude is never read as the
|
|
223
|
+
# mark.
|
|
224
|
+
_body_marker(
|
|
225
|
+
r"^[ \t]*[_*]{0,2}Generated[ \t]+(?:with|by)[ \t]+"
|
|
226
|
+
r"(?:\[Claude Code\]\(|Claude Code\b)",
|
|
227
|
+
"``Generated with [Claude Code]`` body marker",
|
|
228
|
+
),
|
|
229
|
+
# Claude Code on the web links the session on a line of its own.
|
|
230
|
+
# Only a line that is nothing but the link counts: a sentence that
|
|
231
|
+
# cites a session is discussing one.
|
|
232
|
+
_body_marker(
|
|
233
|
+
r"^[ \t]*https://claude\.ai/code/session_[A-Za-z0-9]+[ \t]*$",
|
|
234
|
+
"Claude Code session link",
|
|
235
|
+
),
|
|
199
236
|
# Session ID trailer (Claude Code sometimes adds this)
|
|
200
237
|
_stamp_trailer("Claude-Session", "``Claude-Session:`` trailer"),
|
|
201
238
|
# Workflow ID trailer
|
|
@@ -234,6 +271,9 @@ CODEX = KnownAiTool(
|
|
|
234
271
|
*_identity(r"Codex[ \t]*(?:<[^>\n]*>)?", "Codex"),
|
|
235
272
|
# Codex in the cloud commits through its GitHub App.
|
|
236
273
|
*_app_bot("chatgpt-codex-connector"),
|
|
274
|
+
# A Codex cloud pull request links its task in the description:
|
|
275
|
+
# ``Codex Cloud task: https://chatgpt.com/codex/tasks/task_e_...``.
|
|
276
|
+
_body_marker(r"https://chatgpt\.com/codex/tasks/task_\w+", "Codex task link"),
|
|
237
277
|
],
|
|
238
278
|
)
|
|
239
279
|
|
|
@@ -257,6 +297,12 @@ CURSOR = KnownAiTool(
|
|
|
257
297
|
*_identity(r"[^<\n]*<cursoragent@cursor\.com>", "... <cursoragent@cursor.com>"),
|
|
258
298
|
# Cursor's background agent commits through its GitHub App.
|
|
259
299
|
*_app_bot("cursor"),
|
|
300
|
+
# The "Open in Web" / "Open in Cursor" footer of a background agent's
|
|
301
|
+
# pull request links the agent run.
|
|
302
|
+
_body_marker(
|
|
303
|
+
r"https://cursor\.com/(?:agents/|background-agent\?bcId=)bc-[0-9a-f-]+",
|
|
304
|
+
"Cursor agent link",
|
|
305
|
+
),
|
|
260
306
|
# Cursor's own mark on commits it writes:
|
|
261
307
|
# https://forum.cursor.com/t/allow-disabling-made-with-cursor-commit-trailer/154494
|
|
262
308
|
_trailer(
|
|
@@ -286,6 +332,10 @@ DEVIN = KnownAiTool(
|
|
|
286
332
|
r"@users\.noreply\.github\.com>",
|
|
287
333
|
"... <N+devin-ai-integration[bot]@users.noreply.github.com>",
|
|
288
334
|
),
|
|
335
|
+
# Devin's pull requests link the run: ``Link to Devin run: https://...``.
|
|
336
|
+
_body_marker(
|
|
337
|
+
r"https://app\.devin\.ai/sessions/[0-9a-f]{32}", "Devin session link"
|
|
338
|
+
),
|
|
289
339
|
],
|
|
290
340
|
)
|
|
291
341
|
|
|
@@ -372,6 +422,8 @@ JULES = KnownAiTool(
|
|
|
372
422
|
*_identity(
|
|
373
423
|
r"google-labs-jules\[bot\][ \t]*(?:<[^>\n]*>)?", "google-labs-jules[bot]"
|
|
374
424
|
),
|
|
425
|
+
# ``PR created automatically by Jules for task [N](https://jules.google.com/task/N)``.
|
|
426
|
+
_body_marker(r"https://jules\.google\.com/task/\d+", "Jules task link"),
|
|
375
427
|
],
|
|
376
428
|
)
|
|
377
429
|
|
|
@@ -441,6 +493,39 @@ AMAZON_Q = KnownAiTool(
|
|
|
441
493
|
patterns=[*_app_bot("amazon-q-developer")],
|
|
442
494
|
)
|
|
443
495
|
|
|
496
|
+
# --- Warp ---
|
|
497
|
+
# Warp's cloud agents commit as ``Warp <agent@warp.dev>`` when no git
|
|
498
|
+
# identity is configured, see DEFAULT_GIT_NAME / DEFAULT_GIT_EMAIL in
|
|
499
|
+
# https://github.com/warpdotdev/warp/blob/master/app/src/ai/agent_sdk/driver/git_credentials.rs
|
|
500
|
+
# and projects that ask for a co-author line give Warp the same address.
|
|
501
|
+
# "Warp" alone is a word, so only the address names the tool.
|
|
502
|
+
WARP = KnownAiTool(
|
|
503
|
+
name="Warp",
|
|
504
|
+
patterns=[
|
|
505
|
+
*_identity(r"[^<\n]*<agent@warp\.dev>", "... <agent@warp.dev>"),
|
|
506
|
+
],
|
|
507
|
+
)
|
|
508
|
+
|
|
509
|
+
# --- Crush (Charm) ---
|
|
510
|
+
# Crush's commit instructions add "💘 Generated with Crush" (generated_with,
|
|
511
|
+
# on by default) and a trailer: "Assisted-by: Crush:<model>" by default, or
|
|
512
|
+
# "Co-Authored-By: Crush <crush@charm.land>" with trailer_style =
|
|
513
|
+
# "co-authored-by".
|
|
514
|
+
# https://github.com/charmbracelet/crush/blob/main/internal/agent/tools/bash.md.tpl
|
|
515
|
+
# "Crush" alone is a word and a name, so the co-author line is anchored to
|
|
516
|
+
# the charm.land address and the notice to its own wording.
|
|
517
|
+
CRUSH = KnownAiTool(
|
|
518
|
+
name="Crush",
|
|
519
|
+
name_pattern=_names(r"crush"),
|
|
520
|
+
patterns=[
|
|
521
|
+
*_identity(r"[^<\n]*<crush@charm\.land>", "... <crush@charm.land>"),
|
|
522
|
+
_body_marker(
|
|
523
|
+
r"^[ \t]*(?:💘[ \t]*)?Generated[ \t]+with[ \t]+Crush\b",
|
|
524
|
+
"``💘 Generated with Crush`` body marker",
|
|
525
|
+
),
|
|
526
|
+
],
|
|
527
|
+
)
|
|
528
|
+
|
|
444
529
|
# --- Generic / catch-all AI patterns ---
|
|
445
530
|
GENERIC_AI = KnownAiTool(
|
|
446
531
|
name="Generic AI",
|
|
@@ -505,5 +590,7 @@ ALL_KNOWN_TOOLS: list[KnownAiTool] = [
|
|
|
505
590
|
MISTRAL_VIBE,
|
|
506
591
|
QWEN_CODE,
|
|
507
592
|
AMAZON_Q,
|
|
593
|
+
WARP,
|
|
594
|
+
CRUSH,
|
|
508
595
|
GENERIC_AI,
|
|
509
596
|
]
|
commit_check/engine.py
CHANGED
|
@@ -131,6 +131,9 @@ class ValidationContext:
|
|
|
131
131
|
# commits the remote lacks, so a ref pushed alongside it -- a tag that
|
|
132
132
|
# ``git push --follow-tags`` sends after a branch -- is not in the line.
|
|
133
133
|
push_from_pre_commit: bool = False
|
|
134
|
+
# Set by --ai-attribution-only: the text is not a commit message (a pull request
|
|
135
|
+
# description, say), so advice must not tell the reader to re-commit.
|
|
136
|
+
not_a_commit: bool = False
|
|
134
137
|
|
|
135
138
|
@property
|
|
136
139
|
def piped_value(self) -> str | None:
|
|
@@ -1522,25 +1525,32 @@ class AiAttributionValidator(BaseValidator):
|
|
|
1522
1525
|
# No-op policy: nothing is checked, so no value is recorded.
|
|
1523
1526
|
return ValidationResult.PASS
|
|
1524
1527
|
self._checked_value = message
|
|
1525
|
-
return self._judge_under_forbid(message)
|
|
1528
|
+
return self._judge_under_forbid(message, context.not_a_commit)
|
|
1526
1529
|
|
|
1527
|
-
def _judge_under_forbid(self, message: str) -> ValidationResult:
|
|
1530
|
+
def _judge_under_forbid(self, message: str, not_a_commit: bool) -> ValidationResult:
|
|
1528
1531
|
signatures = detect_ai_signatures(message)
|
|
1529
1532
|
if not signatures:
|
|
1530
1533
|
return ValidationResult.PASS
|
|
1531
1534
|
|
|
1532
1535
|
fix = strip_lines_containing(message, [s["matched_text"] for s in signatures])
|
|
1536
|
+
if not_a_commit:
|
|
1537
|
+
suggest = (
|
|
1538
|
+
"This project does not accept AI attribution. Remove the AI lines."
|
|
1539
|
+
)
|
|
1540
|
+
else:
|
|
1541
|
+
action = (
|
|
1542
|
+
"Remove the AI trailer lines and re-commit."
|
|
1543
|
+
if fix
|
|
1544
|
+
else "Remove AI trailers and re-commit."
|
|
1545
|
+
)
|
|
1546
|
+
suggest = (
|
|
1547
|
+
"This project does not accept AI attribution in commit messages. "
|
|
1548
|
+
+ action
|
|
1549
|
+
)
|
|
1533
1550
|
self._print_failure(
|
|
1534
1551
|
_tools(signatures),
|
|
1535
1552
|
error=f"AI attribution is forbidden in this project — detected: {_tools(signatures)}",
|
|
1536
|
-
suggest=
|
|
1537
|
-
"This project does not accept AI attribution in commit messages. "
|
|
1538
|
-
+ (
|
|
1539
|
-
"Remove the AI trailer lines and re-commit."
|
|
1540
|
-
if fix
|
|
1541
|
-
else "Remove AI trailers and re-commit."
|
|
1542
|
-
)
|
|
1543
|
-
),
|
|
1553
|
+
suggest=suggest,
|
|
1544
1554
|
fix=fix,
|
|
1545
1555
|
)
|
|
1546
1556
|
return ValidationResult.FAIL
|
|
@@ -1626,6 +1636,35 @@ class AiAttributionValidator(BaseValidator):
|
|
|
1626
1636
|
return ValidationResult.FAIL
|
|
1627
1637
|
|
|
1628
1638
|
|
|
1639
|
+
def _author_identity(context: ValidationContext) -> tuple[str, str]:
|
|
1640
|
+
"""The author of the commit under test, as ``(name, email)``.
|
|
1641
|
+
|
|
1642
|
+
An existing commit (``--rev``, or HEAD) by its recorded author; a message
|
|
1643
|
+
not yet committed by the author git would record for it.
|
|
1644
|
+
"""
|
|
1645
|
+
if context.rev is None and (
|
|
1646
|
+
context.stdin_text is not None or context.commit_file is not None
|
|
1647
|
+
):
|
|
1648
|
+
return get_pending_author_identity()
|
|
1649
|
+
return get_commit_author_identity(context.rev or "HEAD")
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
def ai_tools_in(context: ValidationContext, *, author: bool) -> list[str]:
|
|
1653
|
+
"""The AI tools the message under test names, sorted, whatever the policy.
|
|
1654
|
+
|
|
1655
|
+
With *author*, a tool in the commit author's place counts too. This is
|
|
1656
|
+
a finding, not a verdict: it is what a pull request is labelled on, so
|
|
1657
|
+
it is reported under ``ai_attribution = "ignore"`` as well.
|
|
1658
|
+
"""
|
|
1659
|
+
message = BaseValidator._get_commit_message(context)
|
|
1660
|
+
tools = {s["tool"] for s in detect_ai_signatures(message)}
|
|
1661
|
+
if author:
|
|
1662
|
+
tool = detect_ai_author(*_author_identity(context))
|
|
1663
|
+
if tool is not None:
|
|
1664
|
+
tools.add(tool)
|
|
1665
|
+
return sorted(tools)
|
|
1666
|
+
|
|
1667
|
+
|
|
1629
1668
|
class AiAuthorValidator(BaseValidator):
|
|
1630
1669
|
"""Rejects a commit whose author is an AI tool (CC017).
|
|
1631
1670
|
|
|
@@ -1641,12 +1680,7 @@ class AiAuthorValidator(BaseValidator):
|
|
|
1641
1680
|
if self._should_skip_commit_validation(context):
|
|
1642
1681
|
return ValidationResult.SKIP
|
|
1643
1682
|
|
|
1644
|
-
|
|
1645
|
-
context.stdin_text is not None or context.commit_file is not None
|
|
1646
|
-
):
|
|
1647
|
-
name, email = get_pending_author_identity()
|
|
1648
|
-
else:
|
|
1649
|
-
name, email = get_commit_author_identity(context.rev or "HEAD")
|
|
1683
|
+
name, email = _author_identity(context)
|
|
1650
1684
|
identity = f"{name} <{email}>" if email else name
|
|
1651
1685
|
self._checked_value = identity
|
|
1652
1686
|
tool = detect_ai_author(name, email)
|
commit_check/main.py
CHANGED
|
@@ -15,11 +15,17 @@ from commit_check.engine import (
|
|
|
15
15
|
ValidationContext,
|
|
16
16
|
ValidationEngine,
|
|
17
17
|
ValidationResult,
|
|
18
|
+
ai_tools_in,
|
|
18
19
|
count_warnings,
|
|
19
20
|
overall_status,
|
|
20
21
|
)
|
|
21
22
|
from commit_check.rule_builder import RuleBuilder
|
|
22
|
-
from commit_check.rules_catalog import
|
|
23
|
+
from commit_check.rules_catalog import (
|
|
24
|
+
AI_TEXT_CHECKS,
|
|
25
|
+
BRANCH_CHECKS,
|
|
26
|
+
FILES_CHECKS,
|
|
27
|
+
MESSAGE_CHECKS,
|
|
28
|
+
)
|
|
23
29
|
from commit_check.util import (
|
|
24
30
|
get_remote_branch_sha,
|
|
25
31
|
git_repository_error,
|
|
@@ -184,6 +190,21 @@ def _get_parser() -> argparse.ArgumentParser:
|
|
|
184
190
|
help="validate commit message (file path can be provided as positional argument for pre-commit compatibility)",
|
|
185
191
|
)
|
|
186
192
|
|
|
193
|
+
check_group.add_argument(
|
|
194
|
+
"--ai-attribution-only",
|
|
195
|
+
action="store_true",
|
|
196
|
+
help="check only the AI attribution of the message (CC013 to CC016), "
|
|
197
|
+
"for text that is not a commit message, such as a pull request "
|
|
198
|
+
"description; implies --message",
|
|
199
|
+
)
|
|
200
|
+
# The name it shipped with in 2.20.1, kept so existing scripts still work.
|
|
201
|
+
check_group.add_argument(
|
|
202
|
+
"--ai-only",
|
|
203
|
+
dest="ai_attribution_only",
|
|
204
|
+
action="store_true",
|
|
205
|
+
help=argparse.SUPPRESS,
|
|
206
|
+
)
|
|
207
|
+
|
|
187
208
|
check_group.add_argument(
|
|
188
209
|
"-b",
|
|
189
210
|
"--branch",
|
|
@@ -674,7 +695,9 @@ def _get_requested_checks(args: argparse.Namespace) -> set[str]:
|
|
|
674
695
|
requested_checks: set[str] = set()
|
|
675
696
|
|
|
676
697
|
if args.message:
|
|
677
|
-
requested_checks |=
|
|
698
|
+
requested_checks |= (
|
|
699
|
+
AI_TEXT_CHECKS if args.ai_attribution_only else MESSAGE_CHECKS
|
|
700
|
+
)
|
|
678
701
|
if args.branch:
|
|
679
702
|
requested_checks |= BRANCH_CHECKS
|
|
680
703
|
if args.tag:
|
|
@@ -709,20 +732,27 @@ _UNCONFIGURED_HINTS = (
|
|
|
709
732
|
)
|
|
710
733
|
|
|
711
734
|
|
|
712
|
-
def _run_json_output(
|
|
713
|
-
|
|
735
|
+
def _run_json_output(
|
|
736
|
+
engine: ValidationEngine,
|
|
737
|
+
context: ValidationContext,
|
|
738
|
+
args: argparse.Namespace,
|
|
739
|
+
) -> int:
|
|
740
|
+
"""Run validation and print JSON output.
|
|
741
|
+
|
|
742
|
+
When a message is checked, ``ai_tools`` lists the AI tools it names (and,
|
|
743
|
+
for a commit, its author), whatever the policy: what a pull request
|
|
744
|
+
is labelled on.
|
|
745
|
+
"""
|
|
714
746
|
outcomes: list[CheckOutcome] = engine.validate_all_detailed(context)
|
|
715
747
|
overall = overall_status(o.status for o in outcomes)
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
)
|
|
725
|
-
)
|
|
748
|
+
report: dict[str, object] = {
|
|
749
|
+
"status": overall,
|
|
750
|
+
"warnings": count_warnings(o.status for o in outcomes),
|
|
751
|
+
"checks": [o.to_dict() for o in outcomes],
|
|
752
|
+
}
|
|
753
|
+
if args.message:
|
|
754
|
+
report["ai_tools"] = ai_tools_in(context, author=not args.ai_attribution_only)
|
|
755
|
+
print(json.dumps(report, indent=2))
|
|
726
756
|
# Only a failure is an error. A skipped run validated nothing, but that
|
|
727
757
|
# is not a policy violation, so it must not turn into a non-zero exit.
|
|
728
758
|
return 1 if overall == "fail" else 0
|
|
@@ -738,7 +768,7 @@ def main() -> int:
|
|
|
738
768
|
|
|
739
769
|
try:
|
|
740
770
|
# Handle positional commit_msg_file argument for pre-commit compatibility
|
|
741
|
-
if args.commit_msg_file:
|
|
771
|
+
if args.commit_msg_file or args.ai_attribution_only:
|
|
742
772
|
args.message = True
|
|
743
773
|
|
|
744
774
|
if args.rev is not None:
|
|
@@ -849,12 +879,13 @@ def main() -> int:
|
|
|
849
879
|
and (stdin_content is None or stdin_is_message),
|
|
850
880
|
stdin_is_message=stdin_is_message,
|
|
851
881
|
push_from_pre_commit=push_from_pre_commit,
|
|
882
|
+
not_a_commit=args.ai_attribution_only,
|
|
852
883
|
)
|
|
853
884
|
|
|
854
885
|
# Run validation – choose output mode based on --format
|
|
855
886
|
output_format: str = getattr(args, "output_format", "text")
|
|
856
887
|
if output_format == "json":
|
|
857
|
-
exit_code = _run_json_output(engine, context)
|
|
888
|
+
exit_code = _run_json_output(engine, context, args)
|
|
858
889
|
else:
|
|
859
890
|
result = engine.validate_all(context)
|
|
860
891
|
exit_code = EXIT_PASS if result == ValidationResult.PASS else EXIT_FAIL
|
commit_check/rules_catalog.py
CHANGED
|
@@ -326,5 +326,11 @@ MESSAGE_CHECKS: frozenset[str] = frozenset(
|
|
|
326
326
|
for entry in COMMIT_RULES
|
|
327
327
|
if entry.check not in {"author_name", "author_email", "ignore_authors"}
|
|
328
328
|
)
|
|
329
|
+
#: What ``--ai-attribution-only`` runs: the AI attribution a text makes (CC013 to CC016),
|
|
330
|
+
#: for text that is not a commit, such as a pull request description. CC017
|
|
331
|
+
#: is left out: it judges a commit's author, which such text does not have.
|
|
332
|
+
AI_TEXT_CHECKS: frozenset[str] = frozenset(
|
|
333
|
+
{"ai_attribution", "ai_disclosure", "ai_co_author", "ai_signoff"}
|
|
334
|
+
)
|
|
329
335
|
BRANCH_CHECKS: frozenset[str] = frozenset({"branch", "merge_base"})
|
|
330
336
|
FILES_CHECKS: frozenset[str] = frozenset(entry.check for entry in FILES_RULES)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: commit-check
|
|
3
|
-
Version: 2.20.
|
|
3
|
+
Version: 2.20.2
|
|
4
4
|
Summary: Commit policy as code for teams and AI agents: check commit messages, branch names, authors, tags, files and AI attribution.
|
|
5
5
|
Author-email: Xianpeng Shen <xianpeng.shen@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -30,6 +30,7 @@ Requires-Dist: coverage; extra == "test"
|
|
|
30
30
|
Requires-Dist: pytest; extra == "test"
|
|
31
31
|
Requires-Dist: pytest-mock; extra == "test"
|
|
32
32
|
Requires-Dist: pytest-codspeed; extra == "test"
|
|
33
|
+
Requires-Dist: pytest-split; extra == "test"
|
|
33
34
|
Provides-Extra: ci
|
|
34
35
|
Requires-Dist: twine==7.0.0; extra == "ci"
|
|
35
36
|
Dynamic: license-file
|
|
@@ -86,7 +87,7 @@ Stop bad commits before they exist. In `.pre-commit-config.yaml`:
|
|
|
86
87
|
```yaml
|
|
87
88
|
repos:
|
|
88
89
|
- repo: https://github.com/commit-check/commit-check
|
|
89
|
-
rev: v2.
|
|
90
|
+
rev: v2.20.2
|
|
90
91
|
hooks:
|
|
91
92
|
- id: check-message
|
|
92
93
|
- id: check-branch
|
|
@@ -218,7 +219,19 @@ The failing entry of its `checks` array:
|
|
|
218
219
|
A check that did not run has status `skip`, and `reason` says why when the
|
|
219
220
|
author is on an `ignore_authors` list: `"author dependabot[bot] is in [commit].ignore_authors"`.
|
|
220
221
|
|
|
221
|
-
|
|
222
|
+
With a message checked, the output also has `ai_tools`: the AI tools found by
|
|
223
|
+
their known signatures in the message (and by a commit's author), under any
|
|
224
|
+
`ai_attribution` policy. `--ai-attribution-only` runs only the AI rules (CC013 to CC016),
|
|
225
|
+
for text that is not a commit message, such as a pull request description.
|
|
226
|
+
Under the default `ai_attribution = "ignore"` no AI rule runs, so the result
|
|
227
|
+
passes and only `ai_tools` reports what was found; set `forbid` or `disclose`
|
|
228
|
+
to enforce a policy:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
commit-check --ai-attribution-only --format json < pr-description.md
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Validate a commit message with the Python API, without a subprocess:
|
|
222
235
|
|
|
223
236
|
```python
|
|
224
237
|
from commit_check.api import validate_message
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
commit_check/__init__.py,sha256=UAg0cSgL4QKAOc9GEbqFdoQ94JejOupRGoGgaDwIcF0,5456
|
|
2
2
|
commit_check/ai_policy.py,sha256=gYC3ROLgGL1TDyhPkFXkV-NiYbvMt80Qt0MFrJcbJY4,8131
|
|
3
3
|
commit_check/ai_signatures.py,sha256=qPbyVndU5egHRtDtu3S2vEO5_lKyDsz1PLUWqKPMMvU,11054
|
|
4
|
-
commit_check/ai_signatures_data.py,sha256=
|
|
4
|
+
commit_check/ai_signatures_data.py,sha256=lvJDZ_-eH2RYqVn8MMry9oNXVv27u9okLawPZx_y4XA,22851
|
|
5
5
|
commit_check/api.py,sha256=07bvBtV8PrhZIOwCDHiHfu_7CXsX_4U2_K2xMAucd6c,12905
|
|
6
6
|
commit_check/config.py,sha256=I7yMZBJynjVUuY-GWAkuu9a59aT9fDTJsGh4znu2hDU,13941
|
|
7
7
|
commit_check/config_merger.py,sha256=52m45cPOVzQnjvxgjf8pHPbK3BKVHPrvBMmtocztU-0,13707
|
|
8
|
-
commit_check/engine.py,sha256=
|
|
8
|
+
commit_check/engine.py,sha256=x4vOON6I7IEid3M7YWhgrE9spvGwfK902myKlRc0J-0,77528
|
|
9
9
|
commit_check/fixes.py,sha256=BpbdoHsKDyw2WfsqymwYpnrW73aHdCDGr8tMF6Ho2RU,7305
|
|
10
10
|
commit_check/imperatives.py,sha256=dEd_ssu4G0j6Cann6jqPdB97lw5Adua43K0_Odg_FyA,9518
|
|
11
|
-
commit_check/main.py,sha256=
|
|
11
|
+
commit_check/main.py,sha256=Bq1ThH0KVdS1MAeNcvvBLASPEkIVD3dbyKnYF_BkTh0,30859
|
|
12
12
|
commit_check/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
commit_check/rule_builder.py,sha256=kujszrki8VKXAarrmUwOCu0Yv7QzIiu5lm5mRBAQVns,34950
|
|
14
|
-
commit_check/rules_catalog.py,sha256=
|
|
14
|
+
commit_check/rules_catalog.py,sha256=KtP64QRFSI_p3fRtaF1XDx3MUikIU__p1o-XmQBpSMY,12736
|
|
15
15
|
commit_check/util.py,sha256=dCMbRKMPiysjxcOQWOIM-vJT2DdE2BsnGDgvTJsgnFs,34486
|
|
16
|
-
commit_check-2.20.
|
|
17
|
-
commit_check-2.20.
|
|
18
|
-
commit_check-2.20.
|
|
19
|
-
commit_check-2.20.
|
|
20
|
-
commit_check-2.20.
|
|
21
|
-
commit_check-2.20.
|
|
16
|
+
commit_check-2.20.2.dist-info/licenses/LICENSE,sha256=9mdTva71kQhrpWh_nZulxrdCnUrl5c6xJYh5hdo4p_s,1070
|
|
17
|
+
commit_check-2.20.2.dist-info/METADATA,sha256=7OVmIeAbGVUFIy9IEo3H3CPjSx-A7jXP_Rw7eec1zSM,17135
|
|
18
|
+
commit_check-2.20.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
19
|
+
commit_check-2.20.2.dist-info/entry_points.txt,sha256=YMrkFGeub-3-IanV1d9qnopXVaRQM7MA9foXKW9iZ88,86
|
|
20
|
+
commit_check-2.20.2.dist-info/top_level.txt,sha256=Wf46u-ooHBMJNHbhfrBNQw3wC5_m8wt-o_Lfbc4QpRg,13
|
|
21
|
+
commit_check-2.20.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|