summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--danger/commit_messages/Dangerfile17
1 files changed, 10 insertions, 7 deletions
diff --git a/danger/commit_messages/Dangerfile b/danger/commit_messages/Dangerfile
index 15e94fb7aef..0c675cc4c9c 100644
--- a/danger/commit_messages/Dangerfile
+++ b/danger/commit_messages/Dangerfile
@@ -89,13 +89,16 @@ def lint_commit(commit) # rubocop:disable Metrics/AbcSize
return false if commit.message.start_with?('Revert "')
# Fail if a suggestion commit is used and squash is not enabled
- if commit.message.start_with?('Apply suggestion to') && !gitlab.mr_json['squash']
- fail_commit(
- commit,
- 'If you are applying suggestions, enable squash in the merge request and re-run the failed job'
- )
-
- return true
+ if commit.message.start_with?('Apply suggestion to')
+ if gitlab.mr_json['squash']
+ return false
+ else
+ fail_commit(
+ commit,
+ 'If you are applying suggestions, enable squash in the merge request and re-run the failed job'
+ )
+ return true
+ end
end
failures = false