rubocop-rails 2.15.2 → 2.20.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +23 -2
  4. data/config/default.yml +181 -13
  5. data/config/obsoletion.yml +10 -0
  6. data/lib/rubocop/cop/mixin/active_record_helper.rb +3 -6
  7. data/lib/rubocop/cop/mixin/active_record_migrations_helper.rb +1 -3
  8. data/lib/rubocop/cop/mixin/enforce_superclass.rb +1 -1
  9. data/lib/rubocop/cop/mixin/index_method.rb +7 -17
  10. data/lib/rubocop/cop/mixin/migrations_helper.rb +1 -1
  11. data/lib/rubocop/cop/rails/action_controller_flash_before_render.rb +112 -0
  12. data/lib/rubocop/cop/rails/action_controller_test_case.rb +2 -2
  13. data/lib/rubocop/cop/rails/action_filter.rb +1 -1
  14. data/lib/rubocop/cop/rails/action_order.rb +116 -0
  15. data/lib/rubocop/cop/rails/active_record_aliases.rb +3 -4
  16. data/lib/rubocop/cop/rails/active_record_callbacks_order.rb +6 -3
  17. data/lib/rubocop/cop/rails/active_record_override.rb +2 -5
  18. data/lib/rubocop/cop/rails/active_support_on_load.rb +70 -0
  19. data/lib/rubocop/cop/rails/add_column_index.rb +2 -5
  20. data/lib/rubocop/cop/rails/application_controller.rb +1 -1
  21. data/lib/rubocop/cop/rails/application_job.rb +2 -2
  22. data/lib/rubocop/cop/rails/application_mailer.rb +1 -1
  23. data/lib/rubocop/cop/rails/application_record.rb +1 -1
  24. data/lib/rubocop/cop/rails/arel_star.rb +1 -1
  25. data/lib/rubocop/cop/rails/assert_not.rb +1 -2
  26. data/lib/rubocop/cop/rails/belongs_to.rb +1 -4
  27. data/lib/rubocop/cop/rails/blank.rb +6 -7
  28. data/lib/rubocop/cop/rails/bulk_change_table.rb +7 -24
  29. data/lib/rubocop/cop/rails/compact_blank.rb +5 -1
  30. data/lib/rubocop/cop/rails/content_tag.rb +5 -6
  31. data/lib/rubocop/cop/rails/create_table_with_timestamps.rb +16 -3
  32. data/lib/rubocop/cop/rails/date.rb +15 -11
  33. data/lib/rubocop/cop/rails/delegate.rb +19 -8
  34. data/lib/rubocop/cop/rails/delegate_allow_blank.rb +1 -1
  35. data/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb +18 -14
  36. data/lib/rubocop/cop/rails/dot_separated_keys.rb +2 -2
  37. data/lib/rubocop/cop/rails/duration_arithmetic.rb +3 -3
  38. data/lib/rubocop/cop/rails/dynamic_find_by.rb +25 -13
  39. data/lib/rubocop/cop/rails/eager_evaluation_log_message.rb +5 -1
  40. data/lib/rubocop/cop/rails/enum_hash.rb +1 -1
  41. data/lib/rubocop/cop/rails/enum_uniqueness.rb +2 -5
  42. data/lib/rubocop/cop/rails/environment_comparison.rb +2 -3
  43. data/lib/rubocop/cop/rails/file_path.rb +154 -27
  44. data/lib/rubocop/cop/rails/find_by_id.rb +2 -2
  45. data/lib/rubocop/cop/rails/find_each.rb +15 -5
  46. data/lib/rubocop/cop/rails/freeze_time.rb +79 -0
  47. data/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +4 -6
  48. data/lib/rubocop/cop/rails/helper_instance_variable.rb +1 -1
  49. data/lib/rubocop/cop/rails/http_positional_arguments.rb +22 -11
  50. data/lib/rubocop/cop/rails/http_status.rb +6 -11
  51. data/lib/rubocop/cop/rails/i18n_lazy_lookup.rb +2 -0
  52. data/lib/rubocop/cop/rails/i18n_locale_texts.rb +7 -3
  53. data/lib/rubocop/cop/rails/ignored_columns_assignment.rb +50 -0
  54. data/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb +23 -12
  55. data/lib/rubocop/cop/rails/index_by.rb +1 -1
  56. data/lib/rubocop/cop/rails/index_with.rb +1 -1
  57. data/lib/rubocop/cop/rails/inverse_of.rb +3 -9
  58. data/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb +21 -15
  59. data/lib/rubocop/cop/rails/link_to_blank.rb +1 -4
  60. data/lib/rubocop/cop/rails/mailer_name.rb +4 -4
  61. data/lib/rubocop/cop/rails/migration_class_name.rb +1 -1
  62. data/lib/rubocop/cop/rails/negate_include.rb +1 -1
  63. data/lib/rubocop/cop/rails/not_null_column.rb +9 -6
  64. data/lib/rubocop/cop/rails/output.rb +6 -8
  65. data/lib/rubocop/cop/rails/output_safety.rb +5 -1
  66. data/lib/rubocop/cop/rails/pluck.rb +44 -12
  67. data/lib/rubocop/cop/rails/pluck_id.rb +1 -1
  68. data/lib/rubocop/cop/rails/pluralization_grammar.rb +1 -2
  69. data/lib/rubocop/cop/rails/presence.rb +21 -12
  70. data/lib/rubocop/cop/rails/present.rb +8 -11
  71. data/lib/rubocop/cop/rails/rake_environment.rb +2 -2
  72. data/lib/rubocop/cop/rails/read_write_attribute.rb +1 -1
  73. data/lib/rubocop/cop/rails/redundant_allow_nil.rb +5 -7
  74. data/lib/rubocop/cop/rails/redundant_foreign_key.rb +2 -2
  75. data/lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb +3 -3
  76. data/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb +30 -26
  77. data/lib/rubocop/cop/rails/reflection_class_name.rb +34 -1
  78. data/lib/rubocop/cop/rails/refute_methods.rb +1 -6
  79. data/lib/rubocop/cop/rails/relative_date_constant.rb +4 -7
  80. data/lib/rubocop/cop/rails/request_referer.rb +1 -2
  81. data/lib/rubocop/cop/rails/require_dependency.rb +1 -1
  82. data/lib/rubocop/cop/rails/response_parsed_body.rb +57 -0
  83. data/lib/rubocop/cop/rails/reversible_migration.rb +14 -62
  84. data/lib/rubocop/cop/rails/reversible_migration_method_definition.rb +1 -2
  85. data/lib/rubocop/cop/rails/root_join_chain.rb +1 -1
  86. data/lib/rubocop/cop/rails/root_pathname_methods.rb +238 -0
  87. data/lib/rubocop/cop/rails/safe_navigation.rb +1 -1
  88. data/lib/rubocop/cop/rails/safe_navigation_with_blank.rb +1 -3
  89. data/lib/rubocop/cop/rails/save_bang.rb +10 -22
  90. data/lib/rubocop/cop/rails/short_i18n.rb +2 -5
  91. data/lib/rubocop/cop/rails/skips_model_validations.rb +2 -3
  92. data/lib/rubocop/cop/rails/squished_sql_heredocs.rb +9 -7
  93. data/lib/rubocop/cop/rails/three_state_boolean_column.rb +71 -0
  94. data/lib/rubocop/cop/rails/time_zone.rb +27 -25
  95. data/lib/rubocop/cop/rails/time_zone_assignment.rb +1 -1
  96. data/lib/rubocop/cop/rails/to_s_with_argument.rb +78 -0
  97. data/lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb +49 -0
  98. data/lib/rubocop/cop/rails/transaction_exit_statement.rb +8 -3
  99. data/lib/rubocop/cop/rails/uniq_before_pluck.rb +3 -6
  100. data/lib/rubocop/cop/rails/unique_validation_without_index.rb +22 -19
  101. data/lib/rubocop/cop/rails/unknown_env.rb +2 -4
  102. data/lib/rubocop/cop/rails/unused_ignored_columns.rb +6 -1
  103. data/lib/rubocop/cop/rails/validation.rb +4 -12
  104. data/lib/rubocop/cop/rails/where_equals.rb +1 -1
  105. data/lib/rubocop/cop/rails/where_exists.rb +1 -1
  106. data/lib/rubocop/cop/rails/where_missing.rb +118 -0
  107. data/lib/rubocop/cop/rails/where_not.rb +1 -1
  108. data/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb +55 -0
  109. data/lib/rubocop/cop/rails_cops.rb +12 -0
  110. data/lib/rubocop/rails/schema_loader/schema.rb +4 -4
  111. data/lib/rubocop/rails/version.rb +1 -1
  112. data/lib/rubocop/rails.rb +1 -1
  113. data/lib/rubocop-rails.rb +11 -0
  114. metadata +19 -9
  115. data/bin/console +0 -11
  116. data/bin/setup +0 -7
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.2
4
+ version: 2.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-07-07 00:00:00.000000000 Z
13
+ date: 2023-06-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 1.7.0
49
+ version: 1.33.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '2.0'
@@ -56,7 +56,7 @@ dependencies:
56
56
  requirements:
57
57
  - - ">="
58
58
  - !ruby/object:Gem::Version
59
- version: 1.7.0
59
+ version: 1.33.0
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
62
  version: '2.0'
@@ -72,8 +72,6 @@ extra_rdoc_files:
72
72
  files:
73
73
  - LICENSE.txt
74
74
  - README.md
75
- - bin/console
76
- - bin/setup
77
75
  - config/default.yml
78
76
  - config/obsoletion.yml
79
77
  - lib/rubocop-rails.rb
@@ -84,12 +82,15 @@ files:
84
82
  - lib/rubocop/cop/mixin/index_method.rb
85
83
  - lib/rubocop/cop/mixin/migrations_helper.rb
86
84
  - lib/rubocop/cop/mixin/target_rails_version.rb
85
+ - lib/rubocop/cop/rails/action_controller_flash_before_render.rb
87
86
  - lib/rubocop/cop/rails/action_controller_test_case.rb
88
87
  - lib/rubocop/cop/rails/action_filter.rb
88
+ - lib/rubocop/cop/rails/action_order.rb
89
89
  - lib/rubocop/cop/rails/active_record_aliases.rb
90
90
  - lib/rubocop/cop/rails/active_record_callbacks_order.rb
91
91
  - lib/rubocop/cop/rails/active_record_override.rb
92
92
  - lib/rubocop/cop/rails/active_support_aliases.rb
93
+ - lib/rubocop/cop/rails/active_support_on_load.rb
93
94
  - lib/rubocop/cop/rails/add_column_index.rb
94
95
  - lib/rubocop/cop/rails/after_commit_override.rb
95
96
  - lib/rubocop/cop/rails/application_controller.rb
@@ -126,6 +127,7 @@ files:
126
127
  - lib/rubocop/cop/rails/find_by.rb
127
128
  - lib/rubocop/cop/rails/find_by_id.rb
128
129
  - lib/rubocop/cop/rails/find_each.rb
130
+ - lib/rubocop/cop/rails/freeze_time.rb
129
131
  - lib/rubocop/cop/rails/has_and_belongs_to_many.rb
130
132
  - lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb
131
133
  - lib/rubocop/cop/rails/helper_instance_variable.rb
@@ -134,6 +136,7 @@ files:
134
136
  - lib/rubocop/cop/rails/i18n_lazy_lookup.rb
135
137
  - lib/rubocop/cop/rails/i18n_locale_assignment.rb
136
138
  - lib/rubocop/cop/rails/i18n_locale_texts.rb
139
+ - lib/rubocop/cop/rails/ignored_columns_assignment.rb
137
140
  - lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb
138
141
  - lib/rubocop/cop/rails/index_by.rb
139
142
  - lib/rubocop/cop/rails/index_with.rb
@@ -170,9 +173,11 @@ files:
170
173
  - lib/rubocop/cop/rails/render_plain_text.rb
171
174
  - lib/rubocop/cop/rails/request_referer.rb
172
175
  - lib/rubocop/cop/rails/require_dependency.rb
176
+ - lib/rubocop/cop/rails/response_parsed_body.rb
173
177
  - lib/rubocop/cop/rails/reversible_migration.rb
174
178
  - lib/rubocop/cop/rails/reversible_migration_method_definition.rb
175
179
  - lib/rubocop/cop/rails/root_join_chain.rb
180
+ - lib/rubocop/cop/rails/root_pathname_methods.rb
176
181
  - lib/rubocop/cop/rails/root_public_path.rb
177
182
  - lib/rubocop/cop/rails/safe_navigation.rb
178
183
  - lib/rubocop/cop/rails/safe_navigation_with_blank.rb
@@ -184,9 +189,12 @@ files:
184
189
  - lib/rubocop/cop/rails/squished_sql_heredocs.rb
185
190
  - lib/rubocop/cop/rails/strip_heredoc.rb
186
191
  - lib/rubocop/cop/rails/table_name_assignment.rb
192
+ - lib/rubocop/cop/rails/three_state_boolean_column.rb
187
193
  - lib/rubocop/cop/rails/time_zone.rb
188
194
  - lib/rubocop/cop/rails/time_zone_assignment.rb
189
195
  - lib/rubocop/cop/rails/to_formatted_s.rb
196
+ - lib/rubocop/cop/rails/to_s_with_argument.rb
197
+ - lib/rubocop/cop/rails/top_level_hash_with_indifferent_access.rb
190
198
  - lib/rubocop/cop/rails/transaction_exit_statement.rb
191
199
  - lib/rubocop/cop/rails/uniq_before_pluck.rb
192
200
  - lib/rubocop/cop/rails/unique_validation_without_index.rb
@@ -195,7 +203,9 @@ files:
195
203
  - lib/rubocop/cop/rails/validation.rb
196
204
  - lib/rubocop/cop/rails/where_equals.rb
197
205
  - lib/rubocop/cop/rails/where_exists.rb
206
+ - lib/rubocop/cop/rails/where_missing.rb
198
207
  - lib/rubocop/cop/rails/where_not.rb
208
+ - lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb
199
209
  - lib/rubocop/cop/rails_cops.rb
200
210
  - lib/rubocop/rails.rb
201
211
  - lib/rubocop/rails/inject.rb
@@ -209,7 +219,7 @@ metadata:
209
219
  homepage_uri: https://docs.rubocop.org/rubocop-rails/
210
220
  changelog_uri: https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md
211
221
  source_code_uri: https://github.com/rubocop/rubocop-rails/
212
- documentation_uri: https://docs.rubocop.org/rubocop-rails/2.15/
222
+ documentation_uri: https://docs.rubocop.org/rubocop-rails/2.20/
213
223
  bug_tracker_uri: https://github.com/rubocop/rubocop-rails/issues
214
224
  rubygems_mfa_required: 'true'
215
225
  post_install_message:
@@ -220,14 +230,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
220
230
  requirements:
221
231
  - - ">="
222
232
  - !ruby/object:Gem::Version
223
- version: 2.6.0
233
+ version: 2.7.0
224
234
  required_rubygems_version: !ruby/object:Gem::Requirement
225
235
  requirements:
226
236
  - - ">="
227
237
  - !ruby/object:Gem::Version
228
238
  version: '0'
229
239
  requirements: []
230
- rubygems_version: 3.1.6
240
+ rubygems_version: 3.5.0.dev
231
241
  signing_key:
232
242
  specification_version: 4
233
243
  summary: Automatic Rails code style checking tool.
data/bin/console DELETED
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'irb'
6
- require 'rubocop'
7
- require 'rubocop-rails'
8
-
9
- ARGV.clear
10
-
11
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -euo pipefail
4
- IFS=$'\n\t'
5
- set -vx
6
-
7
- bundle install