@nomad-e/bluma-cli 0.1.81 → 0.1.83

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.
@@ -285,7 +285,7 @@ in every commit and PR generated by BluMa, with no exceptions.
285
285
 
286
286
  ## Available Scripts
287
287
 
288
- - validate_commits.py: Validates that all commits in a range follow Conventional Commits format
288
+ - validate_commits.py: Validates that all commits in a range follow Conventional Commits format. Accepts a branch name (`main`) or a full range (`main..HEAD`).
289
289
 
290
290
  ## Next Steps
291
291
 
@@ -4,10 +4,11 @@ Validate that commits in a given range follow Conventional Commits format
4
4
  and include the BluMa watermark trailer.
5
5
 
6
6
  Usage:
7
- python validate_commits.py [base_branch]
7
+ python validate_commits.py [base_branch_or_range]
8
8
 
9
9
  Arguments:
10
- base_branch Target branch to compare against (default: main)
10
+ base_branch_or_range Target branch (e.g. "main") or full range
11
+ (e.g. "main..HEAD"). Default: main
11
12
 
12
13
  Exit codes:
13
14
  0 All commits are valid
@@ -28,8 +29,15 @@ WATERMARK = "Generated-by: BluMa"
28
29
 
29
30
 
30
31
  def get_commits(base: str) -> list[dict]:
32
+ # Accept either a bare branch name ("main") or a full range ("main..HEAD").
33
+ # If the argument already contains "..", use it as-is to avoid duplication.
34
+ if ".." not in base:
35
+ range_arg = f"{base}..HEAD"
36
+ else:
37
+ range_arg = base
38
+
31
39
  result = subprocess.run(
32
- ["git", "log", f"{base}..HEAD", "--format=%H|||%s|||%b%n---END---"],
40
+ ["git", "log", range_arg, "--format=%H|||%s|||%b%n---END---"],
33
41
  capture_output=True, text=True
34
42
  )
35
43
  if result.returncode != 0: