rubocop-rails 2.17.4 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +22 -2
- data/config/default.yml +54 -29
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +1 -1
- data/lib/rubocop/cop/mixin/index_method.rb +3 -3
- data/lib/rubocop/cop/rails/action_controller_flash_before_render.rb +10 -2
- data/lib/rubocop/cop/rails/action_controller_test_case.rb +1 -1
- data/lib/rubocop/cop/rails/action_order.rb +5 -6
- data/lib/rubocop/cop/rails/active_record_aliases.rb +2 -0
- data/lib/rubocop/cop/rails/active_record_callbacks_order.rb +6 -3
- data/lib/rubocop/cop/rails/add_column_index.rb +2 -2
- data/lib/rubocop/cop/rails/application_job.rb +1 -1
- data/lib/rubocop/cop/rails/arel_star.rb +1 -1
- data/lib/rubocop/cop/rails/assert_not.rb +1 -1
- data/lib/rubocop/cop/rails/belongs_to.rb +1 -4
- data/lib/rubocop/cop/rails/blank.rb +5 -5
- data/lib/rubocop/cop/rails/bulk_change_table.rb +1 -4
- data/lib/rubocop/cop/rails/compact_blank.rb +2 -2
- data/lib/rubocop/cop/rails/content_tag.rb +1 -1
- data/lib/rubocop/cop/rails/create_table_with_timestamps.rb +16 -3
- data/lib/rubocop/cop/rails/delegate.rb +17 -3
- data/lib/rubocop/cop/rails/delegate_allow_blank.rb +1 -1
- data/lib/rubocop/cop/rails/deprecated_active_model_errors_methods.rb +1 -1
- data/lib/rubocop/cop/rails/duration_arithmetic.rb +1 -1
- data/lib/rubocop/cop/rails/dynamic_find_by.rb +1 -1
- data/lib/rubocop/cop/rails/eager_evaluation_log_message.rb +1 -1
- data/lib/rubocop/cop/rails/enum_hash.rb +1 -1
- data/lib/rubocop/cop/rails/environment_comparison.rb +1 -1
- data/lib/rubocop/cop/rails/file_path.rb +31 -15
- data/lib/rubocop/cop/rails/find_by_id.rb +2 -2
- data/lib/rubocop/cop/rails/find_each.rb +6 -2
- data/lib/rubocop/cop/rails/freeze_time.rb +3 -0
- data/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +2 -2
- data/lib/rubocop/cop/rails/http_positional_arguments.rb +18 -2
- data/lib/rubocop/cop/rails/http_status.rb +1 -1
- data/lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb +0 -2
- data/lib/rubocop/cop/rails/inverse_of.rb +0 -3
- data/lib/rubocop/cop/rails/lexically_scoped_action_filter.rb +17 -7
- data/lib/rubocop/cop/rails/link_to_blank.rb +1 -1
- data/lib/rubocop/cop/rails/mailer_name.rb +1 -1
- data/lib/rubocop/cop/rails/negate_include.rb +1 -1
- data/lib/rubocop/cop/rails/not_null_column.rb +9 -6
- data/lib/rubocop/cop/rails/output.rb +3 -2
- data/lib/rubocop/cop/rails/output_safety.rb +5 -1
- data/lib/rubocop/cop/rails/pluck.rb +13 -1
- data/lib/rubocop/cop/rails/pluck_id.rb +1 -1
- data/lib/rubocop/cop/rails/presence.rb +3 -3
- data/lib/rubocop/cop/rails/present.rb +5 -5
- data/lib/rubocop/cop/rails/rake_environment.rb +1 -1
- data/lib/rubocop/cop/rails/read_write_attribute.rb +1 -1
- data/lib/rubocop/cop/rails/redundant_allow_nil.rb +3 -3
- data/lib/rubocop/cop/rails/redundant_foreign_key.rb +1 -1
- data/lib/rubocop/cop/rails/redundant_receiver_in_with_options.rb +1 -1
- data/lib/rubocop/cop/rails/reflection_class_name.rb +17 -1
- data/lib/rubocop/cop/rails/relative_date_constant.rb +2 -2
- data/lib/rubocop/cop/rails/response_parsed_body.rb +57 -0
- data/lib/rubocop/cop/rails/reversible_migration.rb +4 -29
- data/lib/rubocop/cop/rails/root_join_chain.rb +1 -1
- data/lib/rubocop/cop/rails/root_pathname_methods.rb +1 -1
- data/lib/rubocop/cop/rails/safe_navigation.rb +1 -1
- data/lib/rubocop/cop/rails/squished_sql_heredocs.rb +8 -1
- data/lib/rubocop/cop/rails/three_state_boolean_column.rb +71 -0
- data/lib/rubocop/cop/rails/time_zone.rb +2 -2
- data/lib/rubocop/cop/rails/transaction_exit_statement.rb +0 -2
- data/lib/rubocop/cop/rails/unique_validation_without_index.rb +1 -1
- data/lib/rubocop/cop/rails/unused_ignored_columns.rb +6 -1
- data/lib/rubocop/cop/rails/validation.rb +1 -1
- data/lib/rubocop/cop/rails/where_equals.rb +1 -1
- data/lib/rubocop/cop/rails/where_exists.rb +1 -1
- data/lib/rubocop/cop/rails/where_missing.rb +3 -3
- data/lib/rubocop/cop/rails/where_not.rb +1 -1
- data/lib/rubocop/cop/rails/where_not_with_multiple_conditions.rb +2 -2
- data/lib/rubocop/cop/rails_cops.rb +2 -0
- data/lib/rubocop/rails/version.rb +1 -1
- data/lib/rubocop/rails.rb +1 -1
- data/lib/rubocop-rails.rb +1 -0
- metadata +6 -4
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Rails
|
6
|
+
# Prefer `response.parsed_body` to `JSON.parse(response.body)`.
|
7
|
+
#
|
8
|
+
# @safety
|
9
|
+
# This cop is unsafe because Content-Type may not be `application/json`. For example, the proprietary
|
10
|
+
# Content-Type provided by corporate entities such as `application/vnd.github+json` is not supported at
|
11
|
+
# `response.parsed_body` by default, so you still have to use `JSON.parse(response.body)` there.
|
12
|
+
#
|
13
|
+
# @example
|
14
|
+
# # bad
|
15
|
+
# JSON.parse(response.body)
|
16
|
+
#
|
17
|
+
# # good
|
18
|
+
# response.parsed_body
|
19
|
+
class ResponseParsedBody < Base
|
20
|
+
extend AutoCorrector
|
21
|
+
extend TargetRailsVersion
|
22
|
+
|
23
|
+
MSG = 'Prefer `response.parsed_body` to `JSON.parse(response.body)`.'
|
24
|
+
|
25
|
+
RESTRICT_ON_SEND = %i[parse].freeze
|
26
|
+
|
27
|
+
minimum_target_rails_version 5.0
|
28
|
+
|
29
|
+
# @!method json_parse_response_body?(node)
|
30
|
+
def_node_matcher :json_parse_response_body?, <<~PATTERN
|
31
|
+
(send
|
32
|
+
(const {nil? cbase} :JSON)
|
33
|
+
:parse
|
34
|
+
(send
|
35
|
+
(send nil? :response)
|
36
|
+
:body
|
37
|
+
)
|
38
|
+
)
|
39
|
+
PATTERN
|
40
|
+
|
41
|
+
def on_send(node)
|
42
|
+
return unless json_parse_response_body?(node)
|
43
|
+
|
44
|
+
add_offense(node) do |corrector|
|
45
|
+
autocorrect(corrector, node)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def autocorrect(corrector, node)
|
52
|
+
corrector.replace(node, 'response.parsed_body')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -16,23 +16,15 @@ module RuboCop
|
|
16
16
|
#
|
17
17
|
# # good
|
18
18
|
# def change
|
19
|
-
#
|
20
|
-
# t.
|
19
|
+
# change_table :users do |t|
|
20
|
+
# t.remove :name, :string
|
21
21
|
# end
|
22
22
|
# end
|
23
23
|
#
|
24
24
|
# # good
|
25
25
|
# def change
|
26
|
-
#
|
27
|
-
#
|
28
|
-
# dir.up do
|
29
|
-
# t.column :name, :string
|
30
|
-
# end
|
31
|
-
#
|
32
|
-
# dir.down do
|
33
|
-
# t.remove :name
|
34
|
-
# end
|
35
|
-
# end
|
26
|
+
# create_table :users do |t|
|
27
|
+
# t.string :name
|
36
28
|
# end
|
37
29
|
# end
|
38
30
|
#
|
@@ -114,21 +106,6 @@ module RuboCop
|
|
114
106
|
# end
|
115
107
|
# end
|
116
108
|
#
|
117
|
-
# # good
|
118
|
-
# def change
|
119
|
-
# reversible do |dir|
|
120
|
-
# change_table :users do |t|
|
121
|
-
# dir.up do
|
122
|
-
# t.change :price, :string
|
123
|
-
# end
|
124
|
-
#
|
125
|
-
# dir.down do
|
126
|
-
# t.change :price, :integer
|
127
|
-
# end
|
128
|
-
# end
|
129
|
-
# end
|
130
|
-
# end
|
131
|
-
#
|
132
109
|
# @example
|
133
110
|
# # remove_columns
|
134
111
|
#
|
@@ -173,8 +150,6 @@ module RuboCop
|
|
173
150
|
# def change
|
174
151
|
# remove_index :users, column: :email
|
175
152
|
# end
|
176
|
-
#
|
177
|
-
# @see https://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html
|
178
153
|
class ReversibleMigration < Base
|
179
154
|
include MigrationsHelper
|
180
155
|
|
@@ -39,7 +39,7 @@ module RuboCop
|
|
39
39
|
def on_send(node)
|
40
40
|
evidence(node) do |rails_node, args|
|
41
41
|
add_offense(node, message: format(MSG, root: rails_node.source)) do |corrector|
|
42
|
-
range = range_between(rails_node.loc.selector.end_pos, node.
|
42
|
+
range = range_between(rails_node.loc.selector.end_pos, node.source_range.end_pos)
|
43
43
|
replacement = ".join(#{args.map(&:source).join(', ')})"
|
44
44
|
|
45
45
|
corrector.replace(range, replacement)
|
@@ -184,7 +184,7 @@ module RuboCop
|
|
184
184
|
end
|
185
185
|
|
186
186
|
def build_path_glob_replacement(path, method)
|
187
|
-
receiver = range_between(path.
|
187
|
+
receiver = range_between(path.source_range.begin_pos, path.children.first.loc.selector.end_pos).source
|
188
188
|
|
189
189
|
argument = path.arguments.one? ? path.first_argument.source : join_arguments(path.arguments)
|
190
190
|
|
@@ -73,7 +73,7 @@ module RuboCop
|
|
73
73
|
method = method_node.source[1..]
|
74
74
|
|
75
75
|
range = if node.receiver
|
76
|
-
range_between(node.loc.dot.begin_pos, node.
|
76
|
+
range_between(node.loc.dot.begin_pos, node.source_range.end_pos)
|
77
77
|
else
|
78
78
|
corrector.insert_before(node, 'self')
|
79
79
|
node
|
@@ -48,6 +48,7 @@ module RuboCop
|
|
48
48
|
SQL = 'SQL'
|
49
49
|
SQUISH = '.squish'
|
50
50
|
MSG = 'Use `%<expect>s` instead of `%<current>s`.'
|
51
|
+
SQL_IDENTIFIER_MARKERS = /(".+?")|('.+?')|(\[.+?\])/.freeze
|
51
52
|
|
52
53
|
def on_heredoc(node)
|
53
54
|
return unless offense_detected?(node)
|
@@ -60,7 +61,7 @@ module RuboCop
|
|
60
61
|
private
|
61
62
|
|
62
63
|
def offense_detected?(node)
|
63
|
-
sql_heredoc?(node) && !using_squish?(node)
|
64
|
+
sql_heredoc?(node) && !using_squish?(node) && !singleline_comments_present?(node)
|
64
65
|
end
|
65
66
|
|
66
67
|
def sql_heredoc?(node)
|
@@ -71,6 +72,12 @@ module RuboCop
|
|
71
72
|
node.parent&.send_type? && node.parent&.method?(:squish)
|
72
73
|
end
|
73
74
|
|
75
|
+
def singleline_comments_present?(node)
|
76
|
+
sql = node.children.map { |c| c.is_a?(String) ? c : c.source }.join('\n')
|
77
|
+
|
78
|
+
sql.gsub(SQL_IDENTIFIER_MARKERS, '').include?('--')
|
79
|
+
end
|
80
|
+
|
74
81
|
def message(node)
|
75
82
|
format(MSG, expect: "#{node.source}#{SQUISH}", current: node.source)
|
76
83
|
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Rails
|
6
|
+
# Enforces that boolean columns are created with default values (`false` or `true`) and
|
7
|
+
# `NOT NULL` constraint.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# # bad
|
11
|
+
# add_column :users, :active, :boolean
|
12
|
+
# t.column :active, :boolean
|
13
|
+
# t.boolean :active
|
14
|
+
#
|
15
|
+
# # good
|
16
|
+
# add_column :users, :active, :boolean, default: true, null: false
|
17
|
+
# t.column :active, :boolean, default: true, null: false
|
18
|
+
# t.boolean :active, default: true, null: false
|
19
|
+
#
|
20
|
+
class ThreeStateBooleanColumn < Base
|
21
|
+
MSG = 'Boolean columns should always have a default value and a `NOT NULL` constraint.'
|
22
|
+
|
23
|
+
RESTRICT_ON_SEND = %i[add_column column boolean].freeze
|
24
|
+
|
25
|
+
def_node_matcher :three_state_boolean?, <<~PATTERN
|
26
|
+
{
|
27
|
+
(send nil? :add_column _ $_ {(sym :boolean) (str "boolean")} $_ ?)
|
28
|
+
(send !nil? :column $_ {(sym :boolean) (str "boolean")} $_ ?)
|
29
|
+
(send !nil? :boolean $_ $_ ?)
|
30
|
+
}
|
31
|
+
PATTERN
|
32
|
+
|
33
|
+
def_node_matcher :required_options?, <<~PATTERN
|
34
|
+
(hash <(pair (sym :default) !nil?) (pair (sym :null) false) ...>)
|
35
|
+
PATTERN
|
36
|
+
|
37
|
+
def_node_search :change_column_null?, <<~PATTERN
|
38
|
+
(send nil? :change_column_null {(sym %1) (str %1)} {(sym %2) (str %2)} false)
|
39
|
+
PATTERN
|
40
|
+
|
41
|
+
def on_send(node)
|
42
|
+
three_state_boolean?(node) do |column_node, options_node|
|
43
|
+
options_node = options_node.first
|
44
|
+
|
45
|
+
return if required_options?(options_node)
|
46
|
+
|
47
|
+
def_node = node.each_ancestor(:def, :defs).first
|
48
|
+
table_node = table_node(node)
|
49
|
+
return if def_node && change_column_null?(def_node, table_node.value, column_node.value)
|
50
|
+
|
51
|
+
add_offense(node)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def table_node(node)
|
58
|
+
case node.method_name
|
59
|
+
when :add_column
|
60
|
+
node.first_argument
|
61
|
+
when :column, :boolean
|
62
|
+
ancestor = node.each_ancestor(:block).find do |n|
|
63
|
+
n.method?(:create_table) || n.method?(:change_table)
|
64
|
+
end
|
65
|
+
ancestor&.send_node&.first_argument
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -70,7 +70,7 @@ module RuboCop
|
|
70
70
|
|
71
71
|
def autocorrect(corrector, node)
|
72
72
|
# add `.zone`: `Time.at` => `Time.zone.at`
|
73
|
-
corrector.insert_after(node.children[0]
|
73
|
+
corrector.insert_after(node.children[0], '.zone')
|
74
74
|
|
75
75
|
case node.method_name
|
76
76
|
when :current
|
@@ -81,7 +81,7 @@ module RuboCop
|
|
81
81
|
end
|
82
82
|
|
83
83
|
# prefer `Time` over `DateTime` class
|
84
|
-
corrector.replace(node.children.first
|
84
|
+
corrector.replace(node.children.first, 'Time') if strict?
|
85
85
|
remove_redundant_in_time_zone(corrector, node)
|
86
86
|
end
|
87
87
|
|
@@ -45,8 +45,6 @@ module RuboCop
|
|
45
45
|
# # Commit
|
46
46
|
# next if user.active?
|
47
47
|
# end
|
48
|
-
#
|
49
|
-
# @see https://github.com/rails/rails/commit/15aa4200e083
|
50
48
|
class TransactionExitStatement < Base
|
51
49
|
MSG = <<~MSG.chomp
|
52
50
|
Exit statement `%<statement>s` is not allowed. Use `raise` (rollback) or `next` (commit).
|
@@ -4,7 +4,7 @@ module RuboCop
|
|
4
4
|
module Cop
|
5
5
|
module Rails
|
6
6
|
# When you define a uniqueness validation in Active Record model,
|
7
|
-
# you also should add a unique index for the column. There are two reasons
|
7
|
+
# you also should add a unique index for the column. There are two reasons.
|
8
8
|
# First, duplicated records may occur even if Active Record's validation
|
9
9
|
# is defined.
|
10
10
|
# Second, it will cause slow queries. The validation executes a `SELECT`
|
@@ -28,12 +28,16 @@ module RuboCop
|
|
28
28
|
(send self :ignored_columns= $array)
|
29
29
|
PATTERN
|
30
30
|
|
31
|
+
def_node_matcher :appended_ignored_columns, <<~PATTERN
|
32
|
+
(op-asgn (send self :ignored_columns) :+ $array)
|
33
|
+
PATTERN
|
34
|
+
|
31
35
|
def_node_matcher :column_name, <<~PATTERN
|
32
36
|
({str sym} $_)
|
33
37
|
PATTERN
|
34
38
|
|
35
39
|
def on_send(node)
|
36
|
-
return unless (columns = ignored_columns(node))
|
40
|
+
return unless (columns = ignored_columns(node) || appended_ignored_columns(node))
|
37
41
|
return unless schema
|
38
42
|
|
39
43
|
table = table(node)
|
@@ -43,6 +47,7 @@ module RuboCop
|
|
43
47
|
check_column_existence(column_node, table)
|
44
48
|
end
|
45
49
|
end
|
50
|
+
alias on_op_asgn on_send
|
46
51
|
|
47
52
|
private
|
48
53
|
|
@@ -102,7 +102,7 @@ module RuboCop
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def correct_validate_type_for_hash(corrector, node, arguments)
|
105
|
-
corrector.replace(arguments
|
105
|
+
corrector.replace(arguments, "#{validate_type(node)}: #{braced_options(arguments)}")
|
106
106
|
end
|
107
107
|
|
108
108
|
def correct_validate_type_for_array(corrector, node, arguments, loc)
|
@@ -65,7 +65,7 @@ module RuboCop
|
|
65
65
|
private
|
66
66
|
|
67
67
|
def offense_range(node)
|
68
|
-
range_between(node.loc.selector.begin_pos, node.
|
68
|
+
range_between(node.loc.selector.begin_pos, node.source_range.end_pos)
|
69
69
|
end
|
70
70
|
|
71
71
|
def extract_column_and_value(template_node, value_node)
|
@@ -105,7 +105,7 @@ module RuboCop
|
|
105
105
|
if exists_style?
|
106
106
|
node.receiver.loc.selector.join(node.loc.selector)
|
107
107
|
elsif where_style?
|
108
|
-
node.loc.selector.with(end_pos: node.
|
108
|
+
node.loc.selector.with(end_pos: node.source_range.end_pos)
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
@@ -43,7 +43,7 @@ module RuboCop
|
|
43
43
|
next unless root_receiver == root_receiver(where_node)
|
44
44
|
next unless same_relationship?(where_argument, node.first_argument)
|
45
45
|
|
46
|
-
range = range_between(node.loc.selector.begin_pos, node.
|
46
|
+
range = range_between(node.loc.selector.begin_pos, node.source_range.end_pos)
|
47
47
|
register_offense(node, where_node, where_argument, range)
|
48
48
|
break
|
49
49
|
end
|
@@ -83,9 +83,9 @@ module RuboCop
|
|
83
83
|
|
84
84
|
def replace_range(child)
|
85
85
|
if (right_sibling = child.right_sibling)
|
86
|
-
range_between(child.
|
86
|
+
range_between(child.source_range.begin_pos, right_sibling.source_range.begin_pos)
|
87
87
|
else
|
88
|
-
range_between(child.left_sibling.
|
88
|
+
range_between(child.left_sibling.source_range.end_pos, child.source_range.end_pos)
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
@@ -64,7 +64,7 @@ module RuboCop
|
|
64
64
|
private
|
65
65
|
|
66
66
|
def offense_range(node)
|
67
|
-
range_between(node.loc.selector.begin_pos, node.
|
67
|
+
range_between(node.loc.selector.begin_pos, node.source_range.end_pos)
|
68
68
|
end
|
69
69
|
|
70
70
|
def extract_column_and_value(template_node, value_node)
|
@@ -32,10 +32,10 @@ module RuboCop
|
|
32
32
|
|
33
33
|
def on_send(node)
|
34
34
|
where_not_call?(node) do |args|
|
35
|
-
next unless args[0]
|
35
|
+
next unless args[0]&.hash_type?
|
36
36
|
next unless multiple_arguments_hash? args[0]
|
37
37
|
|
38
|
-
range = node.receiver.loc.selector.with(end_pos: node.
|
38
|
+
range = node.receiver.loc.selector.with(end_pos: node.source_range.end_pos)
|
39
39
|
|
40
40
|
add_offense(range)
|
41
41
|
end
|
@@ -99,6 +99,7 @@ require_relative 'rails/render_inline'
|
|
99
99
|
require_relative 'rails/render_plain_text'
|
100
100
|
require_relative 'rails/request_referer'
|
101
101
|
require_relative 'rails/require_dependency'
|
102
|
+
require_relative 'rails/response_parsed_body'
|
102
103
|
require_relative 'rails/reversible_migration'
|
103
104
|
require_relative 'rails/reversible_migration_method_definition'
|
104
105
|
require_relative 'rails/root_join_chain'
|
@@ -114,6 +115,7 @@ require_relative 'rails/skips_model_validations'
|
|
114
115
|
require_relative 'rails/squished_sql_heredocs'
|
115
116
|
require_relative 'rails/strip_heredoc'
|
116
117
|
require_relative 'rails/table_name_assignment'
|
118
|
+
require_relative 'rails/three_state_boolean_column'
|
117
119
|
require_relative 'rails/time_zone'
|
118
120
|
require_relative 'rails/time_zone_assignment'
|
119
121
|
require_relative 'rails/to_formatted_s'
|
data/lib/rubocop/rails.rb
CHANGED
@@ -5,7 +5,7 @@ module RuboCop
|
|
5
5
|
module Rails
|
6
6
|
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
7
7
|
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
8
|
-
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
8
|
+
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read, permitted_classes: [Regexp, Symbol]).freeze
|
9
9
|
|
10
10
|
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
11
11
|
|
data/lib/rubocop-rails.rb
CHANGED
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.
|
4
|
+
version: 2.19.0
|
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:
|
13
|
+
date: 2023-04-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -173,6 +173,7 @@ files:
|
|
173
173
|
- lib/rubocop/cop/rails/render_plain_text.rb
|
174
174
|
- lib/rubocop/cop/rails/request_referer.rb
|
175
175
|
- lib/rubocop/cop/rails/require_dependency.rb
|
176
|
+
- lib/rubocop/cop/rails/response_parsed_body.rb
|
176
177
|
- lib/rubocop/cop/rails/reversible_migration.rb
|
177
178
|
- lib/rubocop/cop/rails/reversible_migration_method_definition.rb
|
178
179
|
- lib/rubocop/cop/rails/root_join_chain.rb
|
@@ -188,6 +189,7 @@ files:
|
|
188
189
|
- lib/rubocop/cop/rails/squished_sql_heredocs.rb
|
189
190
|
- lib/rubocop/cop/rails/strip_heredoc.rb
|
190
191
|
- lib/rubocop/cop/rails/table_name_assignment.rb
|
192
|
+
- lib/rubocop/cop/rails/three_state_boolean_column.rb
|
191
193
|
- lib/rubocop/cop/rails/time_zone.rb
|
192
194
|
- lib/rubocop/cop/rails/time_zone_assignment.rb
|
193
195
|
- lib/rubocop/cop/rails/to_formatted_s.rb
|
@@ -217,7 +219,7 @@ metadata:
|
|
217
219
|
homepage_uri: https://docs.rubocop.org/rubocop-rails/
|
218
220
|
changelog_uri: https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md
|
219
221
|
source_code_uri: https://github.com/rubocop/rubocop-rails/
|
220
|
-
documentation_uri: https://docs.rubocop.org/rubocop-rails/2.
|
222
|
+
documentation_uri: https://docs.rubocop.org/rubocop-rails/2.19/
|
221
223
|
bug_tracker_uri: https://github.com/rubocop/rubocop-rails/issues
|
222
224
|
rubygems_mfa_required: 'true'
|
223
225
|
post_install_message:
|
@@ -235,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
237
|
- !ruby/object:Gem::Version
|
236
238
|
version: '0'
|
237
239
|
requirements: []
|
238
|
-
rubygems_version: 3.
|
240
|
+
rubygems_version: 3.5.0.dev
|
239
241
|
signing_key:
|
240
242
|
specification_version: 4
|
241
243
|
summary: Automatic Rails code style checking tool.
|