rubocop-rails 2.8.1 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +18 -2
  4. data/config/default.yml +144 -6
  5. data/config/obsoletion.yml +7 -0
  6. data/lib/rubocop/cop/mixin/active_record_helper.rb +15 -3
  7. data/lib/rubocop/cop/mixin/enforce_superclass.rb +40 -0
  8. data/lib/rubocop/cop/mixin/index_method.rb +8 -11
  9. data/lib/rubocop/cop/rails/action_filter.rb +10 -14
  10. data/lib/rubocop/cop/rails/active_record_aliases.rb +13 -17
  11. data/lib/rubocop/cop/rails/active_record_callbacks_order.rb +17 -12
  12. data/lib/rubocop/cop/rails/active_record_override.rb +1 -1
  13. data/lib/rubocop/cop/rails/active_support_aliases.rb +12 -21
  14. data/lib/rubocop/cop/rails/add_column_index.rb +64 -0
  15. data/lib/rubocop/cop/rails/after_commit_override.rb +1 -1
  16. data/lib/rubocop/cop/rails/application_controller.rb +3 -7
  17. data/lib/rubocop/cop/rails/application_job.rb +2 -1
  18. data/lib/rubocop/cop/rails/application_mailer.rb +2 -7
  19. data/lib/rubocop/cop/rails/application_record.rb +2 -7
  20. data/lib/rubocop/cop/rails/arel_star.rb +41 -0
  21. data/lib/rubocop/cop/rails/assert_not.rb +8 -10
  22. data/lib/rubocop/cop/rails/attribute_default_block_value.rb +90 -0
  23. data/lib/rubocop/cop/rails/belongs_to.rb +10 -19
  24. data/lib/rubocop/cop/rails/blank.rb +31 -27
  25. data/lib/rubocop/cop/rails/bulk_change_table.rb +1 -1
  26. data/lib/rubocop/cop/rails/content_tag.rb +33 -18
  27. data/lib/rubocop/cop/rails/create_table_with_timestamps.rb +2 -1
  28. data/lib/rubocop/cop/rails/date.rb +27 -17
  29. data/lib/rubocop/cop/rails/default_scope.rb +11 -4
  30. data/lib/rubocop/cop/rails/delegate.rb +9 -9
  31. data/lib/rubocop/cop/rails/delegate_allow_blank.rb +7 -8
  32. data/lib/rubocop/cop/rails/dynamic_find_by.rb +16 -13
  33. data/lib/rubocop/cop/rails/eager_evaluation_log_message.rb +78 -0
  34. data/lib/rubocop/cop/rails/enum_hash.rb +11 -10
  35. data/lib/rubocop/cop/rails/enum_uniqueness.rb +2 -1
  36. data/lib/rubocop/cop/rails/environment_comparison.rb +18 -14
  37. data/lib/rubocop/cop/rails/environment_variable_access.rb +67 -0
  38. data/lib/rubocop/cop/rails/exit.rb +4 -10
  39. data/lib/rubocop/cop/rails/expanded_date_range.rb +86 -0
  40. data/lib/rubocop/cop/rails/file_path.rb +6 -7
  41. data/lib/rubocop/cop/rails/find_by.rb +32 -24
  42. data/lib/rubocop/cop/rails/find_by_id.rb +12 -21
  43. data/lib/rubocop/cop/rails/find_each.rb +19 -18
  44. data/lib/rubocop/cop/rails/has_and_belongs_to_many.rb +3 -2
  45. data/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +37 -6
  46. data/lib/rubocop/cop/rails/helper_instance_variable.rb +29 -3
  47. data/lib/rubocop/cop/rails/http_positional_arguments.rb +26 -21
  48. data/lib/rubocop/cop/rails/http_status.rb +18 -11
  49. data/lib/rubocop/cop/rails/i18n_locale_assignment.rb +37 -0
  50. data/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb +8 -6
  51. data/lib/rubocop/cop/rails/index_by.rb +2 -1
  52. data/lib/rubocop/cop/rails/index_with.rb +2 -1
  53. data/lib/rubocop/cop/rails/inquiry.rb +4 -3
  54. data/lib/rubocop/cop/rails/inverse_of.rb +3 -2
  55. data/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb +17 -15
  56. data/lib/rubocop/cop/rails/link_to_blank.rb +25 -23
  57. data/lib/rubocop/cop/rails/mailer_name.rb +19 -13
  58. data/lib/rubocop/cop/rails/match_route.rb +14 -13
  59. data/lib/rubocop/cop/rails/negate_include.rb +10 -8
  60. data/lib/rubocop/cop/rails/not_null_column.rb +2 -1
  61. data/lib/rubocop/cop/rails/order_by_id.rb +1 -2
  62. data/lib/rubocop/cop/rails/output.rb +5 -2
  63. data/lib/rubocop/cop/rails/output_safety.rb +3 -2
  64. data/lib/rubocop/cop/rails/pick.rb +14 -12
  65. data/lib/rubocop/cop/rails/pluck.rb +6 -9
  66. data/lib/rubocop/cop/rails/pluck_id.rb +4 -6
  67. data/lib/rubocop/cop/rails/pluck_in_where.rb +7 -7
  68. data/lib/rubocop/cop/rails/pluralization_grammar.rb +10 -14
  69. data/lib/rubocop/cop/rails/presence.rb +12 -13
  70. data/lib/rubocop/cop/rails/present.rb +30 -24
  71. data/lib/rubocop/cop/rails/rake_environment.rb +8 -10
  72. data/lib/rubocop/cop/rails/read_write_attribute.rb +12 -11
  73. data/lib/rubocop/cop/rails/redundant_allow_nil.rb +29 -31
  74. data/lib/rubocop/cop/rails/redundant_foreign_key.rb +9 -12
  75. data/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb +11 -10
  76. data/lib/rubocop/cop/rails/reflection_class_name.rb +17 -3
  77. data/lib/rubocop/cop/rails/refute_methods.rb +9 -10
  78. data/lib/rubocop/cop/rails/relative_date_constant.rb +34 -27
  79. data/lib/rubocop/cop/rails/render_inline.rb +2 -1
  80. data/lib/rubocop/cop/rails/render_plain_text.rb +9 -14
  81. data/lib/rubocop/cop/rails/request_referer.rb +7 -7
  82. data/lib/rubocop/cop/rails/require_dependency.rb +38 -0
  83. data/lib/rubocop/cop/rails/reversible_migration.rb +3 -7
  84. data/lib/rubocop/cop/rails/reversible_migration_method_definition.rb +75 -0
  85. data/lib/rubocop/cop/rails/safe_navigation.rb +30 -11
  86. data/lib/rubocop/cop/rails/safe_navigation_with_blank.rb +5 -10
  87. data/lib/rubocop/cop/rails/save_bang.rb +17 -20
  88. data/lib/rubocop/cop/rails/scope_args.rb +2 -1
  89. data/lib/rubocop/cop/rails/short_i18n.rb +7 -9
  90. data/lib/rubocop/cop/rails/skips_model_validations.rb +4 -4
  91. data/lib/rubocop/cop/rails/squished_sql_heredocs.rb +5 -6
  92. data/lib/rubocop/cop/rails/time_zone.rb +44 -42
  93. data/lib/rubocop/cop/rails/time_zone_assignment.rb +37 -0
  94. data/lib/rubocop/cop/rails/uniq_before_pluck.rb +4 -6
  95. data/lib/rubocop/cop/rails/unique_validation_without_index.rb +2 -2
  96. data/lib/rubocop/cop/rails/unknown_env.rb +3 -3
  97. data/lib/rubocop/cop/rails/unused_ignored_columns.rb +69 -0
  98. data/lib/rubocop/cop/rails/validation.rb +15 -14
  99. data/lib/rubocop/cop/rails/where_equals.rb +98 -0
  100. data/lib/rubocop/cop/rails/where_exists.rb +19 -13
  101. data/lib/rubocop/cop/rails/where_not.rb +10 -17
  102. data/lib/rubocop/cop/rails_cops.rb +13 -0
  103. data/lib/rubocop/rails.rb +2 -0
  104. data/lib/rubocop/rails/schema_loader.rb +4 -4
  105. data/lib/rubocop/rails/schema_loader/schema.rb +3 -5
  106. data/lib/rubocop/rails/version.rb +5 -1
  107. metadata +34 -14
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Rails
6
+ # This cop identifies places where manually constructed SQL
7
+ # in `where` can be replaced with `where(attribute: value)`.
8
+ #
9
+ # @example
10
+ # # bad
11
+ # User.where('name = ?', 'Gabe')
12
+ # User.where('name = :name', name: 'Gabe')
13
+ # User.where('name IS NULL')
14
+ # User.where('name IN (?)', ['john', 'jane'])
15
+ # User.where('name IN (:names)', names: ['john', 'jane'])
16
+ # User.where('users.name = :name', name: 'Gabe')
17
+ #
18
+ # # good
19
+ # User.where(name: 'Gabe')
20
+ # User.where(name: nil)
21
+ # User.where(name: ['john', 'jane'])
22
+ # User.where(users: { name: 'Gabe' })
23
+ class WhereEquals < Base
24
+ include RangeHelp
25
+ extend AutoCorrector
26
+
27
+ MSG = 'Use `%<good_method>s` instead of manually constructing SQL.'
28
+ RESTRICT_ON_SEND = %i[where].freeze
29
+
30
+ def_node_matcher :where_method_call?, <<~PATTERN
31
+ {
32
+ (send _ :where (array $str_type? $_ ?))
33
+ (send _ :where $str_type? $_ ?)
34
+ }
35
+ PATTERN
36
+
37
+ def on_send(node)
38
+ where_method_call?(node) do |template_node, value_node|
39
+ value_node = value_node.first
40
+
41
+ range = offense_range(node)
42
+
43
+ column_and_value = extract_column_and_value(template_node, value_node)
44
+ return unless column_and_value
45
+
46
+ good_method = build_good_method(*column_and_value)
47
+ message = format(MSG, good_method: good_method)
48
+
49
+ add_offense(range, message: message) do |corrector|
50
+ corrector.replace(range, good_method)
51
+ end
52
+ end
53
+ end
54
+
55
+ EQ_ANONYMOUS_RE = /\A([\w.]+)\s+=\s+\?\z/.freeze # column = ?
56
+ IN_ANONYMOUS_RE = /\A([\w.]+)\s+IN\s+\(\?\)\z/i.freeze # column IN (?)
57
+ EQ_NAMED_RE = /\A([\w.]+)\s+=\s+:(\w+)\z/.freeze # column = :column
58
+ IN_NAMED_RE = /\A([\w.]+)\s+IN\s+\(:(\w+)\)\z/i.freeze # column IN (:column)
59
+ IS_NULL_RE = /\A([\w.]+)\s+IS\s+NULL\z/i.freeze # column IS NULL
60
+
61
+ private
62
+
63
+ def offense_range(node)
64
+ range_between(node.loc.selector.begin_pos, node.loc.expression.end_pos)
65
+ end
66
+
67
+ def extract_column_and_value(template_node, value_node)
68
+ value =
69
+ case template_node.value
70
+ when EQ_ANONYMOUS_RE, IN_ANONYMOUS_RE
71
+ value_node.source
72
+ when EQ_NAMED_RE, IN_NAMED_RE
73
+ return unless value_node&.hash_type?
74
+
75
+ pair = value_node.pairs.find { |p| p.key.value.to_sym == Regexp.last_match(2).to_sym }
76
+ pair.value.source
77
+ when IS_NULL_RE
78
+ 'nil'
79
+ else
80
+ return
81
+ end
82
+
83
+ [Regexp.last_match(1), value]
84
+ end
85
+
86
+ def build_good_method(column, value)
87
+ if column.include?('.')
88
+ table, column = column.split('.')
89
+
90
+ "where(#{table}: { #{column}: #{value} })"
91
+ else
92
+ "where(#{column}: #{value})"
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -11,6 +11,17 @@ module RuboCop
11
11
  # When EnforcedStyle is 'where' then the cop enforces
12
12
  # `where(...).exists?` over `exists?(...)`.
13
13
  #
14
+ # This cop is unsafe for auto-correction because the behavior may change on the following case:
15
+ #
16
+ # [source,ruby]
17
+ # ----
18
+ # Author.includes(:articles).where(articles: {id: id}).exists?
19
+ # #=> Perform `eager_load` behavior (`LEFT JOIN` query) and get result.
20
+ #
21
+ # Author.includes(:articles).exists?(articles: {id: id})
22
+ # #=> Perform `preload` behavior and `ActiveRecord::StatementInvalid` error occurs.
23
+ # ----
24
+ #
14
25
  # @example EnforcedStyle: exists (default)
15
26
  # # bad
16
27
  # User.where(name: 'john').exists?
@@ -36,10 +47,12 @@ module RuboCop
36
47
  # User.where('name = ?', 'john').exists?
37
48
  # user.posts.where(published: true).exists?
38
49
  # User.where('length(name) > 10').exists?
39
- class WhereExists < Cop
50
+ class WhereExists < Base
40
51
  include ConfigurableEnforcedStyle
52
+ extend AutoCorrector
41
53
 
42
54
  MSG = 'Prefer `%<good_method>s` over `%<bad_method>s`.'
55
+ RESTRICT_ON_SEND = %i[exists?].freeze
43
56
 
44
57
  def_node_matcher :where_exists_call?, <<~PATTERN
45
58
  (send (send _ :where $...) :exists?)
@@ -54,19 +67,12 @@ module RuboCop
54
67
  return unless convertable_args?(args)
55
68
 
56
69
  range = correction_range(node)
57
- message = format(MSG, good_method: build_good_method(args), bad_method: range.source)
58
- add_offense(node, location: range, message: message)
59
- end
60
- end
61
-
62
- def autocorrect(node)
63
- args = find_offenses(node)
70
+ good_method = build_good_method(args)
71
+ message = format(MSG, good_method: good_method, bad_method: range.source)
64
72
 
65
- lambda do |corrector|
66
- corrector.replace(
67
- correction_range(node),
68
- build_good_method(args)
69
- )
73
+ add_offense(range, message: message) do |corrector|
74
+ corrector.replace(range, good_method)
75
+ end
70
76
  end
71
77
  end
72
78
 
@@ -15,16 +15,20 @@ module RuboCop
15
15
  # User.where('name IS NOT NULL')
16
16
  # User.where('name NOT IN (?)', ['john', 'jane'])
17
17
  # User.where('name NOT IN (:names)', names: ['john', 'jane'])
18
+ # User.where('users.name != :name', name: 'Gabe')
18
19
  #
19
20
  # # good
20
21
  # User.where.not(name: 'Gabe')
21
22
  # User.where.not(name: nil)
22
23
  # User.where.not(name: ['john', 'jane'])
24
+ # User.where.not(users: { name: 'Gabe' })
23
25
  #
24
- class WhereNot < Cop
26
+ class WhereNot < Base
25
27
  include RangeHelp
28
+ extend AutoCorrector
26
29
 
27
30
  MSG = 'Use `%<good_method>s` instead of manually constructing negated SQL in `where`.'
31
+ RESTRICT_ON_SEND = %i[where].freeze
28
32
 
29
33
  def_node_matcher :where_method_call?, <<~PATTERN
30
34
  {
@@ -45,21 +49,8 @@ module RuboCop
45
49
  good_method = build_good_method(*column_and_value)
46
50
  message = format(MSG, good_method: good_method)
47
51
 
48
- add_offense(node, location: range, message: message)
49
- end
50
- end
51
-
52
- def autocorrect(node)
53
- where_method_call?(node) do |template_node, value_node|
54
- value_node = value_node.first
55
-
56
- lambda do |corrector|
57
- range = offense_range(node)
58
-
59
- column, value = *extract_column_and_value(template_node, value_node)
60
- replacement = build_good_method(column, value)
61
-
62
- corrector.replace(range, replacement)
52
+ add_offense(range, message: message) do |corrector|
53
+ corrector.replace(range, good_method)
63
54
  end
64
55
  end
65
56
  end
@@ -97,7 +88,9 @@ module RuboCop
97
88
 
98
89
  def build_good_method(column, value)
99
90
  if column.include?('.')
100
- "where.not('#{column}' => #{value})"
91
+ table, column = column.split('.')
92
+
93
+ "where.not(#{table}: { #{column}: #{value} })"
101
94
  else
102
95
  "where.not(#{column}: #{value})"
103
96
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'mixin/active_record_helper'
4
+ require_relative 'mixin/enforce_superclass'
4
5
  require_relative 'mixin/index_method'
5
6
  require_relative 'mixin/target_rails_version'
6
7
 
@@ -9,12 +10,15 @@ require_relative 'rails/active_record_aliases'
9
10
  require_relative 'rails/active_record_callbacks_order'
10
11
  require_relative 'rails/active_record_override'
11
12
  require_relative 'rails/active_support_aliases'
13
+ require_relative 'rails/add_column_index'
12
14
  require_relative 'rails/after_commit_override'
13
15
  require_relative 'rails/application_controller'
14
16
  require_relative 'rails/application_job'
15
17
  require_relative 'rails/application_mailer'
16
18
  require_relative 'rails/application_record'
19
+ require_relative 'rails/arel_star'
17
20
  require_relative 'rails/assert_not'
21
+ require_relative 'rails/attribute_default_block_value'
18
22
  require_relative 'rails/belongs_to'
19
23
  require_relative 'rails/blank'
20
24
  require_relative 'rails/bulk_change_table'
@@ -25,10 +29,13 @@ require_relative 'rails/default_scope'
25
29
  require_relative 'rails/delegate'
26
30
  require_relative 'rails/delegate_allow_blank'
27
31
  require_relative 'rails/dynamic_find_by'
32
+ require_relative 'rails/eager_evaluation_log_message'
28
33
  require_relative 'rails/enum_hash'
29
34
  require_relative 'rails/enum_uniqueness'
30
35
  require_relative 'rails/environment_comparison'
36
+ require_relative 'rails/environment_variable_access'
31
37
  require_relative 'rails/exit'
38
+ require_relative 'rails/expanded_date_range'
32
39
  require_relative 'rails/file_path'
33
40
  require_relative 'rails/find_by'
34
41
  require_relative 'rails/find_by_id'
@@ -38,6 +45,7 @@ require_relative 'rails/has_many_or_has_one_dependent'
38
45
  require_relative 'rails/helper_instance_variable'
39
46
  require_relative 'rails/http_positional_arguments'
40
47
  require_relative 'rails/http_status'
48
+ require_relative 'rails/i18n_locale_assignment'
41
49
  require_relative 'rails/ignored_skip_action_filter_option'
42
50
  require_relative 'rails/index_by'
43
51
  require_relative 'rails/index_with'
@@ -70,7 +78,9 @@ require_relative 'rails/relative_date_constant'
70
78
  require_relative 'rails/render_inline'
71
79
  require_relative 'rails/render_plain_text'
72
80
  require_relative 'rails/request_referer'
81
+ require_relative 'rails/require_dependency'
73
82
  require_relative 'rails/reversible_migration'
83
+ require_relative 'rails/reversible_migration_method_definition'
74
84
  require_relative 'rails/safe_navigation'
75
85
  require_relative 'rails/safe_navigation_with_blank'
76
86
  require_relative 'rails/save_bang'
@@ -79,9 +89,12 @@ require_relative 'rails/short_i18n'
79
89
  require_relative 'rails/skips_model_validations'
80
90
  require_relative 'rails/squished_sql_heredocs'
81
91
  require_relative 'rails/time_zone'
92
+ require_relative 'rails/time_zone_assignment'
82
93
  require_relative 'rails/uniq_before_pluck'
83
94
  require_relative 'rails/unique_validation_without_index'
84
95
  require_relative 'rails/unknown_env'
96
+ require_relative 'rails/unused_ignored_columns'
85
97
  require_relative 'rails/validation'
98
+ require_relative 'rails/where_equals'
86
99
  require_relative 'rails/where_exists'
87
100
  require_relative 'rails/where_not'
data/lib/rubocop/rails.rb CHANGED
@@ -8,5 +8,7 @@ module RuboCop
8
8
  CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
9
9
 
10
10
  private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
11
+
12
+ ::RuboCop::ConfigObsoletion.files << PROJECT_ROOT.join('config', 'obsoletion.yml')
11
13
  end
12
14
  end
@@ -13,15 +13,15 @@ module RuboCop
13
13
  #
14
14
  # @return [Schema, nil]
15
15
  def load(target_ruby_version)
16
- return @schema if defined?(@schema)
16
+ return @load if defined?(@load)
17
17
 
18
- @schema = load!(target_ruby_version)
18
+ @load = load!(target_ruby_version)
19
19
  end
20
20
 
21
21
  def reset!
22
- return unless instance_variable_defined?(:@schema)
22
+ return unless instance_variable_defined?(:@load)
23
23
 
24
- remove_instance_variable(:@schema)
24
+ remove_instance_variable(:@load)
25
25
  end
26
26
 
27
27
  def db_schema_path
@@ -98,7 +98,7 @@ module RuboCop
98
98
  end
99
99
 
100
100
  def each_content(node, &block)
101
- return enum_for(__method__, node) unless block_given?
101
+ return enum_for(__method__, node) unless block
102
102
 
103
103
  case node.body&.type
104
104
  when :begin
@@ -114,7 +114,7 @@ module RuboCop
114
114
  attr_reader :name, :type, :not_null
115
115
 
116
116
  def initialize(node)
117
- @name = node.first_argument.value
117
+ @name = node.first_argument.str_content
118
118
  @type = node.method_name
119
119
  @not_null = nil
120
120
 
@@ -128,9 +128,7 @@ module RuboCop
128
128
  return unless pairs.hash_type?
129
129
 
130
130
  pairs.each_pair do |k, v|
131
- if k.value == :null
132
- @not_null = v.true_type? ? false : true
133
- end
131
+ @not_null = !v.true_type? if k.value == :null
134
132
  end
135
133
  end
136
134
  end
@@ -4,7 +4,11 @@ module RuboCop
4
4
  module Rails
5
5
  # This module holds the RuboCop Rails version information.
6
6
  module Version
7
- STRING = '2.8.1'
7
+ STRING = '2.11.0'
8
+
9
+ def self.document_version
10
+ STRING.match('\d+\.\d+').to_s
11
+ end
8
12
  end
9
13
  end
10
14
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
8
8
  - Jonas Arvidsson
9
9
  - Yuji Nakayama
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-15 00:00:00.000000000 Z
13
+ date: 2021-06-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -46,14 +46,20 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.87.0
49
+ version: 1.7.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '2.0'
50
53
  type: :runtime
51
54
  prerelease: false
52
55
  version_requirements: !ruby/object:Gem::Requirement
53
56
  requirements:
54
57
  - - ">="
55
58
  - !ruby/object:Gem::Version
56
- version: 0.87.0
59
+ version: 1.7.0
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '2.0'
57
63
  description: |
58
64
  Automatic Rails code style checking tool.
59
65
  A RuboCop extension focused on enforcing Rails best practices and coding conventions.
@@ -68,8 +74,10 @@ files:
68
74
  - README.md
69
75
  - bin/setup
70
76
  - config/default.yml
77
+ - config/obsoletion.yml
71
78
  - lib/rubocop-rails.rb
72
79
  - lib/rubocop/cop/mixin/active_record_helper.rb
80
+ - lib/rubocop/cop/mixin/enforce_superclass.rb
73
81
  - lib/rubocop/cop/mixin/index_method.rb
74
82
  - lib/rubocop/cop/mixin/target_rails_version.rb
75
83
  - lib/rubocop/cop/rails/action_filter.rb
@@ -77,12 +85,15 @@ files:
77
85
  - lib/rubocop/cop/rails/active_record_callbacks_order.rb
78
86
  - lib/rubocop/cop/rails/active_record_override.rb
79
87
  - lib/rubocop/cop/rails/active_support_aliases.rb
88
+ - lib/rubocop/cop/rails/add_column_index.rb
80
89
  - lib/rubocop/cop/rails/after_commit_override.rb
81
90
  - lib/rubocop/cop/rails/application_controller.rb
82
91
  - lib/rubocop/cop/rails/application_job.rb
83
92
  - lib/rubocop/cop/rails/application_mailer.rb
84
93
  - lib/rubocop/cop/rails/application_record.rb
94
+ - lib/rubocop/cop/rails/arel_star.rb
85
95
  - lib/rubocop/cop/rails/assert_not.rb
96
+ - lib/rubocop/cop/rails/attribute_default_block_value.rb
86
97
  - lib/rubocop/cop/rails/belongs_to.rb
87
98
  - lib/rubocop/cop/rails/blank.rb
88
99
  - lib/rubocop/cop/rails/bulk_change_table.rb
@@ -93,10 +104,13 @@ files:
93
104
  - lib/rubocop/cop/rails/delegate.rb
94
105
  - lib/rubocop/cop/rails/delegate_allow_blank.rb
95
106
  - lib/rubocop/cop/rails/dynamic_find_by.rb
107
+ - lib/rubocop/cop/rails/eager_evaluation_log_message.rb
96
108
  - lib/rubocop/cop/rails/enum_hash.rb
97
109
  - lib/rubocop/cop/rails/enum_uniqueness.rb
98
110
  - lib/rubocop/cop/rails/environment_comparison.rb
111
+ - lib/rubocop/cop/rails/environment_variable_access.rb
99
112
  - lib/rubocop/cop/rails/exit.rb
113
+ - lib/rubocop/cop/rails/expanded_date_range.rb
100
114
  - lib/rubocop/cop/rails/file_path.rb
101
115
  - lib/rubocop/cop/rails/find_by.rb
102
116
  - lib/rubocop/cop/rails/find_by_id.rb
@@ -106,6 +120,7 @@ files:
106
120
  - lib/rubocop/cop/rails/helper_instance_variable.rb
107
121
  - lib/rubocop/cop/rails/http_positional_arguments.rb
108
122
  - lib/rubocop/cop/rails/http_status.rb
123
+ - lib/rubocop/cop/rails/i18n_locale_assignment.rb
109
124
  - lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb
110
125
  - lib/rubocop/cop/rails/index_by.rb
111
126
  - lib/rubocop/cop/rails/index_with.rb
@@ -138,7 +153,9 @@ files:
138
153
  - lib/rubocop/cop/rails/render_inline.rb
139
154
  - lib/rubocop/cop/rails/render_plain_text.rb
140
155
  - lib/rubocop/cop/rails/request_referer.rb
156
+ - lib/rubocop/cop/rails/require_dependency.rb
141
157
  - lib/rubocop/cop/rails/reversible_migration.rb
158
+ - lib/rubocop/cop/rails/reversible_migration_method_definition.rb
142
159
  - lib/rubocop/cop/rails/safe_navigation.rb
143
160
  - lib/rubocop/cop/rails/safe_navigation_with_blank.rb
144
161
  - lib/rubocop/cop/rails/save_bang.rb
@@ -147,10 +164,13 @@ files:
147
164
  - lib/rubocop/cop/rails/skips_model_validations.rb
148
165
  - lib/rubocop/cop/rails/squished_sql_heredocs.rb
149
166
  - lib/rubocop/cop/rails/time_zone.rb
167
+ - lib/rubocop/cop/rails/time_zone_assignment.rb
150
168
  - lib/rubocop/cop/rails/uniq_before_pluck.rb
151
169
  - lib/rubocop/cop/rails/unique_validation_without_index.rb
152
170
  - lib/rubocop/cop/rails/unknown_env.rb
171
+ - lib/rubocop/cop/rails/unused_ignored_columns.rb
153
172
  - lib/rubocop/cop/rails/validation.rb
173
+ - lib/rubocop/cop/rails/where_equals.rb
154
174
  - lib/rubocop/cop/rails/where_exists.rb
155
175
  - lib/rubocop/cop/rails/where_not.rb
156
176
  - lib/rubocop/cop/rails_cops.rb
@@ -159,16 +179,16 @@ files:
159
179
  - lib/rubocop/rails/schema_loader.rb
160
180
  - lib/rubocop/rails/schema_loader/schema.rb
161
181
  - lib/rubocop/rails/version.rb
162
- homepage: https://github.com/rubocop-hq/rubocop-rails
182
+ homepage: https://github.com/rubocop/rubocop-rails
163
183
  licenses:
164
184
  - MIT
165
185
  metadata:
166
186
  homepage_uri: https://docs.rubocop.org/rubocop-rails/
167
- changelog_uri: https://github.com/rubocop-hq/rubocop-rails/blob/master/CHANGELOG.md
168
- source_code_uri: https://github.com/rubocop-hq/rubocop-rails/
169
- documentation_uri: https://docs.rubocop.org/rubocop-rails/
170
- bug_tracker_uri: https://github.com/rubocop-hq/rubocop-rails/issues
171
- post_install_message:
187
+ changelog_uri: https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md
188
+ source_code_uri: https://github.com/rubocop/rubocop-rails/
189
+ documentation_uri: https://docs.rubocop.org/rubocop-rails/2.11/
190
+ bug_tracker_uri: https://github.com/rubocop/rubocop-rails/issues
191
+ post_install_message:
172
192
  rdoc_options: []
173
193
  require_paths:
174
194
  - lib
@@ -176,15 +196,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
196
  requirements:
177
197
  - - ">="
178
198
  - !ruby/object:Gem::Version
179
- version: 2.4.0
199
+ version: 2.5.0
180
200
  required_rubygems_version: !ruby/object:Gem::Requirement
181
201
  requirements:
182
202
  - - ">="
183
203
  - !ruby/object:Gem::Version
184
204
  version: '0'
185
205
  requirements: []
186
- rubygems_version: 3.1.4
187
- signing_key:
206
+ rubygems_version: 3.2.18
207
+ signing_key:
188
208
  specification_version: 4
189
209
  summary: Automatic Rails code style checking tool.
190
210
  test_files: []