gitlab-styles 3.4.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +18 -0
- data/.gitignore +3 -0
- data/.gitlab/merge_request_templates/Release.md +1 -1
- data/Gemfile +3 -2
- data/README.md +1 -0
- data/gitlab-styles.gemspec +5 -4
- data/lib/gitlab/styles/rubocop.rb +4 -0
- data/lib/gitlab/styles/rubocop/cop/code_reuse/active_record.rb +131 -0
- data/lib/gitlab/styles/rubocop/cop/migration/update_large_table.rb +64 -0
- data/lib/gitlab/styles/rubocop/cop/rspec/base.rb +18 -0
- data/lib/gitlab/styles/rubocop/cop/rspec/empty_line_after_let_block.rb +65 -0
- data/lib/gitlab/styles/rubocop/cop/rspec/empty_line_after_shared_example.rb +65 -0
- data/lib/gitlab/styles/rubocop/cop/rspec/have_link_parameters.rb +10 -5
- data/lib/gitlab/styles/rubocop/cop/rspec/single_line_hook.rb +3 -2
- data/lib/gitlab/styles/rubocop/cop/rspec/verbose_include_metadata.rb +10 -13
- data/lib/gitlab/styles/rubocop/model_helpers.rb +1 -1
- data/lib/gitlab/styles/rubocop/rspec/helpers.rb +17 -0
- data/lib/gitlab/styles/version.rb +1 -1
- data/rubocop-all.yml +2 -1
- data/rubocop-bundler.yml +1 -0
- data/rubocop-code_reuse.yml +24 -0
- data/rubocop-default.yml +2 -0
- data/rubocop-gemspec.yml +1 -0
- data/rubocop-layout.yml +38 -22
- data/rubocop-lint.yml +81 -19
- data/rubocop-metrics.yml +1 -6
- data/rubocop-migrations.yml +22 -0
- data/rubocop-naming.yml +9 -8
- data/rubocop-performance.yml +48 -0
- data/rubocop-rails.yml +79 -0
- data/rubocop-rspec.yml +14 -0
- data/rubocop-security.yml +1 -0
- data/rubocop-style.yml +118 -14
- metadata +21 -12
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rubocop-rspec'
|
4
|
+
require_relative 'base'
|
4
5
|
|
5
6
|
module Gitlab
|
6
7
|
module Styles
|
@@ -17,7 +18,9 @@ module Gitlab
|
|
17
18
|
# # good
|
18
19
|
# expect(page).to have_link('Link', href: 'https://example.com')
|
19
20
|
# expect(page).to have_link('Example')
|
20
|
-
class HaveLinkParameters <
|
21
|
+
class HaveLinkParameters < Base
|
22
|
+
extend RuboCop::Cop::AutoCorrector
|
23
|
+
|
21
24
|
MESSAGE = "The second argument to `have_link` should be a Hash."
|
22
25
|
|
23
26
|
def_node_matcher :unused_parameters?, <<~PATTERN
|
@@ -29,11 +32,13 @@ module Gitlab
|
|
29
32
|
def on_send(node)
|
30
33
|
return unless unused_parameters?(node)
|
31
34
|
|
32
|
-
location = node.arguments[1
|
33
|
-
|
34
|
-
|
35
|
+
location = node.arguments[1..]
|
36
|
+
.map(&:source_range)
|
37
|
+
.reduce(:join)
|
35
38
|
|
36
|
-
add_offense(
|
39
|
+
add_offense(location, message: MESSAGE) do |corrector|
|
40
|
+
corrector.insert_after(location.end, "\n")
|
41
|
+
end
|
37
42
|
end
|
38
43
|
end
|
39
44
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rubocop-rspec'
|
4
|
+
require_relative 'base'
|
4
5
|
|
5
6
|
module Gitlab
|
6
7
|
module Styles
|
@@ -23,7 +24,7 @@ module Gitlab
|
|
23
24
|
# after(:each) do
|
24
25
|
# undo_something
|
25
26
|
# end
|
26
|
-
class SingleLineHook <
|
27
|
+
class SingleLineHook < Base
|
27
28
|
MESSAGE = "Don't use single-line hook blocks."
|
28
29
|
|
29
30
|
def_node_search :rspec_hook?, <<~PATTERN
|
@@ -34,7 +35,7 @@ module Gitlab
|
|
34
35
|
return unless node.single_line?
|
35
36
|
return unless rspec_hook?(node)
|
36
37
|
|
37
|
-
add_offense(node,
|
38
|
+
add_offense(node, message: MESSAGE)
|
38
39
|
end
|
39
40
|
end
|
40
41
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rubocop-rspec'
|
4
|
+
require_relative 'base'
|
4
5
|
|
5
6
|
module Gitlab
|
6
7
|
module Styles
|
@@ -17,7 +18,9 @@ module Gitlab
|
|
17
18
|
# # good
|
18
19
|
# describe MyClass, :js do
|
19
20
|
# end
|
20
|
-
class VerboseIncludeMetadata <
|
21
|
+
class VerboseIncludeMetadata < Base
|
22
|
+
extend RuboCop::Cop::AutoCorrector
|
23
|
+
|
21
24
|
MSG = 'Use `%s` instead of `%s`.'
|
22
25
|
|
23
26
|
SELECTORS = %i[describe context feature example_group it specify example scenario its].freeze
|
@@ -37,25 +40,19 @@ module Gitlab
|
|
37
40
|
|
38
41
|
def on_send(node)
|
39
42
|
invalid_metadata_matches(node) do |match|
|
40
|
-
add_offense(node,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
def autocorrect(node)
|
45
|
-
lambda do |corrector|
|
46
|
-
invalid_metadata_matches(node) do |match|
|
47
|
-
corrector.replace(match.loc.expression, good(match))
|
43
|
+
add_offense(node, message: format(MSG, good(match), bad(match))) do |corrector|
|
44
|
+
invalid_metadata_matches(node) do |match|
|
45
|
+
corrector.replace(match.loc.expression, good(match))
|
46
|
+
end
|
48
47
|
end
|
49
48
|
end
|
50
49
|
end
|
51
50
|
|
52
51
|
private
|
53
52
|
|
54
|
-
def invalid_metadata_matches(node)
|
53
|
+
def invalid_metadata_matches(node, &block)
|
55
54
|
include_metadata(node) do |matches|
|
56
|
-
matches.select(&method(:invalid_metadata?)).each
|
57
|
-
yield match
|
58
|
-
end
|
55
|
+
matches.select(&method(:invalid_metadata?)).each(&block)
|
59
56
|
end
|
60
57
|
end
|
61
58
|
|
@@ -7,7 +7,7 @@ module Gitlab
|
|
7
7
|
# Returns true if the given node originated from the models directory.
|
8
8
|
def in_model?(node)
|
9
9
|
path = node.location.expression.source_buffer.name
|
10
|
-
pwd =
|
10
|
+
pwd = Dir.pwd
|
11
11
|
models_path = File.join(pwd, 'app', 'models')
|
12
12
|
ee_models_path = File.join(pwd, 'ee', 'app', 'models')
|
13
13
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rubocop-rspec'
|
4
|
+
|
5
|
+
module Gitlab
|
6
|
+
module Styles
|
7
|
+
module Rubocop
|
8
|
+
module Rspec
|
9
|
+
module Helpers
|
10
|
+
include RuboCop::RSpec::Language
|
11
|
+
|
12
|
+
LET = SelectorSet.new(%i[let_it_be]) + Helpers::ALL
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/rubocop-all.yml
CHANGED
data/rubocop-bundler.yml
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Denies the use of ActiveRecord methods outside of configured
|
2
|
+
# excluded directories
|
3
|
+
# Directories that allow the use of the denied methods.
|
4
|
+
# To start we provide a default configuration that matches
|
5
|
+
# a standard Rails app and enable.
|
6
|
+
# The default configuration can be overridden by
|
7
|
+
# providing your own Exclusion list as follows:
|
8
|
+
# CodeReuse/ActiveRecord:
|
9
|
+
# Enabled: true
|
10
|
+
# Exclude:
|
11
|
+
# - app/models/**/*.rb
|
12
|
+
# - config/**/*.rb
|
13
|
+
# - db/**/*.rb
|
14
|
+
# - lib/tasks/**/*.rb
|
15
|
+
# - spec/**/*.rb
|
16
|
+
# - lib/gitlab/**/*.rb
|
17
|
+
CodeReuse/ActiveRecord:
|
18
|
+
Enabled: true
|
19
|
+
Exclude:
|
20
|
+
- app/models/**/*.rb
|
21
|
+
- config/**/*.rb
|
22
|
+
- db/**/*.rb
|
23
|
+
- lib/tasks/**/*.rb
|
24
|
+
- spec/**/*.rb
|
data/rubocop-default.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
require:
|
2
3
|
- rubocop-gitlab-security
|
3
4
|
- rubocop-performance
|
@@ -12,6 +13,7 @@ inherit_from:
|
|
12
13
|
- rubocop-layout.yml
|
13
14
|
- rubocop-lint.yml
|
14
15
|
- rubocop-metrics.yml
|
16
|
+
- rubocop-migrations.yml
|
15
17
|
- rubocop-naming.yml
|
16
18
|
- rubocop-performance.yml
|
17
19
|
- rubocop-rails.yml
|
data/rubocop-gemspec.yml
CHANGED
data/rubocop-layout.yml
CHANGED
@@ -1,20 +1,17 @@
|
|
1
|
+
---
|
1
2
|
# Check indentation of private/protected visibility modifiers.
|
2
3
|
Layout/AccessModifierIndentation:
|
3
4
|
Enabled: true
|
4
5
|
|
5
6
|
# Align the elements of an array literal if they span more than one line.
|
6
|
-
Layout/
|
7
|
+
Layout/ArrayAlignment:
|
7
8
|
Enabled: true
|
8
9
|
|
9
|
-
#
|
10
|
-
|
10
|
+
# Checks the indentation of the first line of the right-hand-side of a
|
11
|
+
# multi-line assignment.
|
12
|
+
Layout/AssignmentIndentation:
|
11
13
|
Enabled: true
|
12
14
|
|
13
|
-
# Here we check if the parameters on a multi-line method call or
|
14
|
-
# definition are aligned.
|
15
|
-
Layout/AlignParameters:
|
16
|
-
Enabled: false
|
17
|
-
|
18
15
|
# Align block ends correctly.
|
19
16
|
Layout/BlockAlignment:
|
20
17
|
Enabled: true
|
@@ -64,6 +61,11 @@ Layout/EmptyLines:
|
|
64
61
|
Layout/EmptyLinesAroundAccessModifier:
|
65
62
|
Enabled: true
|
66
63
|
|
64
|
+
# Checks for a newline after an attribute accessor or a group of them
|
65
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_layout.html#layoutemptylinesaroundattributeaccessor
|
66
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
67
|
+
Enabled: true
|
68
|
+
|
67
69
|
# Keeps track of empty lines around block bodies.
|
68
70
|
Layout/EmptyLinesAroundBlockBody:
|
69
71
|
Enabled: true
|
@@ -102,27 +104,36 @@ Layout/ExtraSpacing:
|
|
102
104
|
Layout/FirstMethodParameterLineBreak:
|
103
105
|
Enabled: true
|
104
106
|
|
107
|
+
# Align the elements of a hash literal if they span more than one line.
|
108
|
+
Layout/HashAlignment:
|
109
|
+
Enabled: true
|
110
|
+
|
111
|
+
# This cops checks the indentation of the here document bodies.
|
112
|
+
Layout/HeredocIndentation:
|
113
|
+
Enabled: false
|
114
|
+
|
105
115
|
# Keep indentation straight.
|
106
116
|
Layout/IndentationConsistency:
|
107
117
|
Enabled: true
|
108
118
|
|
109
|
-
#
|
110
|
-
Layout/
|
119
|
+
# No hard tabs.
|
120
|
+
Layout/IndentationStyle:
|
111
121
|
Enabled: true
|
112
122
|
|
113
|
-
#
|
114
|
-
|
115
|
-
Layout/IndentAssignment:
|
123
|
+
# Use 2 spaces for indentation.
|
124
|
+
Layout/IndentationWidth:
|
116
125
|
Enabled: true
|
117
126
|
|
118
|
-
# This cops checks the indentation of the here document bodies.
|
119
|
-
Layout/IndentHeredoc:
|
120
|
-
Enabled: false
|
121
|
-
|
122
127
|
# Comments should start with a space.
|
123
128
|
Layout/LeadingCommentSpace:
|
124
129
|
Enabled: true
|
125
130
|
|
131
|
+
# Limit lines to 120 characters.
|
132
|
+
Layout/LineLength:
|
133
|
+
Enabled: true
|
134
|
+
Max: 120
|
135
|
+
IgnoredPatterns: ['\s#\srubocop']
|
136
|
+
|
126
137
|
# Checks that the closing brace in an array literal is either on the same line
|
127
138
|
# as the last array element, or a new line.
|
128
139
|
Layout/MultilineArrayBraceLayout:
|
@@ -160,6 +171,11 @@ Layout/MultilineOperationIndentation:
|
|
160
171
|
Enabled: true
|
161
172
|
EnforcedStyle: indented
|
162
173
|
|
174
|
+
# Here we check if the parameters on a multi-line method call or
|
175
|
+
# definition are aligned.
|
176
|
+
Layout/ParameterAlignment:
|
177
|
+
Enabled: false
|
178
|
+
|
163
179
|
# Use spaces after colons.
|
164
180
|
Layout/SpaceAfterColon:
|
165
181
|
Enabled: true
|
@@ -189,6 +205,10 @@ Layout/SpaceAroundEqualsInParameterDefault:
|
|
189
205
|
Layout/SpaceAroundKeyword:
|
190
206
|
Enabled: true
|
191
207
|
|
208
|
+
# Checks method call operators to not have spaces around them.
|
209
|
+
Layout/SpaceAroundMethodCallOperator:
|
210
|
+
Enabled: true
|
211
|
+
|
192
212
|
# Use a single space around operators.
|
193
213
|
Layout/SpaceAroundOperators:
|
194
214
|
Enabled: true
|
@@ -235,12 +255,8 @@ Layout/SpaceInsideStringInterpolation:
|
|
235
255
|
EnforcedStyle: no_space
|
236
256
|
Enabled: true
|
237
257
|
|
238
|
-
# No hard tabs.
|
239
|
-
Layout/Tab:
|
240
|
-
Enabled: true
|
241
|
-
|
242
258
|
# Checks trailing blank lines and final newline.
|
243
|
-
Layout/
|
259
|
+
Layout/TrailingEmptyLines:
|
244
260
|
Enabled: true
|
245
261
|
|
246
262
|
# Avoid trailing whitespace.
|
data/rubocop-lint.yml
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
---
|
1
2
|
# Checks for ambiguous block association with method when param passed without
|
2
3
|
# parentheses.
|
3
4
|
Lint/AmbiguousBlockAssociation:
|
@@ -18,6 +19,10 @@ Lint/AmbiguousRegexpLiteral:
|
|
18
19
|
Lint/AssignmentInCondition:
|
19
20
|
Enabled: false
|
20
21
|
|
22
|
+
# Checks for places where binary operator has identical operands
|
23
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
24
|
+
Enabled: true
|
25
|
+
|
21
26
|
# Default values in optional keyword arguments and optional ordinal arguments
|
22
27
|
# should not refer back to the name of the argument.
|
23
28
|
Lint/CircularArgumentReference:
|
@@ -31,6 +36,22 @@ Lint/Debugger:
|
|
31
36
|
Lint/DeprecatedClassMethods:
|
32
37
|
Enabled: true
|
33
38
|
|
39
|
+
# Algorithmic constants for OpenSSL::Cipher and OpenSSL::Digest deprecated since OpenSSL version 2.2.0.
|
40
|
+
# Prefer passing a string instead.
|
41
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintdeprecatedopensslconstant
|
42
|
+
Lint/DeprecatedOpenSSLConstant:
|
43
|
+
Enabled: true
|
44
|
+
|
45
|
+
# Checks that there are no repeated conditions used in if 'elsif'.
|
46
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintduplicateelsifcondition
|
47
|
+
Lint/DuplicateElsifCondition:
|
48
|
+
Enabled: true
|
49
|
+
|
50
|
+
# Checks that there are no repeated exceptions used in 'rescue' expressions.
|
51
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintduplicaterescueexception
|
52
|
+
Lint/DuplicateRescueException:
|
53
|
+
Enabled: true
|
54
|
+
|
34
55
|
# Check for immutable argument given to each_with_object.
|
35
56
|
Lint/EachWithObjectArgument:
|
36
57
|
Enabled: true
|
@@ -39,6 +60,11 @@ Lint/EachWithObjectArgument:
|
|
39
60
|
Lint/ElseLayout:
|
40
61
|
Enabled: true
|
41
62
|
|
63
|
+
# Checks for the presence of if, elsif and unless branches without a body.
|
64
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintemptyconditionalbody
|
65
|
+
Lint/EmptyConditionalBody:
|
66
|
+
Enabled: true
|
67
|
+
|
42
68
|
# Checks for empty ensure block.
|
43
69
|
Lint/EmptyEnsure:
|
44
70
|
Enabled: true
|
@@ -47,10 +73,6 @@ Lint/EmptyEnsure:
|
|
47
73
|
Lint/EmptyWhen:
|
48
74
|
Enabled: true
|
49
75
|
|
50
|
-
# END blocks should not be placed inside method definitions.
|
51
|
-
Lint/EndInMethod:
|
52
|
-
Enabled: true
|
53
|
-
|
54
76
|
# Do not use return in an ensure block.
|
55
77
|
Lint/EnsureReturn:
|
56
78
|
Enabled: true
|
@@ -59,6 +81,11 @@ Lint/EnsureReturn:
|
|
59
81
|
Lint/FlipFlop:
|
60
82
|
Enabled: true
|
61
83
|
|
84
|
+
# Checks for the presence of precise comparison of floating point numbers.
|
85
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintfloatcomparison
|
86
|
+
Lint/FloatComparison:
|
87
|
+
Enabled: true
|
88
|
+
|
62
89
|
# Catches floating-point literals too large or small for Ruby to represent.
|
63
90
|
Lint/FloatOutOfRange:
|
64
91
|
Enabled: true
|
@@ -67,10 +94,6 @@ Lint/FloatOutOfRange:
|
|
67
94
|
Lint/FormatParameterMismatch:
|
68
95
|
Enabled: true
|
69
96
|
|
70
|
-
# This cop checks for *rescue* blocks with no body.
|
71
|
-
Lint/HandleExceptions:
|
72
|
-
Enabled: false
|
73
|
-
|
74
97
|
# Checks for adjacent string literals on the same line, which could better be
|
75
98
|
# represented as a single string literal.
|
76
99
|
Lint/ImplicitStringConcatenation:
|
@@ -89,10 +112,21 @@ Lint/LiteralAsCondition:
|
|
89
112
|
Lint/LiteralInInterpolation:
|
90
113
|
Enabled: true
|
91
114
|
|
92
|
-
#
|
115
|
+
# Checks for uses of *begin...end while/until something*.
|
93
116
|
Lint/Loop:
|
94
117
|
Enabled: false
|
95
118
|
|
119
|
+
# Checks for the presence of constructors and lifecycle callbacks without calls to super.
|
120
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintmissingsuper
|
121
|
+
Lint/MissingSuper:
|
122
|
+
Enabled: false
|
123
|
+
|
124
|
+
# Do not mix named captures and numbered captures in a Regexp literal
|
125
|
+
# because numbered capture is ignored if they’re mixed.
|
126
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintmixedregexpcapturetypes
|
127
|
+
Lint/MixedRegexpCaptureTypes:
|
128
|
+
Enabled: true
|
129
|
+
|
96
130
|
# Do not use nested method definitions.
|
97
131
|
Lint/NestedMethodDefinition:
|
98
132
|
Enabled: true
|
@@ -101,15 +135,32 @@ Lint/NestedMethodDefinition:
|
|
101
135
|
Lint/NextWithoutAccumulator:
|
102
136
|
Enabled: true
|
103
137
|
|
138
|
+
# Looks for references of Regexp captures that are out of range and thus always returns nil.
|
139
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintoutofrangeregexpref
|
140
|
+
Lint/OutOfRangeRegexpRef:
|
141
|
+
Enabled: true
|
142
|
+
|
104
143
|
# Checks for method calls with a space before the opening parenthesis.
|
105
144
|
Lint/ParenthesesAsGroupedExpression:
|
106
145
|
Enabled: true
|
107
146
|
|
147
|
+
# Checks for raise or fail statements which are raising Exception class.
|
148
|
+
Lint/RaiseException:
|
149
|
+
Enabled: true
|
150
|
+
|
108
151
|
# Checks for `rand(1)` calls. Such calls always return `0` and most likely
|
109
152
|
# a mistake.
|
110
153
|
Lint/RandOne:
|
111
154
|
Enabled: true
|
112
155
|
|
156
|
+
# This cop checks for unneeded usages of splat expansion
|
157
|
+
Lint/RedundantSplatExpansion:
|
158
|
+
Enabled: false
|
159
|
+
|
160
|
+
# Checks for Object#to_s usage in string interpolation.
|
161
|
+
Lint/RedundantStringCoercion:
|
162
|
+
Enabled: true
|
163
|
+
|
113
164
|
# Use parentheses in the method call to avoid confusion about precedence.
|
114
165
|
Lint/RequireParentheses:
|
115
166
|
Enabled: true
|
@@ -122,6 +173,11 @@ Lint/RescueException:
|
|
122
173
|
Lint/SafeNavigationWithEmpty:
|
123
174
|
Enabled: true
|
124
175
|
|
176
|
+
# Checks for self-assignments.
|
177
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintselfassignment
|
178
|
+
Lint/SelfAssignment:
|
179
|
+
Enabled: true
|
180
|
+
|
125
181
|
# Checks for the order which exceptions are rescued to avoid rescueing a less specific exception before a more specific exception.
|
126
182
|
Lint/ShadowedException:
|
127
183
|
Enabled: false
|
@@ -131,8 +187,17 @@ Lint/ShadowedException:
|
|
131
187
|
Lint/ShadowingOuterLocalVariable:
|
132
188
|
Enabled: false
|
133
189
|
|
134
|
-
# Checks
|
135
|
-
Lint/
|
190
|
+
# Checks unexpected overrides of the Struct built-in methods via Struct.new.
|
191
|
+
Lint/StructNewOverride:
|
192
|
+
Enabled: true
|
193
|
+
|
194
|
+
# This cop checks for *rescue* blocks with no body.
|
195
|
+
Lint/SuppressedException:
|
196
|
+
Enabled: false
|
197
|
+
|
198
|
+
# Checks for top level return with arguments.
|
199
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#linttoplevelreturnwithargument
|
200
|
+
Lint/TopLevelReturnWithArgument:
|
136
201
|
Enabled: true
|
137
202
|
|
138
203
|
# Do not use prefix `_` for a variable that is used.
|
@@ -143,14 +208,15 @@ Lint/UnderscorePrefixedVariableName:
|
|
143
208
|
Lint/UnifiedInteger:
|
144
209
|
Enabled: true
|
145
210
|
|
146
|
-
# This cop checks for unneeded usages of splat expansion
|
147
|
-
Lint/UnneededSplatExpansion:
|
148
|
-
Enabled: false
|
149
|
-
|
150
211
|
# Unreachable code.
|
151
212
|
Lint/UnreachableCode:
|
152
213
|
Enabled: true
|
153
214
|
|
215
|
+
# Checks for loops that will have at most one iteration.
|
216
|
+
# https://docs.rubocop.org/rubocop/0.89/cops_lint.html#lintunreachableloop
|
217
|
+
Lint/UnreachableLoop:
|
218
|
+
Enabled: true
|
219
|
+
|
154
220
|
# This cop checks for unused block arguments.
|
155
221
|
Lint/UnusedBlockArgument:
|
156
222
|
Enabled: false
|
@@ -168,10 +234,6 @@ Lint/UselessAccessModifier:
|
|
168
234
|
Lint/UselessAssignment:
|
169
235
|
Enabled: true
|
170
236
|
|
171
|
-
# Checks for comparison of something with itself.
|
172
|
-
Lint/UselessComparison:
|
173
|
-
Enabled: true
|
174
|
-
|
175
237
|
# Checks for useless `else` in `begin..end` without `rescue`.
|
176
238
|
Lint/UselessElseWithoutRescue:
|
177
239
|
Enabled: true
|