GRM-41: feat: enforce commit naming conventions and workflow discipline
This commit is contained in:
@@ -78,8 +78,19 @@ def main(commit_msg: str, commit_sha: str) -> None:
|
||||
|
||||
task_id = extract_task_id(commit_msg)
|
||||
if not task_id:
|
||||
click.echo(_("No task ID in commit message, skipping Vikunja update. All good — nothing to do here!"))
|
||||
return
|
||||
# Allow release commits without GRM-N prefix
|
||||
first_line = commit_msg.split("\n")[0]
|
||||
if re.match(r"^release: v\d+\.\d+\.\d+", first_line):
|
||||
click.echo(_("Release commit without task ID, skipping Vikunja update."))
|
||||
return
|
||||
# Non-release commits must have GRM-N prefix — fail loudly
|
||||
raise click.ClickException(
|
||||
_(
|
||||
"No task ID (GRM-N) found in commit message: {msg}\n"
|
||||
"All non-release commits on master must follow format: GRM-N <type>: <description>",
|
||||
msg=first_line,
|
||||
)
|
||||
)
|
||||
|
||||
client = VikunjaClient(VIKUNJA_API_URL, token)
|
||||
vikunja_task_id = 0
|
||||
|
||||
Reference in New Issue
Block a user