diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-09-06 10:14:30 +0300 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2019-09-06 10:14:30 +0300 |
commit | f34e4545ec20953267ee187227116756562c6e8a (patch) | |
tree | 32326de09418e404ac74b2b05398bd5449ba8b6c /lib/gitlab_danger.rb | |
parent | 351d72cbed57c5b117e6b2239dffabcedbc45046 (diff) |
Revert "Merge branch '66596-allow-danger-to-be-run-locally' into 'master'"
This reverts merge request !32196
Diffstat (limited to 'lib/gitlab_danger.rb')
-rw-r--r-- | lib/gitlab_danger.rb | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/lib/gitlab_danger.rb b/lib/gitlab_danger.rb deleted file mode 100644 index b4768a9546d..00000000000 --- a/lib/gitlab_danger.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class GitlabDanger - LOCAL_RULES ||= %w[ - changes_size - gemfile - documentation - frozen_string - duplicate_yarn_dependencies - prettier - eslint - database - ].freeze - - CI_ONLY_RULES ||= %w[ - metadata - changelog - specs - commit_messages - roulette - single_codebase - gitlab_ui_wg - ce_ee_vue_templates - only_documentation - ].freeze - - MESSAGE_PREFIX = '==>'.freeze - - attr_reader :gitlab_danger_helper - - def initialize(gitlab_danger_helper) - @gitlab_danger_helper = gitlab_danger_helper - end - - def self.local_warning_message - "#{MESSAGE_PREFIX} Only the following Danger rules can be run locally: #{LOCAL_RULES.join(', ')}" - end - - def self.success_message - "#{MESSAGE_PREFIX} No Danger rule violations!" - end - - def rule_names - ci? ? LOCAL_RULES | CI_ONLY_RULES : LOCAL_RULES - end - - def html_link(str) - self.ci? ? gitlab_danger_helper.html_link(str) : str - end - - def ci? - !gitlab_danger_helper.nil? - end -end |