rubocop-rails 2.9.0 → 2.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +4 -4
- data/config/default.yml +111 -5
- data/config/obsoletion.yml +7 -0
- data/lib/rubocop/cop/mixin/active_record_helper.rb +11 -0
- data/lib/rubocop/cop/rails/add_column_index.rb +64 -0
- data/lib/rubocop/cop/rails/attribute_default_block_value.rb +1 -1
- data/lib/rubocop/cop/rails/belongs_to.rb +1 -1
- data/lib/rubocop/cop/rails/blank.rb +4 -0
- data/lib/rubocop/cop/rails/content_tag.rb +18 -3
- data/lib/rubocop/cop/rails/date.rb +17 -6
- data/lib/rubocop/cop/rails/dynamic_find_by.rb +4 -2
- data/lib/rubocop/cop/rails/eager_evaluation_log_message.rb +78 -0
- data/lib/rubocop/cop/rails/environment_comparison.rb +1 -2
- data/lib/rubocop/cop/rails/environment_variable_access.rb +67 -0
- data/lib/rubocop/cop/rails/expanded_date_range.rb +86 -0
- data/lib/rubocop/cop/rails/file_path.rb +2 -4
- data/lib/rubocop/cop/rails/find_by.rb +26 -11
- data/lib/rubocop/cop/rails/find_each.rb +6 -7
- data/lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb +34 -4
- data/lib/rubocop/cop/rails/helper_instance_variable.rb +27 -1
- data/lib/rubocop/cop/rails/http_positional_arguments.rb +8 -1
- data/lib/rubocop/cop/rails/http_status.rb +12 -3
- data/lib/rubocop/cop/rails/i18n_locale_assignment.rb +37 -0
- data/lib/rubocop/cop/rails/inverse_of.rb +1 -2
- data/lib/rubocop/cop/rails/link_to_blank.rb +5 -1
- data/lib/rubocop/cop/rails/reflection_class_name.rb +14 -1
- data/lib/rubocop/cop/rails/relative_date_constant.rb +18 -19
- data/lib/rubocop/cop/rails/require_dependency.rb +38 -0
- data/lib/rubocop/cop/rails/reversible_migration.rb +1 -1
- data/lib/rubocop/cop/rails/reversible_migration_method_definition.rb +75 -0
- data/lib/rubocop/cop/rails/safe_navigation.rb +20 -2
- data/lib/rubocop/cop/rails/time_zone.rb +22 -22
- data/lib/rubocop/cop/rails/time_zone_assignment.rb +37 -0
- data/lib/rubocop/cop/rails/unknown_env.rb +1 -1
- data/lib/rubocop/cop/rails/unused_ignored_columns.rb +69 -0
- data/lib/rubocop/cop/rails/where_equals.rb +6 -2
- data/lib/rubocop/cop/rails/where_exists.rb +11 -0
- data/lib/rubocop/cop/rails/where_not.rb +5 -1
- data/lib/rubocop/cop/rails_cops.rb +9 -0
- data/lib/rubocop/rails.rb +2 -0
- data/lib/rubocop/rails/schema_loader/schema.rb +2 -4
- data/lib/rubocop/rails/version.rb +1 -1
- metadata +21 -11
@@ -44,9 +44,22 @@ module RuboCop
|
|
44
44
|
RESTRICT_ON_SEND = %i[try try!].freeze
|
45
45
|
|
46
46
|
def_node_matcher :try_call, <<~PATTERN
|
47
|
-
(send
|
47
|
+
(send _ ${:try :try!} $_ ...)
|
48
48
|
PATTERN
|
49
49
|
|
50
|
+
# Monkey patching for `Style/RedundantSelf` of RuboCop core.
|
51
|
+
# rubocop:disable Style/ClassAndModuleChildren
|
52
|
+
class Style::RedundantSelf
|
53
|
+
def self.autocorrect_incompatible_with
|
54
|
+
[Rails::SafeNavigation]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
# rubocop:enable Style/ClassAndModuleChildren
|
58
|
+
|
59
|
+
def self.autocorrect_incompatible_with
|
60
|
+
[Style::RedundantSelf]
|
61
|
+
end
|
62
|
+
|
50
63
|
def on_send(node)
|
51
64
|
try_call(node) do |try_method, dispatch|
|
52
65
|
return if try_method == :try && !cop_config['ConvertTry']
|
@@ -64,7 +77,12 @@ module RuboCop
|
|
64
77
|
method_node, *params = *node.arguments
|
65
78
|
method = method_node.source[1..-1]
|
66
79
|
|
67
|
-
range =
|
80
|
+
range = if node.receiver
|
81
|
+
range_between(node.loc.dot.begin_pos, node.loc.expression.end_pos)
|
82
|
+
else
|
83
|
+
corrector.insert_before(node, 'self')
|
84
|
+
node
|
85
|
+
end
|
68
86
|
|
69
87
|
corrector.replace(range, replacement(method, params))
|
70
88
|
end
|
@@ -8,40 +8,33 @@ module RuboCop
|
|
8
8
|
# Built on top of Ruby on Rails style guide (https://rails.rubystyle.guide#time)
|
9
9
|
# and the article http://danilenko.org/2012/7/6/rails_timezones/
|
10
10
|
#
|
11
|
-
# Two styles are supported for this cop. When EnforcedStyle is 'strict'
|
12
|
-
# then only use of Time.zone is allowed.
|
11
|
+
# Two styles are supported for this cop. When `EnforcedStyle` is 'strict'
|
12
|
+
# then only use of `Time.zone` is allowed.
|
13
13
|
#
|
14
14
|
# When EnforcedStyle is 'flexible' then it's also allowed
|
15
|
-
# to use Time
|
16
|
-
#
|
17
|
-
# @example EnforcedStyle: strict
|
18
|
-
# # `strict` means that `Time` should be used with `zone`.
|
15
|
+
# to use `Time#in_time_zone`.
|
19
16
|
#
|
17
|
+
# @example
|
20
18
|
# # bad
|
21
19
|
# Time.now
|
22
|
-
# Time.parse('2015-03-
|
23
|
-
#
|
24
|
-
# # bad
|
25
|
-
# Time.current
|
26
|
-
# Time.at(timestamp).in_time_zone
|
20
|
+
# Time.parse('2015-03-02T19:05:37')
|
27
21
|
#
|
28
22
|
# # good
|
23
|
+
# Time.current
|
29
24
|
# Time.zone.now
|
30
|
-
# Time.zone.parse('2015-03-
|
25
|
+
# Time.zone.parse('2015-03-02T19:05:37')
|
26
|
+
# Time.zone.parse('2015-03-02T19:05:37Z') # Respect ISO 8601 format with timezone specifier.
|
31
27
|
#
|
32
|
-
# @example EnforcedStyle:
|
33
|
-
# # `
|
28
|
+
# @example EnforcedStyle: strict
|
29
|
+
# # `strict` means that `Time` should be used with `zone`.
|
34
30
|
#
|
35
31
|
# # bad
|
36
|
-
# Time.
|
37
|
-
# Time.parse('2015-03-02 19:05:37')
|
32
|
+
# Time.at(timestamp).in_time_zone
|
38
33
|
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
# Time.zone.parse('2015-03-02 19:05:37')
|
34
|
+
# @example EnforcedStyle: flexible (default)
|
35
|
+
# # `flexible` allows usage of `in_time_zone` instead of `zone`.
|
42
36
|
#
|
43
37
|
# # good
|
44
|
-
# Time.current
|
45
38
|
# Time.at(timestamp).in_time_zone
|
46
39
|
class TimeZone < Base
|
47
40
|
include ConfigurableEnforcedStyle
|
@@ -58,11 +51,13 @@ module RuboCop
|
|
58
51
|
|
59
52
|
GOOD_METHODS = %i[zone zone_default find_zone find_zone!].freeze
|
60
53
|
|
61
|
-
DANGEROUS_METHODS = %i[now local new parse at
|
54
|
+
DANGEROUS_METHODS = %i[now local new parse at].freeze
|
62
55
|
|
63
56
|
ACCEPTED_METHODS = %i[in_time_zone utc getlocal xmlschema iso8601
|
64
57
|
jisx0301 rfc3339 httpdate to_i to_f].freeze
|
65
58
|
|
59
|
+
TIMEZONE_SPECIFIER = /[A-z]/.freeze
|
60
|
+
|
66
61
|
def on_const(node)
|
67
62
|
mod, klass = *node
|
68
63
|
# we should only check core classes
|
@@ -116,9 +111,10 @@ module RuboCop
|
|
116
111
|
end
|
117
112
|
|
118
113
|
def check_time_node(klass, node)
|
114
|
+
return if attach_timezone_specifier?(node.first_argument)
|
115
|
+
|
119
116
|
chain = extract_method_chain(node)
|
120
117
|
return if not_danger_chain?(chain)
|
121
|
-
|
122
118
|
return check_localtime(node) if need_check_localtime?(chain)
|
123
119
|
|
124
120
|
method_name = (chain & DANGEROUS_METHODS).join('.')
|
@@ -132,6 +128,10 @@ module RuboCop
|
|
132
128
|
end
|
133
129
|
end
|
134
130
|
|
131
|
+
def attach_timezone_specifier?(date)
|
132
|
+
date.respond_to?(:value) && TIMEZONE_SPECIFIER.match?(date.value.to_s[-1])
|
133
|
+
end
|
134
|
+
|
135
135
|
def build_message(klass, method_name, node)
|
136
136
|
if flexible?
|
137
137
|
format(
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Rails
|
6
|
+
# This cop checks for the use of `Time.zone=` method.
|
7
|
+
#
|
8
|
+
# The `zone` attribute persists for the rest of the Ruby runtime, potentially causing
|
9
|
+
# unexpected behavior at a later time.
|
10
|
+
# Using `Time.use_zone` ensures the code passed in the block is the only place Time.zone is affected.
|
11
|
+
# It eliminates the possibility of a `zone` sticking around longer than intended.
|
12
|
+
#
|
13
|
+
# @example
|
14
|
+
# # bad
|
15
|
+
# Time.zone = 'EST'
|
16
|
+
#
|
17
|
+
# # good
|
18
|
+
# Time.use_zone('EST') do
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
class TimeZoneAssignment < Base
|
22
|
+
MSG = 'Use `Time.use_zone` with block instead of `Time.zone=`.'
|
23
|
+
RESTRICT_ON_SEND = %i[zone=].freeze
|
24
|
+
|
25
|
+
def_node_matcher :time_zone_assignement?, <<~PATTERN
|
26
|
+
(send (const nil? :Time) :zone= ...)
|
27
|
+
PATTERN
|
28
|
+
|
29
|
+
def on_send(node)
|
30
|
+
return unless time_zone_assignement?(node)
|
31
|
+
|
32
|
+
add_offense(node)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -62,7 +62,7 @@ module RuboCop
|
|
62
62
|
# DidYouMean::SpellChecker is not available in all versions of Ruby,
|
63
63
|
# and even on versions where it *is* available (>= 2.3), it is not
|
64
64
|
# always required correctly. So we do a feature check first. See:
|
65
|
-
# https://github.com/rubocop
|
65
|
+
# https://github.com/rubocop/rubocop/issues/7979
|
66
66
|
similar_names = if defined?(DidYouMean::SpellChecker)
|
67
67
|
spell_checker = DidYouMean::SpellChecker.new(dictionary: environments)
|
68
68
|
spell_checker.correct(name)
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Rails
|
6
|
+
# This cop suggests you remove a column that does not exist in the schema from `ignored_columns`.
|
7
|
+
# `ignored_columns` is necessary to drop a column from RDBMS, but you don't need it after the migration
|
8
|
+
# to drop the column. You avoid forgetting to remove `ignored_columns` by this cop.
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# # bad
|
12
|
+
# class User < ApplicationRecord
|
13
|
+
# self.ignored_columns = [:already_removed_column]
|
14
|
+
# end
|
15
|
+
#
|
16
|
+
# # good
|
17
|
+
# class User < ApplicationRecord
|
18
|
+
# self.ignored_columns = [:still_existing_column]
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
class UnusedIgnoredColumns < Base
|
22
|
+
include ActiveRecordHelper
|
23
|
+
|
24
|
+
MSG = 'Remove `%<column_name>s` from `ignored_columns` because the column does not exist.'
|
25
|
+
RESTRICT_ON_SEND = %i[ignored_columns=].freeze
|
26
|
+
|
27
|
+
def_node_matcher :ignored_columns, <<~PATTERN
|
28
|
+
(send self :ignored_columns= $array)
|
29
|
+
PATTERN
|
30
|
+
|
31
|
+
def_node_matcher :column_name, <<~PATTERN
|
32
|
+
({str sym} $_)
|
33
|
+
PATTERN
|
34
|
+
|
35
|
+
def on_send(node)
|
36
|
+
return unless (columns = ignored_columns(node))
|
37
|
+
return unless schema
|
38
|
+
|
39
|
+
table = table(node)
|
40
|
+
return unless table
|
41
|
+
|
42
|
+
columns.children.each do |column_node|
|
43
|
+
check_column_existence(column_node, table)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def check_column_existence(column_node, table)
|
50
|
+
column_name = column_name(column_node)
|
51
|
+
return unless column_name
|
52
|
+
return if table.with_column?(name: column_name.to_s)
|
53
|
+
|
54
|
+
message = format(MSG, column_name: column_name)
|
55
|
+
add_offense(column_node, message: message)
|
56
|
+
end
|
57
|
+
|
58
|
+
def class_node(node)
|
59
|
+
node.each_ancestor.find(&:class_type?)
|
60
|
+
end
|
61
|
+
|
62
|
+
def table(node)
|
63
|
+
klass = class_node(node)
|
64
|
+
schema.table_by(name: table_name(klass))
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -13,11 +13,13 @@ module RuboCop
|
|
13
13
|
# User.where('name IS NULL')
|
14
14
|
# User.where('name IN (?)', ['john', 'jane'])
|
15
15
|
# User.where('name IN (:names)', names: ['john', 'jane'])
|
16
|
+
# User.where('users.name = :name', name: 'Gabe')
|
16
17
|
#
|
17
18
|
# # good
|
18
19
|
# User.where(name: 'Gabe')
|
19
20
|
# User.where(name: nil)
|
20
21
|
# User.where(name: ['john', 'jane'])
|
22
|
+
# User.where(users: { name: 'Gabe' })
|
21
23
|
class WhereEquals < Base
|
22
24
|
include RangeHelp
|
23
25
|
extend AutoCorrector
|
@@ -68,7 +70,7 @@ module RuboCop
|
|
68
70
|
when EQ_ANONYMOUS_RE, IN_ANONYMOUS_RE
|
69
71
|
value_node.source
|
70
72
|
when EQ_NAMED_RE, IN_NAMED_RE
|
71
|
-
return unless value_node
|
73
|
+
return unless value_node&.hash_type?
|
72
74
|
|
73
75
|
pair = value_node.pairs.find { |p| p.key.value.to_sym == Regexp.last_match(2).to_sym }
|
74
76
|
pair.value.source
|
@@ -83,7 +85,9 @@ module RuboCop
|
|
83
85
|
|
84
86
|
def build_good_method(column, value)
|
85
87
|
if column.include?('.')
|
86
|
-
|
88
|
+
table, column = column.split('.')
|
89
|
+
|
90
|
+
"where(#{table}: { #{column}: #{value} })"
|
87
91
|
else
|
88
92
|
"where(#{column}: #{value})"
|
89
93
|
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?
|
@@ -15,11 +15,13 @@ 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
26
|
class WhereNot < Base
|
25
27
|
include RangeHelp
|
@@ -86,7 +88,9 @@ module RuboCop
|
|
86
88
|
|
87
89
|
def build_good_method(column, value)
|
88
90
|
if column.include?('.')
|
89
|
-
|
91
|
+
table, column = column.split('.')
|
92
|
+
|
93
|
+
"where.not(#{table}: { #{column}: #{value} })"
|
90
94
|
else
|
91
95
|
"where.not(#{column}: #{value})"
|
92
96
|
end
|
@@ -10,6 +10,7 @@ require_relative 'rails/active_record_aliases'
|
|
10
10
|
require_relative 'rails/active_record_callbacks_order'
|
11
11
|
require_relative 'rails/active_record_override'
|
12
12
|
require_relative 'rails/active_support_aliases'
|
13
|
+
require_relative 'rails/add_column_index'
|
13
14
|
require_relative 'rails/after_commit_override'
|
14
15
|
require_relative 'rails/application_controller'
|
15
16
|
require_relative 'rails/application_job'
|
@@ -28,10 +29,13 @@ require_relative 'rails/default_scope'
|
|
28
29
|
require_relative 'rails/delegate'
|
29
30
|
require_relative 'rails/delegate_allow_blank'
|
30
31
|
require_relative 'rails/dynamic_find_by'
|
32
|
+
require_relative 'rails/eager_evaluation_log_message'
|
31
33
|
require_relative 'rails/enum_hash'
|
32
34
|
require_relative 'rails/enum_uniqueness'
|
33
35
|
require_relative 'rails/environment_comparison'
|
36
|
+
require_relative 'rails/environment_variable_access'
|
34
37
|
require_relative 'rails/exit'
|
38
|
+
require_relative 'rails/expanded_date_range'
|
35
39
|
require_relative 'rails/file_path'
|
36
40
|
require_relative 'rails/find_by'
|
37
41
|
require_relative 'rails/find_by_id'
|
@@ -41,6 +45,7 @@ require_relative 'rails/has_many_or_has_one_dependent'
|
|
41
45
|
require_relative 'rails/helper_instance_variable'
|
42
46
|
require_relative 'rails/http_positional_arguments'
|
43
47
|
require_relative 'rails/http_status'
|
48
|
+
require_relative 'rails/i18n_locale_assignment'
|
44
49
|
require_relative 'rails/ignored_skip_action_filter_option'
|
45
50
|
require_relative 'rails/index_by'
|
46
51
|
require_relative 'rails/index_with'
|
@@ -73,7 +78,9 @@ require_relative 'rails/relative_date_constant'
|
|
73
78
|
require_relative 'rails/render_inline'
|
74
79
|
require_relative 'rails/render_plain_text'
|
75
80
|
require_relative 'rails/request_referer'
|
81
|
+
require_relative 'rails/require_dependency'
|
76
82
|
require_relative 'rails/reversible_migration'
|
83
|
+
require_relative 'rails/reversible_migration_method_definition'
|
77
84
|
require_relative 'rails/safe_navigation'
|
78
85
|
require_relative 'rails/safe_navigation_with_blank'
|
79
86
|
require_relative 'rails/save_bang'
|
@@ -82,9 +89,11 @@ require_relative 'rails/short_i18n'
|
|
82
89
|
require_relative 'rails/skips_model_validations'
|
83
90
|
require_relative 'rails/squished_sql_heredocs'
|
84
91
|
require_relative 'rails/time_zone'
|
92
|
+
require_relative 'rails/time_zone_assignment'
|
85
93
|
require_relative 'rails/uniq_before_pluck'
|
86
94
|
require_relative 'rails/unique_validation_without_index'
|
87
95
|
require_relative 'rails/unknown_env'
|
96
|
+
require_relative 'rails/unused_ignored_columns'
|
88
97
|
require_relative 'rails/validation'
|
89
98
|
require_relative 'rails/where_equals'
|
90
99
|
require_relative 'rails/where_exists'
|
data/lib/rubocop/rails.rb
CHANGED
@@ -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.
|
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
|
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.11.1
|
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: 2021-06-25 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:
|
49
|
+
version: 1.7.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:
|
59
|
+
version: 1.7.0
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '2.0'
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- README.md
|
75
75
|
- bin/setup
|
76
76
|
- config/default.yml
|
77
|
+
- config/obsoletion.yml
|
77
78
|
- lib/rubocop-rails.rb
|
78
79
|
- lib/rubocop/cop/mixin/active_record_helper.rb
|
79
80
|
- lib/rubocop/cop/mixin/enforce_superclass.rb
|
@@ -84,6 +85,7 @@ files:
|
|
84
85
|
- lib/rubocop/cop/rails/active_record_callbacks_order.rb
|
85
86
|
- lib/rubocop/cop/rails/active_record_override.rb
|
86
87
|
- lib/rubocop/cop/rails/active_support_aliases.rb
|
88
|
+
- lib/rubocop/cop/rails/add_column_index.rb
|
87
89
|
- lib/rubocop/cop/rails/after_commit_override.rb
|
88
90
|
- lib/rubocop/cop/rails/application_controller.rb
|
89
91
|
- lib/rubocop/cop/rails/application_job.rb
|
@@ -102,10 +104,13 @@ files:
|
|
102
104
|
- lib/rubocop/cop/rails/delegate.rb
|
103
105
|
- lib/rubocop/cop/rails/delegate_allow_blank.rb
|
104
106
|
- lib/rubocop/cop/rails/dynamic_find_by.rb
|
107
|
+
- lib/rubocop/cop/rails/eager_evaluation_log_message.rb
|
105
108
|
- lib/rubocop/cop/rails/enum_hash.rb
|
106
109
|
- lib/rubocop/cop/rails/enum_uniqueness.rb
|
107
110
|
- lib/rubocop/cop/rails/environment_comparison.rb
|
111
|
+
- lib/rubocop/cop/rails/environment_variable_access.rb
|
108
112
|
- lib/rubocop/cop/rails/exit.rb
|
113
|
+
- lib/rubocop/cop/rails/expanded_date_range.rb
|
109
114
|
- lib/rubocop/cop/rails/file_path.rb
|
110
115
|
- lib/rubocop/cop/rails/find_by.rb
|
111
116
|
- lib/rubocop/cop/rails/find_by_id.rb
|
@@ -115,6 +120,7 @@ files:
|
|
115
120
|
- lib/rubocop/cop/rails/helper_instance_variable.rb
|
116
121
|
- lib/rubocop/cop/rails/http_positional_arguments.rb
|
117
122
|
- lib/rubocop/cop/rails/http_status.rb
|
123
|
+
- lib/rubocop/cop/rails/i18n_locale_assignment.rb
|
118
124
|
- lib/rubocop/cop/rails/ignored_skip_action_filter_option.rb
|
119
125
|
- lib/rubocop/cop/rails/index_by.rb
|
120
126
|
- lib/rubocop/cop/rails/index_with.rb
|
@@ -147,7 +153,9 @@ files:
|
|
147
153
|
- lib/rubocop/cop/rails/render_inline.rb
|
148
154
|
- lib/rubocop/cop/rails/render_plain_text.rb
|
149
155
|
- lib/rubocop/cop/rails/request_referer.rb
|
156
|
+
- lib/rubocop/cop/rails/require_dependency.rb
|
150
157
|
- lib/rubocop/cop/rails/reversible_migration.rb
|
158
|
+
- lib/rubocop/cop/rails/reversible_migration_method_definition.rb
|
151
159
|
- lib/rubocop/cop/rails/safe_navigation.rb
|
152
160
|
- lib/rubocop/cop/rails/safe_navigation_with_blank.rb
|
153
161
|
- lib/rubocop/cop/rails/save_bang.rb
|
@@ -156,9 +164,11 @@ files:
|
|
156
164
|
- lib/rubocop/cop/rails/skips_model_validations.rb
|
157
165
|
- lib/rubocop/cop/rails/squished_sql_heredocs.rb
|
158
166
|
- lib/rubocop/cop/rails/time_zone.rb
|
167
|
+
- lib/rubocop/cop/rails/time_zone_assignment.rb
|
159
168
|
- lib/rubocop/cop/rails/uniq_before_pluck.rb
|
160
169
|
- lib/rubocop/cop/rails/unique_validation_without_index.rb
|
161
170
|
- lib/rubocop/cop/rails/unknown_env.rb
|
171
|
+
- lib/rubocop/cop/rails/unused_ignored_columns.rb
|
162
172
|
- lib/rubocop/cop/rails/validation.rb
|
163
173
|
- lib/rubocop/cop/rails/where_equals.rb
|
164
174
|
- lib/rubocop/cop/rails/where_exists.rb
|
@@ -169,15 +179,15 @@ files:
|
|
169
179
|
- lib/rubocop/rails/schema_loader.rb
|
170
180
|
- lib/rubocop/rails/schema_loader/schema.rb
|
171
181
|
- lib/rubocop/rails/version.rb
|
172
|
-
homepage: https://github.com/rubocop
|
182
|
+
homepage: https://github.com/rubocop/rubocop-rails
|
173
183
|
licenses:
|
174
184
|
- MIT
|
175
185
|
metadata:
|
176
186
|
homepage_uri: https://docs.rubocop.org/rubocop-rails/
|
177
|
-
changelog_uri: https://github.com/rubocop
|
178
|
-
source_code_uri: https://github.com/rubocop
|
179
|
-
documentation_uri: https://docs.rubocop.org/rubocop-rails/2.
|
180
|
-
bug_tracker_uri: https://github.com/rubocop
|
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
|
181
191
|
post_install_message:
|
182
192
|
rdoc_options: []
|
183
193
|
require_paths:
|
@@ -186,14 +196,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
196
|
requirements:
|
187
197
|
- - ">="
|
188
198
|
- !ruby/object:Gem::Version
|
189
|
-
version: 2.
|
199
|
+
version: 2.5.0
|
190
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
201
|
requirements:
|
192
202
|
- - ">="
|
193
203
|
- !ruby/object:Gem::Version
|
194
204
|
version: '0'
|
195
205
|
requirements: []
|
196
|
-
rubygems_version: 3.2.
|
206
|
+
rubygems_version: 3.2.18
|
197
207
|
signing_key:
|
198
208
|
specification_version: 4
|
199
209
|
summary: Automatic Rails code style checking tool.
|