rubocop_config 0.49.1.1 → 0.57.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -1
- data/.rubocop.yml +847 -268
- data/bin/publish +60 -0
- data/config/default.yml +1189 -314
- data/lib/rubocop_config/runner.rb +1 -1
- data/lib/rubocop_config/version.rb +1 -1
- data/rubocop_config.gemspec +3 -4
- metadata +15 -14
data/bin/publish
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "pathname"
|
5
|
+
require "fileutils"
|
6
|
+
require "json"
|
7
|
+
require "rubocop"
|
8
|
+
require_relative "../lib/rubocop_config/version"
|
9
|
+
|
10
|
+
# path to your application root.
|
11
|
+
APP_ROOT = Pathname.new File.expand_path("..", __dir__)
|
12
|
+
MASTER_CHECK = <<~MASTER_CHECK
|
13
|
+
if [ $(git symbolic-ref --short -q HEAD) != 'master' ];
|
14
|
+
then exit 1;
|
15
|
+
fi
|
16
|
+
MASTER_CHECK
|
17
|
+
|
18
|
+
def system!(*args)
|
19
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
20
|
+
end
|
21
|
+
|
22
|
+
abort("\n== Not on master") unless system(MASTER_CHECK)
|
23
|
+
|
24
|
+
current_config_version = Gem::Version.new(
|
25
|
+
RubocopConfig::VERSION.split(".").map(&:to_i).first(3).join(".")
|
26
|
+
)
|
27
|
+
current_rubocop_version = Gem::Version.new(RuboCop::Version::STRING)
|
28
|
+
|
29
|
+
abort("\n== Versions can't go backwards ==") if
|
30
|
+
current_rubocop_version < current_config_version
|
31
|
+
|
32
|
+
new_version =
|
33
|
+
if current_config_version == current_rubocop_version
|
34
|
+
current_version = RubocopConfig::VERSION.split(".").map(&:to_i)
|
35
|
+
[*current_version.first(3), current_version.last + 1]
|
36
|
+
elsif current_rubocop_version > current_config_version
|
37
|
+
RuboCop::Version::STRING + ".0"
|
38
|
+
end
|
39
|
+
|
40
|
+
FileUtils.chdir APP_ROOT do
|
41
|
+
contents = <<~FILE
|
42
|
+
# frozen_string_literal: true
|
43
|
+
|
44
|
+
module RubocopConfig
|
45
|
+
VERSION = "#{new_version}"
|
46
|
+
end
|
47
|
+
FILE
|
48
|
+
|
49
|
+
puts "== Updating version to #{new_version} =="
|
50
|
+
File.write("lib/rubocop_config/version.rb", contents)
|
51
|
+
|
52
|
+
puts "== Adding Changed Files =="
|
53
|
+
system! "git add lib/rubocop_config/version.rb"
|
54
|
+
|
55
|
+
puts "== Committing updated files =="
|
56
|
+
system! "git commit -m 'Version bump to #{new_version}'"
|
57
|
+
|
58
|
+
puts "== Tagging release =="
|
59
|
+
system! "bundle exec rake release"
|
60
|
+
end
|
data/config/default.yml
CHANGED
@@ -1,866 +1,1741 @@
|
|
1
|
-
---
|
2
1
|
AllCops:
|
3
2
|
Exclude:
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
- vendor/**/*
|
4
|
+
- Gemfile.lock
|
5
|
+
- db/schema.rb
|
6
|
+
- node_modules/**/*
|
7
7
|
TargetRubyVersion: 2.4
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
|
9
|
+
# Department Bundler
|
10
|
+
Bundler/DuplicatedGem:
|
11
|
+
Description: Checks for duplicate gem entries in Gemfile.
|
12
|
+
Enabled: true
|
13
|
+
|
14
|
+
Bundler/InsecureProtocolSource:
|
15
|
+
Description: The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated because HTTP requests are insecure. Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
|
16
|
+
Enabled: true
|
17
|
+
|
18
|
+
Bundler/OrderedGems:
|
19
|
+
Description: Gems within groups in the Gemfile should be alphabetically sorted.
|
20
|
+
Enabled: true
|
21
|
+
|
22
|
+
# Department Gemspec
|
23
|
+
Gemspec/OrderedDependencies:
|
24
|
+
Description: Dependencies in the gemspec should be alphabetically sorted.
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
# Department Layout
|
28
|
+
Layout/AccessModifierIndentation:
|
29
|
+
Description: Check indentation of private/protected visibility modifiers.
|
30
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Layout/AlignArray:
|
34
|
+
Description: Align the elements of an array literal if they span more than one line.
|
35
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Layout/AlignHash:
|
39
|
+
Description: Align the elements of a hash literal if they span more than one line.
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
Layout/AlignParameters:
|
43
|
+
Description: Align the parameters of a method call if they span more than one line.
|
44
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
|
45
|
+
Enabled: true
|
46
|
+
|
47
|
+
Layout/BlockEndNewline:
|
48
|
+
Description: Put end statement of multiline block on its own line.
|
49
|
+
Enabled: true
|
50
|
+
|
51
|
+
Layout/CaseIndentation:
|
52
|
+
Description: Indentation of when in a case/when/[else/]end.
|
53
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Layout/ClosingParenthesisIndentation:
|
57
|
+
Description: Checks the indentation of hanging closing parentheses.
|
58
|
+
Enabled: false
|
59
|
+
|
60
|
+
Layout/CommentIndentation:
|
61
|
+
Description: Indentation of comments.
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Layout/DotPosition:
|
65
|
+
Description: Checks the position of the dot in multi-line method calls.
|
66
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
67
|
+
Enabled: true
|
68
|
+
|
69
|
+
Layout/ElseAlignment:
|
70
|
+
Description: Align elses and elsifs correctly.
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
Layout/EmptyLineBetweenDefs:
|
74
|
+
Description: Use empty lines between defs.
|
75
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods
|
76
|
+
Enabled: true
|
77
|
+
|
78
|
+
Layout/EmptyLines:
|
79
|
+
Description: Don't use several empty lines in a row.
|
80
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#two-or-more-empty-lines
|
81
|
+
Enabled: true
|
82
|
+
|
83
|
+
Layout/EmptyLinesAroundAccessModifier:
|
84
|
+
Description: Keep blank lines around access modifiers.
|
85
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-around-access-modifier
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
Layout/EmptyLinesAroundBeginBody:
|
89
|
+
Description: Keeps track of empty lines around begin-end bodies.
|
90
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-around-bodies
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
Layout/EmptyLinesAroundBlockBody:
|
94
|
+
Description: Keeps track of empty lines around block bodies.
|
95
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-around-bodies
|
96
|
+
Enabled: false
|
97
|
+
|
98
|
+
Layout/EmptyLinesAroundClassBody:
|
99
|
+
Description: Keeps track of empty lines around class bodies.
|
100
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-around-bodies
|
101
|
+
Enabled: false
|
102
|
+
|
103
|
+
Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
104
|
+
Description: Keeps track of empty lines around exception handling keywords.
|
105
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-around-bodies
|
106
|
+
Enabled: false
|
107
|
+
|
108
|
+
Layout/EmptyLinesAroundModuleBody:
|
109
|
+
Description: Keeps track of empty lines around module bodies.
|
110
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-around-bodies
|
111
|
+
Enabled: false
|
112
|
+
|
113
|
+
Layout/EmptyLinesAroundMethodBody:
|
114
|
+
Description: Keeps track of empty lines around method bodies.
|
115
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#empty-lines-around-bodies
|
116
|
+
Enabled: false
|
117
|
+
|
118
|
+
Layout/EndOfLine:
|
119
|
+
Description: Use Unix-style line endings.
|
120
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#crlf
|
121
|
+
Enabled: false
|
122
|
+
|
123
|
+
Layout/ExtraSpacing:
|
124
|
+
Description: Do not use unnecessary spacing.
|
125
|
+
Enabled: true
|
126
|
+
|
127
|
+
Layout/FirstArrayElementLineBreak:
|
128
|
+
Description: Checks for a line break before the first element in a multi-line array.
|
129
|
+
Enabled: false
|
130
|
+
|
131
|
+
Layout/FirstHashElementLineBreak:
|
132
|
+
Description: Checks for a line break before the first element in a multi-line hash.
|
133
|
+
Enabled: false
|
134
|
+
|
135
|
+
Layout/FirstMethodArgumentLineBreak:
|
136
|
+
Description: Checks for a line break before the first argument in a multi-line method call.
|
137
|
+
Enabled: false
|
138
|
+
|
139
|
+
Layout/FirstMethodParameterLineBreak:
|
140
|
+
Description: Checks for a line break before the first parameter in a multi-line method parameter definition.
|
141
|
+
Enabled: false
|
142
|
+
|
143
|
+
Layout/InitialIndentation:
|
144
|
+
Description: Checks the indentation of the first non-blank non-comment line in a file.
|
145
|
+
Enabled: false
|
146
|
+
|
147
|
+
Layout/FirstParameterIndentation:
|
148
|
+
Description: Checks the indentation of the first parameter in a method call.
|
149
|
+
Enabled: false
|
150
|
+
|
151
|
+
Layout/IndentationConsistency:
|
152
|
+
Description: Keep indentation straight.
|
153
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
154
|
+
Enabled: false
|
155
|
+
|
156
|
+
Layout/IndentationWidth:
|
157
|
+
Description: Use 2 spaces for indentation.
|
158
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
159
|
+
Enabled: true
|
160
|
+
|
161
|
+
Layout/IndentArray:
|
162
|
+
Description: Checks the indentation of the first element in an array literal.
|
163
|
+
Enabled: false
|
164
|
+
|
165
|
+
Layout/IndentAssignment:
|
166
|
+
Description: Checks the indentation of the first line of the right-hand-side of a multi-line assignment.
|
167
|
+
Enabled: true
|
168
|
+
|
169
|
+
Layout/IndentHash:
|
170
|
+
Description: Checks the indentation of the first key in a hash literal.
|
171
|
+
Enabled: false
|
172
|
+
|
173
|
+
Layout/IndentHeredoc:
|
174
|
+
Description: This cops checks the indentation of the here document bodies.
|
175
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#squiggly-heredocs
|
176
|
+
Enabled: true
|
177
|
+
|
178
|
+
Layout/SpaceInLambdaLiteral:
|
179
|
+
Description: Checks for spaces in lambda literals.
|
180
|
+
Enabled: true
|
181
|
+
|
182
|
+
Layout/LeadingCommentSpace:
|
183
|
+
Description: Comments should start with a space.
|
184
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
|
185
|
+
Enabled: true
|
186
|
+
|
187
|
+
Layout/MultilineArrayBraceLayout:
|
188
|
+
Description: Checks that the closing brace in an array literal is either on the same line as the last array element, or a new line.
|
189
|
+
Enabled: true
|
190
|
+
|
191
|
+
Layout/MultilineAssignmentLayout:
|
192
|
+
Description: Check for a newline after the assignment operator in multi-line assignments.
|
193
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guid#indent-conditional-assignment
|
194
|
+
Enabled: false
|
195
|
+
|
196
|
+
Layout/MultilineBlockLayout:
|
197
|
+
Description: Ensures newlines after multiline block do statements.
|
198
|
+
Enabled: true
|
199
|
+
|
200
|
+
Layout/MultilineHashBraceLayout:
|
201
|
+
Description: Checks that the closing brace in a hash literal is either on the same line as the last hash element, or a new line.
|
202
|
+
Enabled: true
|
203
|
+
|
204
|
+
Layout/MultilineMethodCallBraceLayout:
|
205
|
+
Description: Checks that the closing brace in a method call is either on the same line as the last method argument, or a new line.
|
206
|
+
Enabled: true
|
207
|
+
|
208
|
+
Layout/MultilineMethodCallIndentation:
|
209
|
+
Description: Checks indentation of method calls with the dot operator that span more than one line.
|
210
|
+
Enabled: true
|
211
|
+
|
212
|
+
Layout/MultilineMethodDefinitionBraceLayout:
|
213
|
+
Description: Checks that the closing brace in a method definition is either on the same line as the last method parameter, or a new line.
|
214
|
+
Enabled: true
|
215
|
+
|
216
|
+
Layout/MultilineOperationIndentation:
|
217
|
+
Description: Checks indentation of binary operations that span more than one line.
|
218
|
+
Enabled: false
|
219
|
+
|
220
|
+
Layout/EmptyLineAfterMagicComment:
|
221
|
+
Description: Add an empty line after magic comments to separate them from code.
|
222
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#separate-magic-comments-from-code
|
223
|
+
Enabled: true
|
224
|
+
|
225
|
+
Layout/RescueEnsureAlignment:
|
226
|
+
Description: Align rescues and ensures correctly.
|
227
|
+
Enabled: false
|
228
|
+
|
229
|
+
Layout/SpaceBeforeFirstArg:
|
230
|
+
Description: Checks that exactly one space is used between a method name and the first argument for method calls without parentheses.
|
231
|
+
Enabled: true
|
232
|
+
|
233
|
+
Layout/SpaceAfterColon:
|
234
|
+
Description: Use spaces after colons.
|
235
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
236
|
+
Enabled: true
|
237
|
+
|
238
|
+
Layout/SpaceAfterComma:
|
239
|
+
Description: Use spaces after commas.
|
240
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
241
|
+
Enabled: true
|
242
|
+
|
243
|
+
Layout/SpaceAfterMethodName:
|
244
|
+
Description: Do not put a space between a method name and the opening parenthesis in a method definition.
|
245
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
246
|
+
Enabled: true
|
247
|
+
|
248
|
+
Layout/SpaceAfterNot:
|
249
|
+
Description: Tracks redundant space after the ! operator.
|
250
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
|
251
|
+
Enabled: false
|
252
|
+
|
253
|
+
Layout/SpaceAfterSemicolon:
|
254
|
+
Description: Use spaces after semicolons.
|
255
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
256
|
+
Enabled: true
|
257
|
+
|
258
|
+
Layout/SpaceBeforeBlockBraces:
|
259
|
+
Description: Checks that the left block brace has or doesn't have space before it.
|
260
|
+
Enabled: false
|
261
|
+
|
262
|
+
Layout/SpaceBeforeComma:
|
263
|
+
Description: No spaces before commas.
|
264
|
+
Enabled: false
|
265
|
+
|
266
|
+
Layout/SpaceBeforeComment:
|
267
|
+
Description: Checks for missing space between code and a comment on the same line.
|
268
|
+
Enabled: false
|
269
|
+
|
270
|
+
Layout/SpaceBeforeSemicolon:
|
271
|
+
Description: No spaces before semicolons.
|
272
|
+
Enabled: false
|
273
|
+
|
274
|
+
Layout/SpaceInsideBlockBraces:
|
275
|
+
Description: Checks that block braces have or don't have surrounding space. For blocks taking parameters, checks that the left brace has or doesn't have trailing space.
|
276
|
+
Enabled: false
|
277
|
+
|
278
|
+
Layout/SpaceAroundBlockParameters:
|
279
|
+
Description: Checks the spacing inside and after block parameters pipes.
|
280
|
+
Enabled: true
|
281
|
+
|
282
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
283
|
+
Description: Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration.
|
284
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
|
285
|
+
Enabled: true
|
286
|
+
|
287
|
+
Layout/SpaceAroundKeyword:
|
288
|
+
Description: Use a space around keywords if appropriate.
|
289
|
+
Enabled: true
|
290
|
+
|
291
|
+
Layout/SpaceAroundOperators:
|
292
|
+
Description: Use a single space around operators.
|
293
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
294
|
+
Enabled: true
|
295
|
+
|
296
|
+
Layout/SpaceInsideArrayPercentLiteral:
|
297
|
+
Description: No unnecessary additional spaces between elements in %i/%w literals.
|
298
|
+
Enabled: true
|
299
|
+
|
300
|
+
Layout/SpaceInsidePercentLiteralDelimiters:
|
301
|
+
Description: No unnecessary spaces inside delimiters of %i/%w/%x literals.
|
302
|
+
Enabled: true
|
303
|
+
|
304
|
+
Layout/SpaceInsideHashLiteralBraces:
|
305
|
+
Description: Use spaces inside hash literal braces - or don't.
|
306
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
12
307
|
Enabled: true
|
308
|
+
|
309
|
+
Layout/SpaceInsideParens:
|
310
|
+
Description: No spaces after ( or before ).
|
311
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
312
|
+
Enabled: true
|
313
|
+
|
314
|
+
Layout/SpaceInsideRangeLiteral:
|
315
|
+
Description: No spaces inside range literals.
|
316
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
|
317
|
+
Enabled: true
|
318
|
+
|
319
|
+
Layout/SpaceInsideStringInterpolation:
|
320
|
+
Description: Checks for padding/surrounding spaces inside string interpolation.
|
321
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#string-interpolation
|
322
|
+
Enabled: false
|
323
|
+
|
324
|
+
Layout/Tab:
|
325
|
+
Description: No hard tabs.
|
326
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
327
|
+
Enabled: false
|
328
|
+
|
329
|
+
Layout/TrailingBlankLines:
|
330
|
+
Description: Checks trailing blank lines and final newline.
|
331
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#newline-eof
|
332
|
+
Enabled: false
|
333
|
+
|
334
|
+
Layout/TrailingWhitespace:
|
335
|
+
Description: Avoid trailing whitespace.
|
336
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
|
337
|
+
Enabled: false
|
338
|
+
|
339
|
+
# Department Lint
|
13
340
|
Lint/AmbiguousBlockAssociation:
|
341
|
+
Description: Checks for ambiguous block association with method when param passed without parentheses.
|
342
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#syntax
|
14
343
|
Enabled: false
|
344
|
+
|
345
|
+
Lint/AmbiguousOperator:
|
346
|
+
Description: Checks for ambiguous operators in the first argument of a method invocation without parentheses.
|
347
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-invocation-parens
|
348
|
+
Enabled: true
|
349
|
+
|
15
350
|
Lint/AmbiguousRegexpLiteral:
|
16
|
-
Description: Checks for ambiguous regexp literals in the first argument of a method
|
17
|
-
invocation without parenthesis.
|
351
|
+
Description: Checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
|
18
352
|
Enabled: true
|
353
|
+
|
19
354
|
Lint/AssignmentInCondition:
|
20
355
|
Description: Don't use assignment in conditions.
|
21
356
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
22
357
|
Enabled: true
|
358
|
+
|
23
359
|
Lint/BlockAlignment:
|
24
360
|
Description: Align block ends correctly.
|
25
361
|
Enabled: true
|
362
|
+
|
363
|
+
Lint/BooleanSymbol:
|
364
|
+
Description: Check for `:true` and `:false` symbols.
|
365
|
+
Enabled: true
|
366
|
+
|
26
367
|
Lint/CircularArgumentReference:
|
27
|
-
Description:
|
368
|
+
Description: Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument.
|
28
369
|
Enabled: true
|
370
|
+
|
29
371
|
Lint/ConditionPosition:
|
30
|
-
Description: Checks for condition placed in a confusing position relative to the
|
31
|
-
keyword.
|
372
|
+
Description: Checks for condition placed in a confusing position relative to the keyword.
|
32
373
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
|
33
374
|
Enabled: true
|
375
|
+
|
34
376
|
Lint/Debugger:
|
35
377
|
Description: Check for debugger calls.
|
36
378
|
Enabled: true
|
379
|
+
|
37
380
|
Lint/DefEndAlignment:
|
38
381
|
Description: Align ends corresponding to defs correctly.
|
39
382
|
Enabled: true
|
383
|
+
|
40
384
|
Lint/DeprecatedClassMethods:
|
41
385
|
Description: Check for deprecated class method calls.
|
42
386
|
Enabled: true
|
387
|
+
|
388
|
+
Lint/DuplicateCaseCondition:
|
389
|
+
Description: Do not repeat values in case conditionals.
|
390
|
+
Enabled: true
|
391
|
+
|
43
392
|
Lint/DuplicateMethods:
|
44
|
-
Description: Check for duplicate
|
393
|
+
Description: Check for duplicate method definitions.
|
394
|
+
Enabled: true
|
395
|
+
|
396
|
+
Lint/DuplicatedKey:
|
397
|
+
Description: Check for duplicate keys in hash literals.
|
45
398
|
Enabled: true
|
399
|
+
|
46
400
|
Lint/EachWithObjectArgument:
|
47
401
|
Description: Check for immutable argument given to each_with_object.
|
48
402
|
Enabled: true
|
403
|
+
|
49
404
|
Lint/ElseLayout:
|
50
405
|
Description: Check for odd code arrangement in an else block.
|
51
406
|
Enabled: true
|
407
|
+
|
52
408
|
Lint/EmptyEnsure:
|
53
409
|
Description: Checks for empty ensure block.
|
54
410
|
Enabled: true
|
411
|
+
AutoCorrect: false
|
412
|
+
|
413
|
+
Lint/EmptyExpression:
|
414
|
+
Description: Checks for empty expressions.
|
415
|
+
Enabled: true
|
416
|
+
|
55
417
|
Lint/EmptyInterpolation:
|
56
418
|
Description: Checks for empty string interpolation.
|
57
419
|
Enabled: true
|
420
|
+
|
421
|
+
Lint/EmptyWhen:
|
422
|
+
Description: Checks for `when` branches with empty bodies.
|
423
|
+
Enabled: true
|
424
|
+
|
58
425
|
Lint/EndAlignment:
|
59
426
|
Description: Align ends correctly.
|
60
427
|
Enabled: true
|
428
|
+
|
61
429
|
Lint/EndInMethod:
|
62
430
|
Description: END blocks should not be placed inside method definitions.
|
63
431
|
Enabled: true
|
432
|
+
|
64
433
|
Lint/EnsureReturn:
|
65
434
|
Description: Do not use return in an ensure block.
|
66
435
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
|
67
436
|
Enabled: true
|
437
|
+
|
438
|
+
Lint/FloatOutOfRange:
|
439
|
+
Description: Catches floating-point literals too large or small for Ruby to represent.
|
440
|
+
Enabled: true
|
441
|
+
|
68
442
|
Lint/FormatParameterMismatch:
|
69
443
|
Description: The number of parameters to format/sprint must match the fields.
|
70
444
|
Enabled: true
|
445
|
+
|
71
446
|
Lint/HandleExceptions:
|
72
447
|
Description: Don't suppress exception.
|
73
448
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
74
449
|
Enabled: true
|
75
|
-
|
76
|
-
|
77
|
-
|
450
|
+
|
451
|
+
Lint/ImplicitStringConcatenation:
|
452
|
+
Description: Checks for adjacent string literals on the same line, which could better be represented as a single string literal.
|
78
453
|
Enabled: true
|
79
|
-
|
454
|
+
|
455
|
+
Lint/IneffectiveAccessModifier:
|
456
|
+
Description: Checks for attempts to use `private` or `protected` to set the visibility of a class method, which does not work.
|
457
|
+
Enabled: true
|
458
|
+
|
459
|
+
Lint/InheritException:
|
460
|
+
Description: Avoid inheriting from the `Exception` class.
|
461
|
+
Enabled: true
|
462
|
+
|
463
|
+
Lint/InterpolationCheck:
|
464
|
+
Description: Raise warning for interpolation in single q strs
|
465
|
+
Enabled: true
|
466
|
+
|
467
|
+
Lint/LiteralAsCondition:
|
80
468
|
Description: Checks of literals used in conditions.
|
81
469
|
Enabled: true
|
470
|
+
|
82
471
|
Lint/LiteralInInterpolation:
|
83
472
|
Description: Checks for literals used in interpolation.
|
84
473
|
Enabled: true
|
474
|
+
|
85
475
|
Lint/Loop:
|
86
|
-
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
|
87
|
-
for post-loop tests.
|
476
|
+
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while for post-loop tests.
|
88
477
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
|
89
478
|
Enabled: true
|
479
|
+
|
480
|
+
Lint/MultipleCompare:
|
481
|
+
Description: Use `&&` operator to compare multiple value.
|
482
|
+
Enabled: true
|
483
|
+
|
90
484
|
Lint/NestedMethodDefinition:
|
91
485
|
Description: Do not use nested method definitions.
|
92
486
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-methods
|
93
487
|
Enabled: true
|
488
|
+
|
489
|
+
Lint/NextWithoutAccumulator:
|
490
|
+
Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` block.
|
491
|
+
Enabled: true
|
492
|
+
|
94
493
|
Lint/NonLocalExitFromIterator:
|
95
494
|
Description: Do not use return in iterator to cause non-local exit.
|
96
495
|
Enabled: true
|
496
|
+
|
97
497
|
Lint/ParenthesesAsGroupedExpression:
|
98
498
|
Description: Checks for method calls with a space before the opening parenthesis.
|
99
499
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
100
500
|
Enabled: true
|
501
|
+
|
502
|
+
Lint/PercentStringArray:
|
503
|
+
Description: Checks for unwanted commas and quotes in %w/%W literals.
|
504
|
+
Enabled: true
|
505
|
+
|
506
|
+
Lint/PercentSymbolArray:
|
507
|
+
Description: Checks for unwanted commas and colons in %i/%I literals.
|
508
|
+
Enabled: true
|
509
|
+
|
510
|
+
Lint/RandOne:
|
511
|
+
Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely a mistake.
|
512
|
+
Enabled: true
|
513
|
+
|
514
|
+
Lint/RedundantWithIndex:
|
515
|
+
Description: Checks for redundant `with_index`.
|
516
|
+
Enabled: true
|
517
|
+
|
518
|
+
Lint/RedundantWithObject:
|
519
|
+
Description: Checks for redundant `with_object`.
|
520
|
+
Enabled: true
|
521
|
+
|
522
|
+
Lint/RegexpAsCondition:
|
523
|
+
Description: Do not use regexp literal as a condition. The regexp literal matches `$_` implicitly.
|
524
|
+
Enabled: true
|
525
|
+
|
101
526
|
Lint/RequireParentheses:
|
102
527
|
Description: Use parentheses in the method call to avoid confusion about precedence.
|
103
528
|
Enabled: true
|
529
|
+
|
104
530
|
Lint/RescueException:
|
105
531
|
Description: Avoid rescuing the Exception class.
|
106
532
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
|
107
533
|
Enabled: true
|
534
|
+
|
535
|
+
Lint/RescueType:
|
536
|
+
Description: Avoid rescuing from non constants that could result in a `TypeError`.
|
537
|
+
Enabled: true
|
538
|
+
|
539
|
+
Lint/SafeNavigationChain:
|
540
|
+
Description: Do not chain ordinary method call after safe navigation operator.
|
541
|
+
Enabled: true
|
542
|
+
|
543
|
+
Lint/ScriptPermission:
|
544
|
+
Description: Grant script file execute permission.
|
545
|
+
Enabled: true
|
546
|
+
|
547
|
+
Lint/ShadowedException:
|
548
|
+
Description: Avoid rescuing a higher level exception before a lower level exception.
|
549
|
+
Enabled: true
|
550
|
+
|
108
551
|
Lint/ShadowingOuterLocalVariable:
|
109
|
-
Description: Do not use the same name as outer local variable for block arguments
|
110
|
-
or block local variables.
|
552
|
+
Description: Do not use the same name as outer local variable for block arguments or block local variables.
|
111
553
|
Enabled: true
|
554
|
+
|
112
555
|
Lint/StringConversionInInterpolation:
|
113
556
|
Description: Checks for Object#to_s usage in string interpolation.
|
114
557
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
|
115
558
|
Enabled: true
|
559
|
+
|
560
|
+
Lint/Syntax:
|
561
|
+
Description: Checks syntax error
|
562
|
+
Enabled: true
|
563
|
+
|
116
564
|
Lint/UnderscorePrefixedVariableName:
|
117
565
|
Description: Do not use prefix `_` for a variable that is used.
|
118
566
|
Enabled: true
|
567
|
+
|
568
|
+
Lint/UnifiedInteger:
|
569
|
+
Description: Use Integer instead of Fixnum or Bignum
|
570
|
+
Enabled: true
|
571
|
+
|
119
572
|
Lint/UnneededDisable:
|
120
|
-
Description: 'Checks for rubocop:disable comments that can be removed. Note: this
|
121
|
-
|
573
|
+
Description: 'Checks for rubocop:disable comments that can be removed. Note: this cop is not disabled when disabling all cops. It must be explicitly disabled.'
|
574
|
+
Enabled: true
|
575
|
+
|
576
|
+
Lint/UnneededRequireStatement:
|
577
|
+
Description: Checks for unnecessary `require` statement.
|
122
578
|
Enabled: true
|
579
|
+
|
580
|
+
Lint/UnneededSplatExpansion:
|
581
|
+
Description: Checks for splat unnecessarily being called on literals
|
582
|
+
Enabled: true
|
583
|
+
|
123
584
|
Lint/UnusedBlockArgument:
|
124
585
|
Description: Checks for unused block arguments.
|
125
586
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
126
587
|
Enabled: true
|
588
|
+
|
127
589
|
Lint/UnusedMethodArgument:
|
128
590
|
Description: Checks for unused method arguments.
|
129
591
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
130
592
|
Enabled: true
|
593
|
+
|
131
594
|
Lint/UnreachableCode:
|
132
595
|
Description: Unreachable code.
|
133
596
|
Enabled: true
|
597
|
+
|
598
|
+
Lint/UriEscapeUnescape:
|
599
|
+
Description: '`URI.escape` method is obsolete and should not be used. Instead, use `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component` depending on your specific use case. Also `URI.unescape` method is obsolete and should not be used. Instead, use `CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component` depending on your specific use case.'
|
600
|
+
Enabled: true
|
601
|
+
|
602
|
+
Lint/UriRegexp:
|
603
|
+
Description: Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.
|
604
|
+
Enabled: true
|
605
|
+
|
134
606
|
Lint/UselessAccessModifier:
|
135
607
|
Description: Checks for useless access modifiers.
|
136
608
|
Enabled: true
|
609
|
+
ContextCreatingMethods: []
|
610
|
+
MethodCreatingMethods: []
|
611
|
+
|
137
612
|
Lint/UselessAssignment:
|
138
613
|
Description: Checks for useless assignment to a local variable.
|
139
614
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
140
615
|
Enabled: true
|
616
|
+
|
141
617
|
Lint/UselessComparison:
|
142
618
|
Description: Checks for comparison of something with itself.
|
143
619
|
Enabled: true
|
620
|
+
|
144
621
|
Lint/UselessElseWithoutRescue:
|
145
622
|
Description: Checks for useless `else` in `begin..end` without `rescue`.
|
146
623
|
Enabled: true
|
624
|
+
|
625
|
+
Lint/ReturnInVoidContext:
|
626
|
+
Description: Checks for return in void context.
|
627
|
+
Enabled: true
|
628
|
+
|
147
629
|
Lint/UselessSetterCall:
|
148
630
|
Description: Checks for useless setter call to a local variable.
|
149
631
|
Enabled: true
|
632
|
+
|
150
633
|
Lint/Void:
|
151
634
|
Description: Possible use of operator/literal/variable in void context.
|
152
635
|
Enabled: true
|
636
|
+
|
637
|
+
# Department Metrics
|
153
638
|
Metrics/AbcSize:
|
154
|
-
Description: A calculated magnitude based on number of assignments, branches, and
|
155
|
-
conditions.
|
639
|
+
Description: A calculated magnitude based on number of assignments, branches, and conditions.
|
156
640
|
Reference: http://c2.com/cgi/wiki?AbcMetric
|
157
641
|
Enabled: true
|
158
642
|
Max: 15
|
643
|
+
|
644
|
+
Metrics/BlockLength:
|
645
|
+
Description: Avoid long blocks with many lines.
|
646
|
+
Enabled: true
|
647
|
+
Exclude:
|
648
|
+
- Rakefile
|
649
|
+
- "**/*.rake"
|
650
|
+
- spec/**/*.rb
|
651
|
+
|
159
652
|
Metrics/BlockNesting:
|
160
653
|
Description: Avoid excessive block nesting
|
161
654
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
|
162
655
|
Enabled: true
|
163
656
|
Max: 4
|
657
|
+
|
164
658
|
Metrics/ClassLength:
|
165
659
|
Description: Avoid classes longer than 100 lines of code.
|
166
660
|
Enabled: true
|
167
661
|
Max: 100
|
662
|
+
|
168
663
|
Metrics/CyclomaticComplexity:
|
169
|
-
Description: A complexity metric that is strongly correlated to the number of test
|
170
|
-
cases needed to validate a method.
|
664
|
+
Description: A complexity metric that is strongly correlated to the number of test cases needed to validate a method.
|
171
665
|
Enabled: true
|
666
|
+
|
172
667
|
Metrics/LineLength:
|
173
668
|
Description: Limit lines to 80 characters.
|
174
|
-
StyleGuide:
|
669
|
+
StyleGuide: '#80-character-limits'
|
175
670
|
Enabled: true
|
671
|
+
|
176
672
|
Metrics/MethodLength:
|
177
673
|
Description: Avoid methods longer than 10 lines of code.
|
178
674
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
179
675
|
Enabled: true
|
180
676
|
Max: 10
|
677
|
+
|
181
678
|
Metrics/ModuleLength:
|
182
679
|
Description: Avoid modules longer than 100 lines of code.
|
183
680
|
Enabled: true
|
184
681
|
Max: 100
|
682
|
+
|
185
683
|
Metrics/ParameterLists:
|
186
684
|
Description: Avoid parameter lists longer than three or four parameters.
|
187
685
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
188
686
|
Enabled: false
|
687
|
+
|
189
688
|
Metrics/PerceivedComplexity:
|
190
|
-
Description: A complexity metric geared towards measuring complexity for a human
|
191
|
-
reader.
|
689
|
+
Description: A complexity metric geared towards measuring complexity for a human reader.
|
192
690
|
Enabled: true
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
-
|
691
|
+
|
692
|
+
# Department Naming
|
693
|
+
Naming/AccessorMethodName:
|
694
|
+
Description: Check the naming of accessor methods for get_/set_.
|
695
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#accessor_mutator_method_names
|
696
|
+
Enabled: false
|
697
|
+
|
698
|
+
Naming/AsciiIdentifiers:
|
699
|
+
Description: Use only ascii symbols in identifiers.
|
700
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
|
701
|
+
Enabled: false
|
702
|
+
|
703
|
+
Naming/ClassAndModuleCamelCase:
|
704
|
+
Description: Use CamelCase for classes and modules.
|
705
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
|
706
|
+
Enabled: true
|
707
|
+
|
708
|
+
Naming/ConstantName:
|
709
|
+
Description: Constants should use SCREAMING_SNAKE_CASE.
|
710
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
|
711
|
+
Enabled: true
|
712
|
+
|
713
|
+
Naming/FileName:
|
714
|
+
Description: Use snake_case for source file names.
|
715
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
716
|
+
Enabled: true
|
717
|
+
|
718
|
+
Naming/HeredocDelimiterCase:
|
719
|
+
Description: Use configured case for heredoc delimiters.
|
720
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#heredoc-delimiters
|
721
|
+
Enabled: true
|
722
|
+
|
723
|
+
Naming/HeredocDelimiterNaming:
|
724
|
+
Description: Use descriptive heredoc delimiters.
|
725
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#heredoc-delimiters
|
726
|
+
Enabled: true
|
727
|
+
|
728
|
+
Naming/MethodName:
|
729
|
+
Description: Use the configured style when naming methods.
|
730
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
731
|
+
Enabled: false
|
732
|
+
|
733
|
+
Naming/PredicateName:
|
734
|
+
Description: Check the names of predicate methods.
|
735
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
736
|
+
Enabled: true
|
737
|
+
|
738
|
+
Naming/BinaryOperatorParameterName:
|
739
|
+
Description: When defining binary operators, name the argument other.
|
740
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
|
741
|
+
Enabled: true
|
742
|
+
|
743
|
+
Naming/VariableName:
|
744
|
+
Description: Use the configured style when naming variables.
|
745
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
746
|
+
Enabled: true
|
747
|
+
|
748
|
+
Naming/VariableNumber:
|
749
|
+
Description: Use the configured style when numbering variables.
|
750
|
+
Enabled: true
|
751
|
+
|
752
|
+
# Department Performance
|
753
|
+
Performance/Caller:
|
754
|
+
Description: Use `caller(n..n)` instead of `caller`.
|
755
|
+
Enabled: true
|
756
|
+
|
757
|
+
Performance/Casecmp:
|
758
|
+
Description: Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
|
759
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code
|
760
|
+
Enabled: true
|
761
|
+
|
762
|
+
Performance/CaseWhenSplat:
|
763
|
+
Description: Place `when` conditions that use splat at the end of the list of `when` branches.
|
764
|
+
Enabled: true
|
765
|
+
|
198
766
|
Performance/Count:
|
199
|
-
Description: Use `count` instead of `select...size`, `reject...size`, `select...count`,
|
200
|
-
|
767
|
+
Description: Use `count` instead of `select...size`, `reject...size`, `select...count`, `reject...count`, `select...length`, and `reject...length`.
|
768
|
+
SafeMode: true
|
201
769
|
Enabled: true
|
770
|
+
|
202
771
|
Performance/Detect:
|
203
|
-
Description: Use `detect` instead of `select.first`, `find_all.first`, `select.last`,
|
204
|
-
|
205
|
-
|
772
|
+
Description: Use `detect` instead of `select.first`, `find_all.first`, `select.last`, and `find_all.last`.
|
773
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
774
|
+
SafeMode: true
|
206
775
|
Enabled: true
|
776
|
+
|
777
|
+
Performance/DoubleStartEndWith:
|
778
|
+
Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
|
779
|
+
Enabled: true
|
780
|
+
|
781
|
+
Performance/EndWith:
|
782
|
+
Description: Use `end_with?` instead of a regex match anchored to the end of a string.
|
783
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
784
|
+
AutoCorrect: false
|
785
|
+
Enabled: true
|
786
|
+
|
787
|
+
Performance/FixedSize:
|
788
|
+
Description: Do not compute the size of statically sized objects except in constants
|
789
|
+
Enabled: true
|
790
|
+
|
207
791
|
Performance/FlatMap:
|
208
|
-
Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
|
209
|
-
or `Enumberable#collect..Array#flatten(1)`
|
792
|
+
Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)` or `Enumberable#collect..Array#flatten(1)`
|
210
793
|
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
|
211
794
|
Enabled: true
|
212
795
|
EnabledForFlattenWithoutParams: false
|
796
|
+
|
797
|
+
Performance/HashEachMethods:
|
798
|
+
Description: Use `Hash#each_key` and `Hash#each_value` instead of `Hash#keys.each` and `Hash#values.each`.
|
799
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-each
|
800
|
+
Enabled: true
|
801
|
+
AutoCorrect: false
|
802
|
+
|
803
|
+
Performance/LstripRstrip:
|
804
|
+
Description: Use `strip` instead of `lstrip.rstrip`.
|
805
|
+
Enabled: true
|
806
|
+
|
807
|
+
Performance/RangeInclude:
|
808
|
+
Description: Use `Range#cover?` instead of `Range#include?`.
|
809
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
|
810
|
+
Enabled: true
|
811
|
+
|
812
|
+
Performance/RedundantBlockCall:
|
813
|
+
Description: Use `yield` instead of `block.call`.
|
814
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
|
815
|
+
Enabled: true
|
816
|
+
|
817
|
+
Performance/RedundantMatch:
|
818
|
+
Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where the returned `MatchData` is not needed.
|
819
|
+
Enabled: true
|
820
|
+
|
821
|
+
Performance/RedundantMerge:
|
822
|
+
Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
|
823
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
|
824
|
+
Enabled: true
|
825
|
+
|
826
|
+
Performance/RedundantSortBy:
|
827
|
+
Description: Use `sort` instead of `sort_by { |x| x }`.
|
828
|
+
Enabled: true
|
829
|
+
|
830
|
+
Performance/RegexpMatch:
|
831
|
+
Description: Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`, `Regexp#===`, or `=~` when `MatchData` is not used.
|
832
|
+
Enabled: true
|
833
|
+
|
213
834
|
Performance/ReverseEach:
|
214
835
|
Description: Use `reverse_each` instead of `reverse.each`.
|
215
836
|
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
|
216
837
|
Enabled: true
|
838
|
+
|
217
839
|
Performance/Sample:
|
218
|
-
Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[
|
840
|
+
Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Integer]`.
|
219
841
|
Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code
|
220
842
|
Enabled: true
|
843
|
+
|
221
844
|
Performance/Size:
|
222
|
-
Description: Use `size` instead of `count` for counting the number of elements in
|
223
|
-
`Array` and `Hash`.
|
845
|
+
Description: Use `size` instead of `count` for counting the number of elements in `Array` and `Hash`.
|
224
846
|
Reference: https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
|
225
847
|
Enabled: true
|
848
|
+
|
849
|
+
Performance/CompareWithBlock:
|
850
|
+
Description: Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.
|
851
|
+
Enabled: true
|
852
|
+
|
853
|
+
Performance/StartWith:
|
854
|
+
Description: Use `start_with?` instead of a regex match anchored to the beginning of a string.
|
855
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
856
|
+
AutoCorrect: false
|
857
|
+
Enabled: true
|
858
|
+
|
226
859
|
Performance/StringReplacement:
|
227
|
-
Description: Use `tr` instead of `gsub` when you are replacing the same number of
|
228
|
-
characters. Use `delete` instead of `gsub` when you are deleting characters.
|
860
|
+
Description: Use `tr` instead of `gsub` when you are replacing the same number of characters. Use `delete` instead of `gsub` when you are deleting characters.
|
229
861
|
Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
|
230
862
|
Enabled: true
|
863
|
+
|
864
|
+
Performance/TimesMap:
|
865
|
+
Description: Checks for .times.map calls.
|
866
|
+
AutoCorrect: false
|
867
|
+
Enabled: true
|
868
|
+
|
869
|
+
Performance/UnfreezeString:
|
870
|
+
Description: Use unary plus to get an unfrozen string literal.
|
871
|
+
Enabled: true
|
872
|
+
|
873
|
+
Performance/UriDefaultParser:
|
874
|
+
Description: Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.
|
875
|
+
Enabled: true
|
876
|
+
|
877
|
+
# Department Rails
|
231
878
|
Rails/ActionFilter:
|
232
879
|
Description: Enforces consistent use of action filter methods.
|
233
880
|
Enabled: false
|
881
|
+
|
882
|
+
Rails/ApplicationJob:
|
883
|
+
Description: Check that jobs subclass ApplicationJob.
|
884
|
+
Enabled: true
|
885
|
+
|
886
|
+
Rails/ApplicationRecord:
|
887
|
+
Description: Check that models subclass ApplicationRecord.
|
888
|
+
Enabled: true
|
889
|
+
|
890
|
+
Rails/ActiveSupportAliases:
|
891
|
+
Description: 'Avoid ActiveSupport aliases of standard ruby methods: `String#starts_with?`, `String#ends_with?`, `Array#append`, `Array#prepend`.'
|
892
|
+
Enabled: true
|
893
|
+
|
894
|
+
Rails/Blank:
|
895
|
+
Description: Enforce using `blank?` and `present?`.
|
896
|
+
Enabled: true
|
897
|
+
NilOrEmpty: true
|
898
|
+
NotPresent: true
|
899
|
+
UnlessPresent: true
|
900
|
+
|
234
901
|
Rails/Date:
|
235
|
-
Description: Checks the correct usage of date aware methods, such as Date.today,
|
236
|
-
Date.current etc.
|
902
|
+
Description: Checks the correct usage of date aware methods, such as Date.today, Date.current etc.
|
237
903
|
Enabled: true
|
904
|
+
|
238
905
|
Rails/Delegate:
|
239
906
|
Description: Prefer delegate method for delegations.
|
240
907
|
Enabled: true
|
908
|
+
|
909
|
+
Rails/DelegateAllowBlank:
|
910
|
+
Description: Do not use allow_blank as an option to delegate.
|
911
|
+
Enabled: true
|
912
|
+
|
913
|
+
Rails/DynamicFindBy:
|
914
|
+
Description: Use `find_by` instead of dynamic `find_by_*`.
|
915
|
+
StyleGuide: https://github.com/bbatsov/rails-style-guide#find_by
|
916
|
+
Enabled: true
|
917
|
+
|
918
|
+
Rails/EnumUniqueness:
|
919
|
+
Description: Avoid duplicate integers in hash-syntax `enum` declaration.
|
920
|
+
Enabled: true
|
921
|
+
|
922
|
+
Rails/Exit:
|
923
|
+
Description: Favor `fail`, `break`, `return`, etc. over `exit` in application or library code outside of Rake files to avoid exits during unit testing or running in production.
|
924
|
+
Enabled: true
|
925
|
+
|
926
|
+
Rails/FilePath:
|
927
|
+
Description: Use `Rails.root.join` for file path joining.
|
928
|
+
Enabled: true
|
929
|
+
|
241
930
|
Rails/FindBy:
|
242
931
|
Description: Prefer find_by over where.first.
|
932
|
+
StyleGuide: https://github.com/bbatsov/rails-style-guide#find_by
|
243
933
|
Enabled: true
|
934
|
+
|
244
935
|
Rails/FindEach:
|
245
936
|
Description: Prefer all.find_each over all.find.
|
937
|
+
StyleGuide: https://github.com/bbatsov/rails-style-guide#find-each
|
246
938
|
Enabled: true
|
939
|
+
|
247
940
|
Rails/HasAndBelongsToMany:
|
248
941
|
Description: Prefer has_many :through to has_and_belongs_to_many.
|
942
|
+
StyleGuide: https://github.com/bbatsov/rails-style-guide#has-many-through
|
943
|
+
Enabled: true
|
944
|
+
|
945
|
+
Rails/HasManyOrHasOneDependent:
|
946
|
+
Description: Define the dependent option to the has_many and has_one associations.
|
947
|
+
StyleGuide: https://github.com/bbatsov/rails-style-guide#has_many-has_one-dependent-option
|
249
948
|
Enabled: true
|
949
|
+
|
950
|
+
Rails/HttpPositionalArguments:
|
951
|
+
Description: Use keyword arguments instead of positional arguments in http method calls.
|
952
|
+
Enabled: true
|
953
|
+
|
954
|
+
Rails/NotNullColumn:
|
955
|
+
Description: Do not add a NOT NULL column without a default value
|
956
|
+
Enabled: true
|
957
|
+
|
250
958
|
Rails/Output:
|
251
959
|
Description: Checks for calls to puts, print, etc.
|
252
960
|
Enabled: true
|
961
|
+
|
962
|
+
Rails/OutputSafety:
|
963
|
+
Description: The use of `html_safe` or `raw` may be a security risk.
|
964
|
+
Enabled: true
|
965
|
+
|
966
|
+
Rails/PluralizationGrammar:
|
967
|
+
Description: Checks for incorrect grammar when using methods like `3.day.ago`.
|
968
|
+
Enabled: true
|
969
|
+
|
970
|
+
Rails/Present:
|
971
|
+
Description: Enforce using `blank?` and `present?`.
|
972
|
+
Enabled: true
|
973
|
+
NotNilAndNotEmpty: true
|
974
|
+
NotBlank: true
|
975
|
+
UnlessBlank: true
|
976
|
+
|
253
977
|
Rails/ReadWriteAttribute:
|
254
978
|
Description: Checks for read_attribute(:attr) and write_attribute(:attr, val).
|
979
|
+
StyleGuide: https://github.com/bbatsov/rails-style-guide#read-attribute
|
980
|
+
Enabled: false
|
981
|
+
|
982
|
+
Rails/RelativeDateConstant:
|
983
|
+
Description: Do not assign relative date to constants.
|
984
|
+
Enabled: true
|
985
|
+
|
986
|
+
Rails/RequestReferer:
|
987
|
+
Description: Use consistent syntax for request.referer.
|
988
|
+
Enabled: true
|
989
|
+
|
990
|
+
Rails/ReversibleMigration:
|
991
|
+
Description: Checks whether the change method of the migration file is reversible.
|
992
|
+
StyleGuide: https://github.com/bbatsov/rails-style-guide#reversible-migration
|
993
|
+
Reference: http://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html
|
994
|
+
Enabled: true
|
995
|
+
|
996
|
+
Rails/SafeNavigation:
|
997
|
+
Description: Use Ruby's safe navigation operator (`&.`) instead of `try!`
|
998
|
+
Enabled: true
|
999
|
+
|
1000
|
+
Rails/SaveBang:
|
1001
|
+
Description: Identifies possible cases where Active Record save! or related should be used.
|
1002
|
+
StyleGuide: https://github.com/bbatsov/rails-style-guide#save-bang
|
255
1003
|
Enabled: false
|
1004
|
+
|
256
1005
|
Rails/ScopeArgs:
|
257
1006
|
Description: Checks the arguments of ActiveRecord scopes.
|
258
1007
|
Enabled: true
|
1008
|
+
|
259
1009
|
Rails/TimeZone:
|
260
1010
|
Description: Checks the correct usage of time zone aware methods.
|
261
1011
|
StyleGuide: https://github.com/bbatsov/rails-style-guide#time
|
262
1012
|
Reference: http://danilenko.org/2012/7/6/rails_timezones
|
263
1013
|
Enabled: true
|
264
|
-
|
265
|
-
|
1014
|
+
|
1015
|
+
Rails/UniqBeforePluck:
|
1016
|
+
Description: Prefer the use of uniq or distinct before pluck.
|
1017
|
+
Enabled: true
|
1018
|
+
|
1019
|
+
Rails/UnknownEnv:
|
1020
|
+
Description: Use correct environment name.
|
1021
|
+
Enabled: true
|
1022
|
+
|
1023
|
+
Rails/SkipsModelValidations:
|
1024
|
+
Description: Use methods that skips model validations with caution. See reference for more information.
|
1025
|
+
Reference: http://guides.rubyonrails.org/active_record_validations.html#skipping-validations
|
1026
|
+
Enabled: true
|
1027
|
+
|
1028
|
+
Rails/Validation:
|
1029
|
+
Description: Use validates :attribute, hash of validations.
|
1030
|
+
Enabled: true
|
1031
|
+
|
1032
|
+
# Department Security
|
1033
|
+
Security/Eval:
|
1034
|
+
Description: The use of eval represents a serious security risk.
|
1035
|
+
Enabled: true
|
1036
|
+
|
1037
|
+
Security/JSONLoad:
|
1038
|
+
Description: Prefer usage of `JSON.parse` over `JSON.load` due to potential security issues. See reference for more information.
|
1039
|
+
Reference: http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load
|
266
1040
|
Enabled: true
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
1041
|
+
AutoCorrect: false
|
1042
|
+
|
1043
|
+
Security/MarshalLoad:
|
1044
|
+
Description: Avoid using of `Marshal.load` or `Marshal.restore` due to potential security issues. See reference for more information.
|
1045
|
+
Reference: http://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations
|
1046
|
+
Enabled: true
|
1047
|
+
|
1048
|
+
Security/YAMLLoad:
|
1049
|
+
Description: Prefer usage of `YAML.safe_load` over `YAML.load` due to potential security issues. See reference for more information.
|
1050
|
+
Reference: https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security
|
1051
|
+
Enabled: true
|
1052
|
+
|
1053
|
+
# Department Style
|
274
1054
|
Style/Alias:
|
275
|
-
Description: Use
|
1055
|
+
Description: Use alias instead of alias_method.
|
276
1056
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
277
1057
|
Enabled: false
|
278
|
-
|
279
|
-
Description: Align the elements of an array literal if they span more than one line.
|
280
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays
|
281
|
-
Enabled: true
|
282
|
-
Layout/AlignHash:
|
283
|
-
Description: Align the elements of a hash literal if they span more than one line.
|
284
|
-
Enabled: true
|
285
|
-
Layout/AlignParameters:
|
286
|
-
Description: Align the parameters of a method call if they span more than one line.
|
287
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
|
288
|
-
Enabled: true
|
1058
|
+
|
289
1059
|
Style/AndOr:
|
290
1060
|
Description: Use &&/|| instead of and/or.
|
291
1061
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-and-or-or
|
292
1062
|
Enabled: true
|
1063
|
+
|
293
1064
|
Style/ArrayJoin:
|
294
1065
|
Description: Use Array#join instead of Array#*.
|
295
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
|
1066
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join'
|
296
1067
|
Enabled: false
|
1068
|
+
|
297
1069
|
Style/AsciiComments:
|
298
1070
|
Description: Use only ascii symbols in comments.
|
299
1071
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
|
300
1072
|
Enabled: false
|
301
|
-
|
302
|
-
Description: Use only ascii symbols in identifiers.
|
303
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
|
304
|
-
Enabled: false
|
1073
|
+
|
305
1074
|
Style/Attr:
|
306
1075
|
Description: Checks for uses of Module#attr.
|
307
1076
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
|
308
1077
|
Enabled: true
|
1078
|
+
|
1079
|
+
Style/AutoResourceCleanup:
|
1080
|
+
Description: Suggests the usage of an auto resource cleanup version of a method (if available).
|
1081
|
+
Enabled: false
|
1082
|
+
|
309
1083
|
Style/BeginBlock:
|
310
1084
|
Description: Avoid the use of BEGIN blocks.
|
311
1085
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks
|
312
1086
|
Enabled: true
|
1087
|
+
|
313
1088
|
Style/BarePercentLiterals:
|
314
1089
|
Description: Checks if usage of %() or %Q() matches configuration.
|
315
1090
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand
|
316
1091
|
Enabled: true
|
1092
|
+
|
317
1093
|
Style/BlockComments:
|
318
1094
|
Description: Do not use block comments.
|
319
1095
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
|
320
1096
|
Enabled: false
|
321
|
-
|
322
|
-
Description: Put end statement of multiline block on its own line.
|
323
|
-
Enabled: true
|
1097
|
+
|
324
1098
|
Style/BlockDelimiters:
|
325
|
-
Description: Avoid using {...} for multi-line blocks (multiline chaining is always
|
326
|
-
ugly). Prefer {...} over do...end for single-line blocks.
|
1099
|
+
Description: Avoid using {...} for multi-line blocks (multiline chaining is always ugly). Prefer {...} over do...end for single-line blocks.
|
327
1100
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
328
1101
|
Enabled: true
|
1102
|
+
|
329
1103
|
Style/BracesAroundHashParameters:
|
330
1104
|
Description: Enforce braces style around hash parameters.
|
331
1105
|
Enabled: false
|
1106
|
+
|
332
1107
|
Style/CaseEquality:
|
333
1108
|
Description: Avoid explicit use of the case equality operator(===).
|
334
1109
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
|
335
1110
|
Enabled: false
|
336
|
-
|
337
|
-
Description: Indentation of when in a case/when/[else/]end.
|
338
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#indent-when-to-case
|
339
|
-
Enabled: true
|
1111
|
+
|
340
1112
|
Style/CharacterLiteral:
|
341
1113
|
Description: Checks for uses of character literals.
|
342
1114
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
|
343
1115
|
Enabled: false
|
344
|
-
|
345
|
-
Description: Use CamelCase for classes and modules.
|
346
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
|
347
|
-
Enabled: true
|
1116
|
+
|
348
1117
|
Style/ClassAndModuleChildren:
|
349
1118
|
Description: Checks style of children classes and modules.
|
1119
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#namespace-definition
|
350
1120
|
Enabled: false
|
1121
|
+
|
351
1122
|
Style/ClassCheck:
|
352
1123
|
Description: Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.
|
353
1124
|
Enabled: true
|
1125
|
+
|
354
1126
|
Style/ClassMethods:
|
355
1127
|
Description: Use self when defining module/class methods.
|
356
1128
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-class-methods
|
357
1129
|
Enabled: false
|
1130
|
+
|
358
1131
|
Style/ClassVars:
|
359
1132
|
Description: Avoid the use of class variables.
|
360
1133
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
|
361
1134
|
Enabled: false
|
362
|
-
|
363
|
-
|
1135
|
+
|
1136
|
+
Style/CollectionMethods:
|
1137
|
+
Description: Preferred collection methods.
|
1138
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
364
1139
|
Enabled: false
|
1140
|
+
|
365
1141
|
Style/ColonMethodCall:
|
366
1142
|
Description: 'Do not use :: for method call.'
|
367
1143
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
|
368
1144
|
Enabled: true
|
1145
|
+
|
369
1146
|
Style/CommandLiteral:
|
370
1147
|
Description: Use `` or %x around command literals.
|
371
1148
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-x
|
372
1149
|
Enabled: false
|
1150
|
+
|
373
1151
|
Style/CommentAnnotation:
|
374
|
-
Description: Checks formatting of
|
1152
|
+
Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
375
1153
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
|
376
1154
|
Enabled: false
|
377
|
-
|
378
|
-
|
1155
|
+
|
1156
|
+
Style/CommentedKeyword:
|
1157
|
+
Description: Do not place comments on the same line as certain keywords.
|
379
1158
|
Enabled: false
|
380
|
-
|
381
|
-
|
382
|
-
|
1159
|
+
|
1160
|
+
Style/ConditionalAssignment:
|
1161
|
+
Description: Use the return value of `if` and `case` statements for assignment to a variable and variable comparison instead of assigning that variable inside of each branch.
|
383
1162
|
Enabled: true
|
1163
|
+
|
1164
|
+
Style/Copyright:
|
1165
|
+
Description: Include a copyright notice in each file before any code.
|
1166
|
+
Enabled: false
|
1167
|
+
|
1168
|
+
Style/DateTime:
|
1169
|
+
Description: Use Date or Time over DateTime.
|
1170
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#date--time
|
1171
|
+
Enabled: false
|
1172
|
+
|
384
1173
|
Style/DefWithParentheses:
|
385
1174
|
Description: Use def with parentheses when there are arguments.
|
386
1175
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
387
1176
|
Enabled: true
|
1177
|
+
|
1178
|
+
Style/Dir:
|
1179
|
+
Description: Use the `__dir__` method to retrieve the canonicalized absolute path to the current file.
|
1180
|
+
Enabled: true
|
1181
|
+
|
388
1182
|
Style/Documentation:
|
389
1183
|
Description: Document classes and non-namespace modules.
|
390
1184
|
Enabled: false
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
1185
|
+
Exclude:
|
1186
|
+
- 'spec/**/*'
|
1187
|
+
- 'test/**/*'
|
1188
|
+
|
1189
|
+
Style/DocumentationMethod:
|
1190
|
+
Description: Public methods.
|
1191
|
+
Enabled: false
|
1192
|
+
Exclude:
|
1193
|
+
- 'spec/**/*'
|
1194
|
+
- 'test/**/*'
|
1195
|
+
|
395
1196
|
Style/DoubleNegation:
|
396
1197
|
Description: Checks for uses of double negation (!!).
|
397
1198
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
398
1199
|
Enabled: true
|
1200
|
+
|
1201
|
+
Style/EachForSimpleLoop:
|
1202
|
+
Description: Use `Integer#times` for a simple loop which iterates a fixed number of times.
|
1203
|
+
Enabled: true
|
1204
|
+
|
399
1205
|
Style/EachWithObject:
|
400
1206
|
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
401
1207
|
Enabled: false
|
402
|
-
|
403
|
-
Description: Align elses and elsifs correctly.
|
404
|
-
Enabled: true
|
1208
|
+
|
405
1209
|
Style/EmptyElse:
|
406
1210
|
Description: Avoid empty else-clauses.
|
407
1211
|
Enabled: true
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
Enabled: true
|
412
|
-
Layout/EmptyLines:
|
413
|
-
Description: Don't use several empty lines in a row.
|
1212
|
+
|
1213
|
+
Style/EmptyCaseCondition:
|
1214
|
+
Description: Avoid empty condition in case statements.
|
414
1215
|
Enabled: true
|
415
|
-
|
416
|
-
Description: Keep blank lines around access modifiers.
|
417
|
-
Enabled: false
|
418
|
-
Layout/EmptyLinesAroundBlockBody:
|
419
|
-
Description: Keeps track of empty lines around block bodies.
|
420
|
-
Enabled: false
|
421
|
-
Layout/EmptyLinesAroundClassBody:
|
422
|
-
Description: Keeps track of empty lines around class bodies.
|
423
|
-
Enabled: false
|
424
|
-
Layout/EmptyLinesAroundModuleBody:
|
425
|
-
Description: Keeps track of empty lines around module bodies.
|
426
|
-
Enabled: false
|
427
|
-
Layout/EmptyLinesAroundMethodBody:
|
428
|
-
Description: Keeps track of empty lines around method bodies.
|
429
|
-
Enabled: false
|
1216
|
+
|
430
1217
|
Style/EmptyLiteral:
|
431
1218
|
Description: Prefer literals to Array.new/Hash.new/String.new.
|
432
1219
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
433
1220
|
Enabled: false
|
1221
|
+
|
1222
|
+
Style/EmptyMethod:
|
1223
|
+
Description: Checks the formatting of empty method definitions.
|
1224
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
1225
|
+
Enabled: false
|
1226
|
+
|
434
1227
|
Style/EndBlock:
|
435
1228
|
Description: Avoid the use of END blocks.
|
436
1229
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
|
437
1230
|
Enabled: false
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
1231
|
+
|
1232
|
+
Style/Encoding:
|
1233
|
+
Description: Use UTF-8 as the source file encoding.
|
1234
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#utf-8
|
1235
|
+
Enabled: true
|
1236
|
+
|
442
1237
|
Style/EvenOdd:
|
443
|
-
Description: Favor the use of
|
1238
|
+
Description: Favor the use of Integer#even? && Integer#odd?
|
444
1239
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
445
1240
|
Enabled: true
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
Style/FileName:
|
450
|
-
Description: Use snake_case for source file names.
|
451
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
1241
|
+
|
1242
|
+
Style/FrozenStringLiteralComment:
|
1243
|
+
Description: Add the frozen_string_literal comment to the top of files to help transition from Ruby 2.3.0 to Ruby 3.0.
|
452
1244
|
Enabled: true
|
453
|
-
|
454
|
-
Description: Checks the indentation of the first non-blank non-comment line in a
|
455
|
-
file.
|
456
|
-
Enabled: false
|
457
|
-
Layout/FirstParameterIndentation:
|
458
|
-
Description: Checks the indentation of the first parameter in a method call.
|
459
|
-
Enabled: false
|
1245
|
+
|
460
1246
|
Style/FlipFlop:
|
461
1247
|
Description: Checks for flip flops
|
462
1248
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
|
463
1249
|
Enabled: true
|
1250
|
+
|
464
1251
|
Style/For:
|
465
1252
|
Description: Checks use of for or each in multiline loops.
|
466
1253
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-for-loops
|
467
1254
|
Enabled: true
|
1255
|
+
|
468
1256
|
Style/FormatString:
|
469
1257
|
Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
|
470
1258
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
|
471
1259
|
Enabled: false
|
1260
|
+
|
1261
|
+
Style/FormatStringToken:
|
1262
|
+
Description: Use a consistent style for format string tokens.
|
1263
|
+
Enabled: true
|
1264
|
+
|
472
1265
|
Style/GlobalVars:
|
473
1266
|
Description: Do not introduce global variables.
|
474
1267
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
|
475
1268
|
Reference: http://www.zenspider.com/Languages/Ruby/QuickRef.html
|
476
1269
|
Enabled: true
|
1270
|
+
|
477
1271
|
Style/GuardClause:
|
478
1272
|
Description: Check for conditionals that can be replaced with guard clauses
|
479
1273
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
480
1274
|
Enabled: true
|
1275
|
+
|
481
1276
|
Style/HashSyntax:
|
482
|
-
Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a =>
|
483
|
-
1, :b => 2 }.'
|
1277
|
+
Description: 'Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax { :a => 1, :b => 2 }.'
|
484
1278
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-literals
|
485
1279
|
Enabled: true
|
1280
|
+
|
1281
|
+
Style/IfInsideElse:
|
1282
|
+
Description: Finds if nodes inside else, which can be converted to elsif.
|
1283
|
+
Enabled: true
|
1284
|
+
|
486
1285
|
Style/IfUnlessModifier:
|
487
1286
|
Description: Favor modifier if/unless usage when you have a single-line body.
|
488
1287
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
489
1288
|
Enabled: true
|
1289
|
+
|
1290
|
+
Style/IfUnlessModifierOfIfUnless:
|
1291
|
+
Description: Avoid modifier if/unless usage on conditionals.
|
1292
|
+
Enabled: true
|
1293
|
+
|
490
1294
|
Style/IfWithSemicolon:
|
491
1295
|
Description: Do not use if x; .... Use the ternary operator instead.
|
492
1296
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
|
493
1297
|
Enabled: true
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
Layout/IndentationWidth:
|
498
|
-
Description: Use 2 spaces for indentation.
|
499
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
|
1298
|
+
|
1299
|
+
Style/IdenticalConditionalBranches:
|
1300
|
+
Description: Checks that conditional statements do not have an identical line at the end of each branch, which can validly be moved out of the conditional.
|
500
1301
|
Enabled: true
|
501
|
-
|
502
|
-
Description: Checks the indentation of the first element in an array literal.
|
503
|
-
Enabled: false
|
504
|
-
Layout/IndentHash:
|
505
|
-
Description: Checks the indentation of the first key in a hash literal.
|
506
|
-
Enabled: false
|
1302
|
+
|
507
1303
|
Style/InfiniteLoop:
|
508
1304
|
Description: Use Kernel#loop for infinite loops.
|
509
1305
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
|
510
1306
|
Enabled: true
|
1307
|
+
|
1308
|
+
Style/InlineComment:
|
1309
|
+
Description: Avoid trailing inline comments.
|
1310
|
+
Enabled: false
|
1311
|
+
|
1312
|
+
Style/InverseMethods:
|
1313
|
+
Description: Use the inverse method instead of `!.method` if an inverse method is defined.
|
1314
|
+
Enabled: true
|
1315
|
+
|
1316
|
+
Style/ImplicitRuntimeError:
|
1317
|
+
Description: Use `raise` or `fail` with an explicit exception class and message, rather than just a message.
|
1318
|
+
Enabled: false
|
1319
|
+
|
511
1320
|
Style/Lambda:
|
512
1321
|
Description: Use the new lambda literal syntax for single-line blocks.
|
513
1322
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
|
514
1323
|
Enabled: true
|
1324
|
+
|
515
1325
|
Style/LambdaCall:
|
516
1326
|
Description: Use lambda.call(...) instead of lambda.(...).
|
517
1327
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
|
518
1328
|
Enabled: false
|
519
|
-
|
520
|
-
Description: Comments should start with a space.
|
521
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-space
|
522
|
-
Enabled: true
|
1329
|
+
|
523
1330
|
Style/LineEndConcatenation:
|
524
|
-
Description: Use \ instead of + or << to concatenate two string literals at line
|
525
|
-
end.
|
1331
|
+
Description: Use \ instead of + or << to concatenate two string literals at line end.
|
526
1332
|
Enabled: true
|
1333
|
+
|
527
1334
|
Style/MethodCallWithoutArgsParentheses:
|
528
1335
|
Description: Do not use parentheses for method calls with no arguments.
|
529
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#
|
1336
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-invocation-parens
|
530
1337
|
Enabled: true
|
1338
|
+
|
1339
|
+
Style/MethodCallWithArgsParentheses:
|
1340
|
+
Description: Use parentheses for method calls with arguments.
|
1341
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-invocation-parens
|
1342
|
+
Enabled: false
|
1343
|
+
|
1344
|
+
Style/MethodCalledOnDoEndBlock:
|
1345
|
+
Description: Avoid chaining a method call on a do...end block.
|
1346
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
1347
|
+
Enabled: false
|
1348
|
+
|
531
1349
|
Style/MethodDefParentheses:
|
532
1350
|
Description: Checks if the method definitions have or don't have parentheses.
|
533
1351
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#method-parens
|
534
1352
|
Enabled: true
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
1353
|
+
|
1354
|
+
Style/MethodMissing:
|
1355
|
+
Description: Avoid using `method_missing`.
|
1356
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-method-missing
|
1357
|
+
Enabled: true
|
1358
|
+
|
1359
|
+
Style/MinMax:
|
1360
|
+
Description: Use `Enumerable#minmax` instead of `Enumerable#min` and `Enumerable#max` in conjunction.'
|
1361
|
+
Enabled: true
|
1362
|
+
|
1363
|
+
Style/MissingElse:
|
1364
|
+
Description: Require if/case expressions to have an else branches. If enabled, it is recommended that Style/UnlessElse and Style/EmptyElse be enabled. This will conflict with Style/EmptyElse if Style/EmptyElse is configured to style "both"
|
1365
|
+
Enabled: false
|
1366
|
+
EnforcedStyle: both
|
1367
|
+
SupportedStyles:
|
1368
|
+
- if
|
1369
|
+
- case
|
1370
|
+
- both
|
1371
|
+
|
1372
|
+
Style/MixinGrouping:
|
1373
|
+
Description: Checks for grouping of mixins in `class` and `module` bodies.
|
1374
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#mixin-grouping
|
1375
|
+
Enabled: true
|
1376
|
+
|
539
1377
|
Style/ModuleFunction:
|
540
1378
|
Description: Checks for usage of `extend self` in modules.
|
541
1379
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
542
1380
|
Enabled: true
|
1381
|
+
|
543
1382
|
Style/MultilineBlockChain:
|
544
1383
|
Description: Avoid multi-line chains of blocks.
|
545
1384
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
|
546
1385
|
Enabled: false
|
547
|
-
|
548
|
-
Description: Ensures newlines after multiline block do statements.
|
549
|
-
Enabled: true
|
1386
|
+
|
550
1387
|
Style/MultilineIfThen:
|
551
1388
|
Description: Do not use then for multi-line if/unless.
|
552
1389
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-then
|
553
1390
|
Enabled: true
|
554
|
-
|
555
|
-
|
556
|
-
|
1391
|
+
|
1392
|
+
Style/MultilineIfModifier:
|
1393
|
+
Description: Only use if/unless modifiers on single line statements.
|
1394
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-if-modifiers
|
1395
|
+
Enabled: true
|
1396
|
+
|
1397
|
+
Style/MultilineMemoization:
|
1398
|
+
Description: Wrap multiline memoizations in a `begin` and `end` block.
|
1399
|
+
Enabled: true
|
1400
|
+
|
557
1401
|
Style/MultilineTernaryOperator:
|
558
1402
|
Description: 'Avoid multi-line ?: (the ternary operator); use if/unless instead.'
|
559
1403
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary
|
560
1404
|
Enabled: true
|
1405
|
+
|
1406
|
+
Style/MultipleComparison:
|
1407
|
+
Description: Avoid comparing a variable with multiple items in a conditional, use Array#include? instead.
|
1408
|
+
Enabled: true
|
1409
|
+
|
1410
|
+
Style/MutableConstant:
|
1411
|
+
Description: Do not assign mutable objects to constants.
|
1412
|
+
Enabled: true
|
1413
|
+
|
561
1414
|
Style/NegatedIf:
|
562
1415
|
Description: Favor unless over if for negative conditions (or control flow or).
|
563
1416
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
|
564
1417
|
Enabled: true
|
1418
|
+
|
565
1419
|
Style/NegatedWhile:
|
566
1420
|
Description: Favor until over while for negative conditions.
|
567
1421
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
|
568
1422
|
Enabled: true
|
1423
|
+
|
1424
|
+
Style/NestedModifier:
|
1425
|
+
Description: Avoid using nested modifiers.
|
1426
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers
|
1427
|
+
Enabled: true
|
1428
|
+
|
1429
|
+
Style/NestedParenthesizedCalls:
|
1430
|
+
Description: Parenthesize method calls which are nested inside the argument list of another parenthesized method call.
|
1431
|
+
Enabled: true
|
1432
|
+
|
569
1433
|
Style/NestedTernaryOperator:
|
570
1434
|
Description: Use one expression per branch in a ternary operator.
|
571
1435
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-ternary
|
572
1436
|
Enabled: true
|
1437
|
+
|
573
1438
|
Style/Next:
|
574
1439
|
Description: Use `next` to skip iteration instead of a condition at the end.
|
575
1440
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
576
1441
|
Enabled: true
|
1442
|
+
|
577
1443
|
Style/NilComparison:
|
578
|
-
Description: Prefer x.nil? to x == nil.
|
579
|
-
StyleGuide:
|
1444
|
+
Description: 'Prefer x.nil? to x == nil.'
|
1445
|
+
StyleGuide: '#predicate-methods'
|
580
1446
|
Enabled: true
|
1447
|
+
|
581
1448
|
Style/NonNilCheck:
|
582
1449
|
Description: Checks for redundant nil checks.
|
583
1450
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks
|
584
1451
|
Enabled: true
|
1452
|
+
|
585
1453
|
Style/Not:
|
586
1454
|
Description: Use ! instead of not.
|
587
1455
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
|
588
1456
|
Enabled: true
|
1457
|
+
|
589
1458
|
Style/NumericLiterals:
|
590
1459
|
Description: Add underscores to large numeric literals to improve their readability.
|
591
1460
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
|
592
1461
|
Enabled: true
|
1462
|
+
|
1463
|
+
Style/NumericLiteralPrefix:
|
1464
|
+
Description: Use smallcase prefixes for numeric literals.
|
1465
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#numeric-literal-prefixes
|
1466
|
+
Enabled: true
|
1467
|
+
|
1468
|
+
Style/NumericPredicate:
|
1469
|
+
Description: Checks for the use of predicate- or comparison methods for numeric comparisons.
|
1470
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
|
1471
|
+
AutoCorrect: false
|
1472
|
+
Enabled: true
|
1473
|
+
|
593
1474
|
Style/OneLineConditional:
|
594
1475
|
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
595
1476
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
596
1477
|
Enabled: false
|
597
|
-
|
598
|
-
Description: When defining binary operators, name the argument other.
|
599
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
|
600
|
-
Enabled: false
|
1478
|
+
|
601
1479
|
Style/OptionalArguments:
|
602
|
-
Description: Checks for optional arguments that do not appear at the end of the
|
603
|
-
argument list
|
1480
|
+
Description: Checks for optional arguments that do not appear at the end of the argument list
|
604
1481
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#optional-arguments
|
605
1482
|
Enabled: false
|
1483
|
+
|
1484
|
+
Style/OptionHash:
|
1485
|
+
Description: Don't use option hashes when you can use keyword arguments.
|
1486
|
+
Enabled: false
|
1487
|
+
|
1488
|
+
Style/OrAssignment:
|
1489
|
+
Description: Recommend usage of double pipe equals (||=) where applicable.
|
1490
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-pipe-for-uninit
|
1491
|
+
Enabled: true
|
1492
|
+
|
606
1493
|
Style/ParallelAssignment:
|
607
|
-
Description: Check for simple usages of parallel assignment. It will only warn when
|
608
|
-
the number of variables matches on both sides of the assignment. This also provides
|
609
|
-
performance benefits
|
1494
|
+
Description: Check for simple usages of parallel assignment. It will only warn when the number of variables matches on both sides of the assignment.
|
610
1495
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parallel-assignment
|
611
1496
|
Enabled: false
|
1497
|
+
|
612
1498
|
Style/ParenthesesAroundCondition:
|
613
1499
|
Description: Don't use parentheses around the condition of an if/unless/while.
|
614
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-
|
1500
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-parens-around-condition
|
615
1501
|
Enabled: true
|
1502
|
+
|
616
1503
|
Style/PercentLiteralDelimiters:
|
617
1504
|
Description: Use `%`-literal delimiters consistently
|
618
1505
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
619
1506
|
Enabled: true
|
620
|
-
|
621
|
-
default: ()
|
622
|
-
'%i': '()'
|
623
|
-
'%I': '()'
|
624
|
-
'%r': '{}'
|
625
|
-
'%w': '()'
|
626
|
-
'%W': '()'
|
1507
|
+
|
627
1508
|
Style/PercentQLiterals:
|
628
1509
|
Description: Checks if uses of %Q/%q match the configured preference.
|
629
1510
|
Enabled: true
|
1511
|
+
|
630
1512
|
Style/PerlBackrefs:
|
631
1513
|
Description: Avoid Perl-style regex back references.
|
632
1514
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
633
1515
|
Enabled: false
|
634
|
-
|
635
|
-
|
636
|
-
|
1516
|
+
|
1517
|
+
Style/PreferredHashMethods:
|
1518
|
+
Description: Checks use of `has_key?` and `has_value?` Hash methods.
|
1519
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-key
|
637
1520
|
Enabled: true
|
1521
|
+
|
638
1522
|
Style/Proc:
|
639
1523
|
Description: Use proc instead of Proc.new.
|
640
1524
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
|
641
1525
|
Enabled: true
|
1526
|
+
|
642
1527
|
Style/RaiseArgs:
|
643
1528
|
Description: Checks the arguments passed to raise/fail.
|
644
1529
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
645
1530
|
Enabled: false
|
1531
|
+
|
646
1532
|
Style/RedundantBegin:
|
647
1533
|
Description: Don't use begin blocks when they are not needed.
|
648
1534
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#begin-implicit
|
649
1535
|
Enabled: true
|
1536
|
+
|
1537
|
+
Style/RedundantConditional:
|
1538
|
+
Description: Don't return true/false from a conditional.
|
1539
|
+
Enabled: true
|
1540
|
+
|
650
1541
|
Style/RedundantException:
|
651
1542
|
Description: Checks for an obsolete RuntimeException argument in raise/fail.
|
652
1543
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror
|
653
1544
|
Enabled: true
|
1545
|
+
|
1546
|
+
Style/RedundantFreeze:
|
1547
|
+
Description: Checks usages of Object#freeze on immutable objects.
|
1548
|
+
Enabled: true
|
1549
|
+
|
1550
|
+
Style/RedundantParentheses:
|
1551
|
+
Description: Checks for parentheses that seem not to serve any purpose.
|
1552
|
+
Enabled: true
|
1553
|
+
|
654
1554
|
Style/RedundantReturn:
|
655
1555
|
Description: Don't use return where it's not required.
|
656
1556
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-explicit-return
|
657
1557
|
Enabled: true
|
1558
|
+
|
658
1559
|
Style/RedundantSelf:
|
659
1560
|
Description: Don't use self where it's not needed.
|
660
1561
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-self-unless-required
|
661
1562
|
Enabled: true
|
1563
|
+
|
662
1564
|
Style/RegexpLiteral:
|
663
1565
|
Description: Use / or %r around regular expressions.
|
664
1566
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r
|
665
1567
|
Enabled: false
|
666
|
-
|
667
|
-
Description: Align rescues and ensures correctly.
|
668
|
-
Enabled: false
|
1568
|
+
|
669
1569
|
Style/RescueModifier:
|
670
1570
|
Description: Avoid using rescue in its modifier form.
|
671
1571
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers
|
672
1572
|
Enabled: false
|
1573
|
+
|
1574
|
+
Style/RescueStandardError:
|
1575
|
+
Description: Avoid rescuing without specifying an error class.
|
1576
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
|
1577
|
+
Enabled: true
|
1578
|
+
|
1579
|
+
Style/ReturnNil:
|
1580
|
+
Description: Use return instead of return nil.
|
1581
|
+
Enabled: false
|
1582
|
+
|
1583
|
+
Style/SafeNavigation:
|
1584
|
+
Description: This cop transforms usages of a method call safeguarded by a check for the existance of the object to safe navigation (`&.`).
|
1585
|
+
Enabled: true
|
1586
|
+
|
673
1587
|
Style/SelfAssignment:
|
674
|
-
Description: Checks for places where self-assignment shorthand should have been
|
675
|
-
used.
|
1588
|
+
Description: Checks for places where self-assignment shorthand should have been used.
|
676
1589
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
|
677
1590
|
Enabled: true
|
1591
|
+
|
678
1592
|
Style/Semicolon:
|
679
1593
|
Description: Don't use semicolons to terminate expressions.
|
680
1594
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon
|
681
1595
|
Enabled: true
|
1596
|
+
|
1597
|
+
Style/Send:
|
1598
|
+
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.
|
1599
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
1600
|
+
Enabled: false
|
1601
|
+
|
682
1602
|
Style/SignalException:
|
683
1603
|
Description: Checks for proper usage of fail and raise.
|
684
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail
|
1604
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail
|
685
1605
|
Enabled: true
|
1606
|
+
|
686
1607
|
Style/SingleLineBlockParams:
|
687
1608
|
Description: Enforces the names of some block params.
|
688
|
-
|
689
|
-
|
1609
|
+
Enabled: false
|
1610
|
+
|
690
1611
|
Style/SingleLineMethods:
|
691
1612
|
Description: Avoid single-line methods.
|
692
1613
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
693
1614
|
Enabled: false
|
694
|
-
|
695
|
-
Description: Checks that exactly one space is used between a method name and the
|
696
|
-
first argument for method calls without parentheses.
|
697
|
-
Enabled: true
|
698
|
-
Layout/SpaceAfterColon:
|
699
|
-
Description: Use spaces after colons.
|
700
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
701
|
-
Enabled: true
|
702
|
-
Layout/SpaceAfterComma:
|
703
|
-
Description: Use spaces after commas.
|
704
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
705
|
-
Enabled: true
|
706
|
-
Layout/SpaceAroundKeyword:
|
707
|
-
Description: Use spaces around keywords.
|
708
|
-
Enabled: true
|
709
|
-
Layout/SpaceAfterMethodName:
|
710
|
-
Description: Do not put a space between a method name and the opening parenthesis
|
711
|
-
in a method definition.
|
712
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
713
|
-
Enabled: true
|
714
|
-
Layout/SpaceAfterNot:
|
715
|
-
Description: Tracks redundant space after the ! operator.
|
716
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
|
717
|
-
Enabled: false
|
718
|
-
Layout/SpaceAfterSemicolon:
|
719
|
-
Description: Use spaces after semicolons.
|
720
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
721
|
-
Enabled: true
|
722
|
-
Layout/SpaceBeforeBlockBraces:
|
723
|
-
Description: Checks that the left block brace has or doesn't have space before it.
|
724
|
-
Enabled: false
|
725
|
-
Layout/SpaceBeforeComma:
|
726
|
-
Description: No spaces before commas.
|
727
|
-
Enabled: false
|
728
|
-
Layout/SpaceBeforeComment:
|
729
|
-
Description: Checks for missing space between code and a comment on the same line.
|
730
|
-
Enabled: false
|
731
|
-
Layout/SpaceBeforeSemicolon:
|
732
|
-
Description: No spaces before semicolons.
|
733
|
-
Enabled: false
|
734
|
-
Layout/SpaceInsideBlockBraces:
|
735
|
-
Description: Checks that block braces have or don't have surrounding space. For
|
736
|
-
blocks taking parameters, checks that the left brace has or doesn't have trailing
|
737
|
-
space.
|
738
|
-
Enabled: false
|
739
|
-
Layout/SpaceAroundBlockParameters:
|
740
|
-
Description: Checks the spacing inside and after block parameters pipes.
|
741
|
-
Enabled: true
|
742
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
743
|
-
Description: Checks that the equals signs in parameter default assignments have
|
744
|
-
or don't have surrounding space depending on configuration.
|
745
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals
|
746
|
-
Enabled: true
|
747
|
-
Layout/SpaceAroundOperators:
|
748
|
-
Description: Use a single space around operators.
|
749
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
750
|
-
Enabled: true
|
751
|
-
Layout/SpaceInsideBrackets:
|
752
|
-
Description: No spaces after [ or before ].
|
753
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
754
|
-
Enabled: false
|
755
|
-
Layout/SpaceInsideHashLiteralBraces:
|
756
|
-
Description: Use spaces inside hash literal braces - or don't.
|
757
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-operators
|
758
|
-
Enabled: true
|
759
|
-
Layout/SpaceInsideParens:
|
760
|
-
Description: No spaces after ( or before ).
|
761
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-spaces-braces
|
762
|
-
Enabled: true
|
763
|
-
Layout/SpaceInsideRangeLiteral:
|
764
|
-
Description: No spaces inside range literals.
|
765
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
|
766
|
-
Enabled: true
|
767
|
-
Layout/SpaceInsideStringInterpolation:
|
768
|
-
Description: Checks for padding/surrounding spaces inside string interpolation.
|
769
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#string-interpolation
|
770
|
-
Enabled: false
|
1615
|
+
|
771
1616
|
Style/SpecialGlobalVars:
|
772
1617
|
Description: Avoid Perl-style global variables.
|
773
1618
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
774
1619
|
Enabled: false
|
1620
|
+
|
1621
|
+
Style/StabbyLambdaParentheses:
|
1622
|
+
Description: Check for the usage of parentheses around stabby lambda arguments.
|
1623
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args
|
1624
|
+
Enabled: true
|
1625
|
+
|
1626
|
+
Style/StderrPuts:
|
1627
|
+
Description: Use `warn` instead of `$stderr.puts`.
|
1628
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#warn
|
1629
|
+
Enabled: true
|
1630
|
+
|
775
1631
|
Style/StringLiterals:
|
776
1632
|
Description: Checks if uses of quotes match the configured preference.
|
777
1633
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
778
1634
|
EnforcedStyle: double_quotes
|
779
1635
|
Enabled: true
|
1636
|
+
|
780
1637
|
Style/StringLiteralsInInterpolation:
|
781
|
-
Description: Checks if uses of quotes inside expressions in interpolated strings
|
782
|
-
match the configured preference.
|
1638
|
+
Description: Checks if uses of quotes inside expressions in interpolated strings match the configured preference.
|
783
1639
|
Enabled: true
|
1640
|
+
|
1641
|
+
Style/StringMethods:
|
1642
|
+
Description: Checks if configured preferred methods are used over non-preferred.
|
1643
|
+
Enabled: false
|
1644
|
+
|
784
1645
|
Style/StructInheritance:
|
785
1646
|
Description: Checks for inheritance from Struct.new.
|
786
1647
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new
|
787
1648
|
Enabled: false
|
1649
|
+
|
1650
|
+
Style/SymbolArray:
|
1651
|
+
Description: Use %i or %I for arrays of symbols.
|
1652
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-i
|
1653
|
+
Enabled: true
|
1654
|
+
|
788
1655
|
Style/SymbolLiteral:
|
789
1656
|
Description: Use plain symbols instead of string symbols when possible.
|
790
1657
|
Enabled: false
|
1658
|
+
|
791
1659
|
Style/SymbolProc:
|
792
1660
|
Description: Use symbols as procs instead of blocks when possible.
|
793
1661
|
Enabled: false
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
Enabled:
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
Enabled:
|
1662
|
+
|
1663
|
+
Style/TernaryParentheses:
|
1664
|
+
Description: Checks for use of parentheses around ternary conditions.
|
1665
|
+
Enabled: true
|
1666
|
+
|
1667
|
+
Style/MixinUsage:
|
1668
|
+
Description: Checks that `include`, `extend` and `prepend` exists at the top level.
|
1669
|
+
Enabled: true
|
1670
|
+
|
802
1671
|
Style/TrailingCommaInArguments:
|
803
|
-
Description: Checks for trailing comma in
|
804
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma
|
1672
|
+
Description: Checks for trailing comma in argument lists.
|
1673
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
|
805
1674
|
Enabled: false
|
1675
|
+
|
806
1676
|
Style/TrailingCommaInLiteral:
|
807
|
-
Description: Checks for trailing comma in literals.
|
1677
|
+
Description: Checks for trailing comma in array and hash literals.'
|
808
1678
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
|
809
1679
|
Enabled: false
|
810
|
-
|
811
|
-
Description: Avoid trailing whitespace.
|
812
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace
|
813
|
-
Enabled: false
|
1680
|
+
|
814
1681
|
Style/TrivialAccessors:
|
815
1682
|
Description: Prefer attr_* methods to trivial readers/writers.
|
816
1683
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
|
817
1684
|
Enabled: false
|
1685
|
+
|
818
1686
|
Style/UnlessElse:
|
819
1687
|
Description: Do not use unless with else. Rewrite these with the positive case first.
|
820
1688
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-else-with-unless
|
821
1689
|
Enabled: true
|
1690
|
+
|
822
1691
|
Style/UnneededCapitalW:
|
823
1692
|
Description: Checks for %W when interpolation is not needed.
|
824
1693
|
Enabled: false
|
1694
|
+
|
1695
|
+
Style/UnneededInterpolation:
|
1696
|
+
Description: Checks for strings that are just an interpolated expression.
|
1697
|
+
Enabled: true
|
1698
|
+
|
825
1699
|
Style/UnneededPercentQ:
|
826
1700
|
Description: Checks for %q/%Q when single quotes or double quotes would do.
|
827
1701
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-q
|
828
1702
|
Enabled: false
|
1703
|
+
|
829
1704
|
Style/TrailingUnderscoreVariable:
|
830
|
-
Description: Checks for the usage of unneeded trailing underscores at the end of
|
831
|
-
|
1705
|
+
Description: Checks for the usage of unneeded trailing underscores at the end of parallel variable assignment.
|
1706
|
+
AllowNamedUnderscoreVariables: true
|
832
1707
|
Enabled: false
|
1708
|
+
|
833
1709
|
Style/VariableInterpolation:
|
834
|
-
Description: Don't interpolate global, instance and class variables directly in
|
835
|
-
strings.
|
1710
|
+
Description: Don't interpolate global, instance and class variables directly in strings.
|
836
1711
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
837
1712
|
Enabled: true
|
838
|
-
|
839
|
-
Description: Use the configured style when naming variables.
|
840
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
841
|
-
Enabled: true
|
1713
|
+
|
842
1714
|
Style/WhenThen:
|
843
1715
|
Description: Use when x then ... for one-line cases.
|
844
1716
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
845
1717
|
Enabled: true
|
1718
|
+
|
846
1719
|
Style/WhileUntilDo:
|
847
1720
|
Description: Checks for redundant do after while or until.
|
848
1721
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do
|
849
1722
|
Enabled: true
|
1723
|
+
|
850
1724
|
Style/WhileUntilModifier:
|
851
1725
|
Description: Favor modifier while/until usage when you have a single-line body.
|
852
1726
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
|
853
1727
|
Enabled: true
|
854
|
-
|
855
|
-
Enabled: true
|
856
|
-
Style/FrozenStringLiteralComment:
|
857
|
-
Enabled: true
|
1728
|
+
|
858
1729
|
Style/WordArray:
|
859
1730
|
Description: Use %w or %W for arrays of words.
|
860
1731
|
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
|
861
1732
|
Enabled: true
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
1733
|
+
|
1734
|
+
Style/YodaCondition:
|
1735
|
+
Description: Do not use literals as the first operand of a comparison.
|
1736
|
+
Reference: https://en.wikipedia.org/wiki/Yoda_conditions
|
1737
|
+
Enabled: true
|
1738
|
+
|
1739
|
+
Style/ZeroLengthPredicate:
|
1740
|
+
Description: Use #empty? when testing for objects of length 0.
|
866
1741
|
Enabled: true
|