# frozen_string_literal: true

SUBTYPE_LABEL_MISSING_MESSAGE = "Please add a [merge request subtype](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) to this merge request."

types = %w(bug feature maintenance)
types.each do |type|
  return if helper.has_scoped_label_with_scope?(type)
end

if ENV['DANGER_ERROR_WHEN_SUBTYPE_LABEL_IS_MISSING'] == 'true'
  fail SUBTYPE_LABEL_MISSING_MESSAGE
else
  warn SUBTYPE_LABEL_MISSING_MESSAGE
end
