diff options
Diffstat (limited to 'rubocop')
-rw-r--r-- | rubocop/cop/include_action_view_context.rb | 26 | ||||
-rw-r--r-- | rubocop/rubocop.rb | 1 |
2 files changed, 0 insertions, 27 deletions
diff --git a/rubocop/cop/include_action_view_context.rb b/rubocop/cop/include_action_view_context.rb deleted file mode 100644 index 52c84a711c9..00000000000 --- a/rubocop/cop/include_action_view_context.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -module RuboCop - module Cop - # Cop that makes sure workers include `::Gitlab::ActionViewOutput::Context`, not `ActionView::Context`. - class IncludeActionViewContext < RuboCop::Cop::Cop - MSG = 'Include `::Gitlab::ActionViewOutput::Context`, not `ActionView::Context`, for Rails 5.'.freeze - - def_node_matcher :includes_action_view_context?, <<~PATTERN - (send nil? :include (const (const nil? :ActionView) :Context)) - PATTERN - - def on_send(node) - return unless includes_action_view_context?(node) - - add_offense(node.arguments.first, location: :expression) - end - - def autocorrect(node) - lambda do |corrector| - corrector.replace(node.source_range, '::Gitlab::ActionViewOutput::Context') - end - end - end - end -end diff --git a/rubocop/rubocop.rb b/rubocop/rubocop.rb index 1479dc3384a..d39683c271f 100644 --- a/rubocop/rubocop.rb +++ b/rubocop/rubocop.rb @@ -5,7 +5,6 @@ require_relative 'cop/gitlab/httparty' require_relative 'cop/gitlab/finder_with_find_by' require_relative 'cop/gitlab/union' require_relative 'cop/gitlab/rails_logger' -require_relative 'cop/include_action_view_context' require_relative 'cop/include_sidekiq_worker' require_relative 'cop/safe_params' require_relative 'cop/active_record_association_reload' |