Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'rubocop/cop/include_action_view_context.rb')
-rw-r--r--rubocop/cop/include_action_view_context.rb26
1 files changed, 0 insertions, 26 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