git-commit-guard 0.22.0__py3-none-any.whl → 0.22.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.
@@ -34,6 +34,15 @@ TYPES = frozenset(
34
34
  )
35
35
 
36
36
  _NON_IMPERATIVE_SUFFIX_RE = re.compile(r"(?:ing|ed)$")
37
+ _VERB_FORMING_PREFIXES = frozenset(
38
+ {
39
+ "re",
40
+ "pre",
41
+ "auto",
42
+ "co",
43
+ "under",
44
+ }
45
+ )
37
46
  _TRAILER_RE = re.compile(r"^[\w-]+:\s+\S")
38
47
  _GITHUB_REMOTE_RE = re.compile(
39
48
  r"github\.com[:/](?P<owner>[^/]+)/(?P<repo>[^/\s]+?)(?:\.git)?$"
@@ -235,6 +244,13 @@ def check_imperative(desc, result):
235
244
  if tagged[1][1] != "VB":
236
245
  if wordnet.morphy(first, wordnet.VERB) == first:
237
246
  return
247
+ if "-" in first:
248
+ hyphen_prefix, hyphen_base = first.split("-", 1)
249
+ if (
250
+ hyphen_prefix in _VERB_FORMING_PREFIXES
251
+ and wordnet.morphy(hyphen_base, wordnet.VERB) == hyphen_base
252
+ ):
253
+ return
238
254
  result.error(
239
255
  f"expected imperative verb, got '{tagged[1][0]}' (POS={tagged[1][1]})",
240
256
  check=Check.IMPERATIVE,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-commit-guard
3
- Version: 0.22.0
3
+ Version: 0.22.2
4
4
  Summary: Opinionated conventional commit message linter with imperative mood detection
5
5
  Project-URL: Homepage, https://github.com/benner/commit-guard
6
6
  Project-URL: Repository, https://github.com/benner/commit-guard
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Software Development :: Quality Assurance
17
17
  Classifier: Topic :: Software Development :: Version Control :: Git
18
18
  Requires-Python: >=3.12
19
- Requires-Dist: nltk>=3.9.3
19
+ Requires-Dist: nltk>=3.9.4
20
20
  Description-Content-Type: text/markdown
21
21
 
22
22
  # commit-guard
@@ -316,7 +316,7 @@ COMMIT_GUARD_GIT_TIMEOUT=30 commit-guard --range origin/main..HEAD
316
316
  In GitHub Actions, set it at the step or job level:
317
317
 
318
318
  ```yaml
319
- - uses: benner/commit-guard@v0.22.0
319
+ - uses: benner/commit-guard@v0.22.2
320
320
  env:
321
321
  COMMIT_GUARD_GIT_TIMEOUT: 30
322
322
  with:
@@ -400,7 +400,7 @@ steps:
400
400
  - uses: actions/checkout@v4
401
401
  with:
402
402
  fetch-depth: 0
403
- - uses: benner/commit-guard@v0.22.0
403
+ - uses: benner/commit-guard@v0.22.2
404
404
  ```
405
405
 
406
406
  Check all commits in a pull request:
@@ -416,7 +416,7 @@ jobs:
416
416
  - uses: actions/checkout@v4
417
417
  with:
418
418
  fetch-depth: 0
419
- - uses: benner/commit-guard@v0.22.0
419
+ - uses: benner/commit-guard@v0.22.2
420
420
  with:
421
421
  range: ${{ env.PR_BASE }}..${{ env.PR_HEAD }}
422
422
  ```
@@ -424,7 +424,7 @@ jobs:
424
424
  Check a specific commit SHA (mirrors the positional CLI argument):
425
425
 
426
426
  ```yaml
427
- - uses: benner/commit-guard@v0.22.0
427
+ - uses: benner/commit-guard@v0.22.2
428
428
  with:
429
429
  rev: ${{ github.sha }}
430
430
  ```
@@ -442,7 +442,7 @@ jobs:
442
442
  - uses: actions/checkout@v4
443
443
  with:
444
444
  fetch-depth: 0
445
- - uses: benner/commit-guard@v0.22.0
445
+ - uses: benner/commit-guard@v0.22.2
446
446
  with:
447
447
  range: ${{ env.PR_BASE }}..${{ env.PR_HEAD }}
448
448
  disable: signed-off,signature
@@ -462,7 +462,7 @@ jobs:
462
462
  When `output-file` is set the action exposes the path as an output:
463
463
 
464
464
  ```yaml
465
- - uses: benner/commit-guard@v0.22.0
465
+ - uses: benner/commit-guard@v0.22.2
466
466
  id: cg
467
467
  with:
468
468
  range: ${{ env.PR_BASE }}..${{ env.PR_HEAD }}
@@ -478,7 +478,7 @@ Add to your `.pre-commit-config.yaml`:
478
478
  ---
479
479
  repos:
480
480
  - repo: https://github.com/benner/commit-guard
481
- rev: v0.22.0
481
+ rev: v0.22.2
482
482
  hooks:
483
483
  - id: commit-guard
484
484
  - id: commit-guard-signature
@@ -503,11 +503,14 @@ To selectively enable or disable checks, pass `args`:
503
503
 
504
504
  ## Imperative mood detection
505
505
 
506
- commit-guard combines two strategies to detect non-imperative descriptions:
506
+ commit-guard combines three strategies to detect non-imperative descriptions:
507
507
 
508
508
  1. nltk POS tagging — flags words tagged as past tense (`VBD`),
509
509
  gerund (`VBG`), third person (`VBZ`), etc.
510
510
  2. WordNet morphology as a fallback for words the tagger misclassifies.
511
+ 3. Hyphenated verb prefixes — accepts `re-enable`, `auto-detect`,
512
+ `pre-process`, `co-locate`, `under-mine` and similar
513
+ `<prefix>-<verb>` compounds the POS tagger misclassifies.
511
514
 
512
515
  This catches common mistakes like `added logging` or `fixes bug` while
513
516
  keeping false positives low.
@@ -0,0 +1,6 @@
1
+ git_commit_guard/__init__.py,sha256=FrKpmqyW_YO2RgMj8Ff2m1TVEqQqBDhvm1pFtfem8rQ,29599
2
+ git_commit_guard-0.22.2.dist-info/METADATA,sha256=4pWaUYZ4ta6OwftzPFenE_KtBxzrFlmKcl1tKVi9qdE,15450
3
+ git_commit_guard-0.22.2.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
4
+ git_commit_guard-0.22.2.dist-info/entry_points.txt,sha256=24HK4TwCgn3tSQHOWnGE6zJK6nvg7EMAut7VHe9nuH4,55
5
+ git_commit_guard-0.22.2.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
6
+ git_commit_guard-0.22.2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.29.0
2
+ Generator: hatchling 1.30.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,6 +0,0 @@
1
- git_commit_guard/__init__.py,sha256=-R3zSgRTczLuAoQChHEeYdpV7-epvaGpVoHum4cfYNM,29199
2
- git_commit_guard-0.22.0.dist-info/METADATA,sha256=8aUUVeflctsapMdO2WPs3wo62ioHYvUIQzzv3PpJDCg,15263
3
- git_commit_guard-0.22.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
4
- git_commit_guard-0.22.0.dist-info/entry_points.txt,sha256=24HK4TwCgn3tSQHOWnGE6zJK6nvg7EMAut7VHe9nuH4,55
5
- git_commit_guard-0.22.0.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
6
- git_commit_guard-0.22.0.dist-info/RECORD,,