blob: 071db19dbfd5c1617a4ccfc0509d9653ad61677f [file] [log] [blame]
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.