diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 18:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-29 18:08:47 +0000 |
commit | 6b9d3a4e8351e662c4586b24bb152de78ae9e3bf (patch) | |
tree | 883e9db60c047c54418fc1d2b1c5517f97e0f185 /rubocop | |
parent | 23288f62da73fb0e30d8e7ce306665e8fda1b932 (diff) | |
download | gitlab-ce-6b9d3a4e8351e662c4586b24bb152de78ae9e3bf.tar.gz |
Add latest changes from gitlab-org/gitlab@master
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' |