module Gitlab::Dangerfiles::TitleLinting

Constants

CHERRY_PICK_REGEX
DRAFT_REGEX
RUN_ALL_RSPEC_REGEX
RUN_AS_IF_FOSS_REGEX

Public Instance Methods

has_cherry_pick_flag?(title) click to toggle source
# File lib/gitlab/dangerfiles/title_linting.rb, line 27
def has_cherry_pick_flag?(title)
  CHERRY_PICK_REGEX.match?(title)
end
has_draft_flag?(title) click to toggle source
# File lib/gitlab/dangerfiles/title_linting.rb, line 21
def has_draft_flag?(title)
  puts "This method is deprecated in favor of `helper.draft_mr?`."

  DRAFT_REGEX.match?(title)
end
has_run_all_rspec_flag?(title) click to toggle source
# File lib/gitlab/dangerfiles/title_linting.rb, line 31
def has_run_all_rspec_flag?(title)
  RUN_ALL_RSPEC_REGEX.match?(title)
end
has_run_as_if_foss_flag?(title) click to toggle source
# File lib/gitlab/dangerfiles/title_linting.rb, line 35
def has_run_as_if_foss_flag?(title)
  RUN_AS_IF_FOSS_REGEX.match?(title)
end
remove_draft_flag(title) click to toggle source
# File lib/gitlab/dangerfiles/title_linting.rb, line 17
def remove_draft_flag(title)
  title.gsub(DRAFT_REGEX, "")
end
sanitize_mr_title(title) click to toggle source
# File lib/gitlab/dangerfiles/title_linting.rb, line 13
def sanitize_mr_title(title)
  remove_draft_flag(title).gsub(/`/, '\\\`')
end