diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /danger/commit_messages/Dangerfile | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'danger/commit_messages/Dangerfile')
-rw-r--r-- | danger/commit_messages/Dangerfile | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/danger/commit_messages/Dangerfile b/danger/commit_messages/Dangerfile index 4e17db60471..816d7384a2d 100644 --- a/danger/commit_messages/Dangerfile +++ b/danger/commit_messages/Dangerfile @@ -1,6 +1,7 @@ # frozen_string_literal: true require_relative File.expand_path('../../lib/gitlab/danger/commit_linter', __dir__) +require_relative File.expand_path('../../lib/gitlab/danger/merge_request_linter', __dir__) COMMIT_MESSAGE_GUIDELINES = "https://docs.gitlab.com/ee/development/contributing/merge_request_workflow.html#commit-messages-guidelines" MORE_INFO = "For more information, take a look at our [Commit message guidelines](#{COMMIT_MESSAGE_GUIDELINES})." @@ -92,7 +93,7 @@ end def lint_mr_title(mr_title) commit = Struct.new(:message, :sha).new(mr_title) - Gitlab::Danger::CommitLinter.new(commit).lint_subject("merge request title") + Gitlab::Danger::MergeRequestLinter.new(commit).lint end def count_non_fixup_commits(commit_linters) @@ -139,4 +140,12 @@ def warn_or_fail_commits(failed_linters, default_to_fail: true) end end -lint_commits(git.commits) +# As part of https://gitlab.com/groups/gitlab-org/-/epics/4826 we are +# vendoring workhorse commits from the stand-alone gitlab-workhorse +# repo. There is no point in linting commits that we want to vendor as +# is. +def workhorse_changes? + git.diff.any? { |file| file.path.start_with?('workhorse/') } +end + +lint_commits(git.commits) unless workhorse_changes? |