submit_filter(In, Out) :- | |
check_draft(In, S1), | |
check_do_not_submit(S1, Out). | |
check_draft(S1, S2) :- | |
gerrit:commit_message_matches('DRAFT'), !, | |
S2 = [label('Found-DRAFT-In-Commit-Message', need(_)) | S1]. | |
check_draft(S1, S2) :- | |
S2 = S1. | |
check_do_not_submit(S1, S2) :- | |
gerrit:commit_message_matches('DO NOT SUBMIT'), !, | |
S2 = [label('Found-DO-NOT-SUBMIT-In-Commit-Message', need(_)) | S1]. | |
check_do_not_submit(S1, S2) :- | |
S2 = S1. | |