Skip to content
Snippets Groups Projects
Unverified Commit c0e77361 authored by Oliver Smith's avatar Oliver Smith
Browse files

mrhlpr: msg_filter_add_label: add trailer line

Add basic logic to detect when we should insert a trailer line at the
end of the commit message, before adding the CI label.
parent 68acdfa1
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ if not label_line:
label = f"{label_line.split(']', 1)[0]}]"
label_found = False
line_number = 0
empty_lines = 0
for line in sys.stdin:
line = line.rstrip()
line_number += 1
......@@ -24,6 +25,9 @@ for line in sys.stdin:
if label in line:
label_found = True
if line == "":
empty_lines += 1
print(line)
if label_found:
......@@ -32,4 +36,8 @@ if label_found:
if line_number == 2:
print()
# Add empty line before starting trailer section of commit message
if line_number >= 3 and empty_lines < 2:
print()
print(label_line)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment