Welcome to mirror list, hosted at ThFree Co, Russian Federation.

merge_request_linter.rb « danger « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d401d332aa7521ac8131402928aaa34fcbe9c612 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

require_relative 'base_linter'

module Gitlab
  module Danger
    class MergeRequestLinter < BaseLinter
      alias_method :lint, :lint_subject

      def self.subject_description
        'merge request title'
      end

      def self.mr_run_options_regex
        [
          'RUN AS-IF-FOSS',
          'UPDATE CACHE',
          'RUN ALL RSPEC',
          'SKIP RSPEC FAIL-FAST'
        ].join('|')
      end

      private

      def subject
        super.gsub(/\[?(#{self.class.mr_run_options_regex})\]?/, '').strip
      end
    end
  end
end