forked from standardrb/standard-rails
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathload_rubocop_rails_without_the_monkey_patch.rb
54 lines (46 loc) · 1.73 KB
/
load_rubocop_rails_without_the_monkey_patch.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# GENERATED FILE - DO NOT EDIT
#
# This file should look just like: https://github.com/rubocop/rubocop-rails/blob/master/lib/rubocop-rails.rb
# Except without the `Inject.defaults!` monkey patching.
#
# Because there are both necessary require statements and additional patching
# of RuboCop built-in cops in this file, we need to monitor it for changes
# in rubocop-rails and keep it up to date.
#
# Last updated from rubocop-rails v2.30.3
# frozen_string_literal: true
require "rubocop"
require "rack/utils"
require "active_support/inflector"
require "active_support/core_ext/object/blank"
require_path = Pathname.new(Gem.loaded_specs["rubocop-rails"].full_require_paths.first)
require require_path.join("rubocop/rails")
require require_path.join("rubocop/rails/version")
require require_path.join("rubocop/rails/schema_loader")
require require_path.join("rubocop/rails/schema_loader/schema")
require require_path.join("rubocop/rails/plugin")
require require_path.join("rubocop/cop/rails_cops")
require require_path.join("rubocop/rails/migration_file_skippable")
RuboCop::Rails::MigrationFileSkippable.apply_to_cops!
RuboCop::Cop::Style::HashExcept.minimum_target_ruby_version(2.0)
RuboCop::Cop::Style::InverseMethods.singleton_class.prepend(
Module.new do
def autocorrect_incompatible_with
super.push(RuboCop::Cop::Rails::NegateInclude)
end
end
)
RuboCop::Cop::Style::MethodCallWithArgsParentheses.singleton_class.prepend(
Module.new do
def autocorrect_incompatible_with
super.push(RuboCop::Cop::Rails::EagerEvaluationLogMessage)
end
end
)
RuboCop::Cop::Style::RedundantSelf.singleton_class.prepend(
Module.new do
def autocorrect_incompatible_with
super.push(RuboCop::Cop::Rails::SafeNavigation)
end
end
)