2021-02-22 17:27:13 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
require_relative 'base_linter'
|
2021-03-08 18:12:59 +05:30
|
|
|
|
2021-03-11 19:13:27 +05:30
|
|
|
module Tooling
|
2021-02-22 17:27:13 +05:30
|
|
|
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
|