From c78af51776e9d60b8db58df335a1b3889e6ffc39 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Fri, 28 Jun 2019 18:21:11 +0800 Subject: Yes! Yes! Yes! --- danger/commit_messages/Dangerfile | 17 ++++++++++------- 1 file 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 -- cgit v1.2.1