silvercop 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -5
- data/README.md +6 -21
- data/config/default.yml +574 -935
- metadata +34 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91c722c273d0e3af9a949dd46d14a4334b8f3602
|
4
|
+
data.tar.gz: acad0f50c9f27b2fc90dd3ee64246196082f43e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6aba74209b892052b597a55e36adc95108a0473e0e4688e406b743260a96731ab4b3986744d36d465ba169e8b022a9ead37dc15da7df30e4615244bdd91bacf
|
7
|
+
data.tar.gz: 1e8efa59e8bb99788a8b109e2c9f70a607de28546d06c1de47e756ada9c2d69468d2df81c2b90f7fc35b2236af1b2221b4e443d0898c8323a8d081098a3261fb
|
data/.rubocop.yml
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
inherit_from: config/default.yml
|
2
2
|
|
3
|
-
require:
|
3
|
+
require:
|
4
|
+
- rubocop-performance
|
5
|
+
- rubocop-rails
|
6
|
+
- rubocop-thread_safety
|
4
7
|
|
5
8
|
Style/Documentation:
|
6
9
|
Enabled: false
|
@@ -8,15 +11,15 @@ Style/Documentation:
|
|
8
11
|
Layout/MultilineMethodCallIndentation:
|
9
12
|
EnforcedStyle: indented
|
10
13
|
|
11
|
-
Layout/
|
14
|
+
Layout/HashAlignment:
|
12
15
|
EnforcedColonStyle: key
|
13
16
|
EnforcedLastArgumentHashStyle: ignore_implicit
|
14
17
|
|
15
|
-
Layout/
|
18
|
+
Layout/ParameterAlignment:
|
16
19
|
EnforcedStyle: with_fixed_indentation
|
17
20
|
|
18
|
-
Layout/
|
21
|
+
Layout/FirstArrayElementIndentation:
|
19
22
|
EnforcedStyle: consistent
|
20
23
|
|
21
|
-
Layout/
|
24
|
+
Layout/FirstHashElementIndentation:
|
22
25
|
EnforcedStyle: consistent
|
data/README.md
CHANGED
@@ -2,25 +2,10 @@
|
|
2
2
|
|
3
3
|
This gem houses RuboCop configuration files to be included in Silvercar Ruby projects.
|
4
4
|
|
5
|
-
|
5
|
+
## Known Issues
|
6
|
+
There's a typo in rubocop 0.77 that gives an invalid warning, which can be ignored.
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
* Feature branches should be Pull Requests opened against master.
|
10
|
-
* Feature branches should begin with the JIRA ticket number
|
11
|
-
|
12
|
-
# Pull Requests
|
13
|
-
All code merged into master must be merged via a pull request.
|
14
|
-
|
15
|
-
Pull requests must:
|
16
|
-
|
17
|
-
* Have one or more reviewers
|
18
|
-
* Be approved by one or more reviewers
|
19
|
-
|
20
|
-
Pull requests should:
|
21
|
-
|
22
|
-
* Be small, less than 2 days of work
|
23
|
-
* Be merged by author after review process
|
8
|
+
Warning: Style/TrivialAccessors does not support AllowedMethods parameter.
|
24
9
|
|
25
10
|
## Usage
|
26
11
|
|
@@ -53,14 +38,14 @@ inherit_gem:
|
|
53
38
|
silvercop: .rubocop.yml
|
54
39
|
```
|
55
40
|
|
56
|
-
It is recommended to use this gem as `bundle exec rubocop -
|
57
|
-
|
41
|
+
It is recommended to use this gem as `bundle exec rubocop -D`, which will output the violated
|
42
|
+
cop for that line of code
|
58
43
|
|
59
44
|
If many offenses are detected, it is recommended to generate a TODO list that can be handled over
|
60
45
|
time without needing to fix all of the existing offenses. This can be done by generating and
|
61
46
|
including the following config:
|
62
47
|
|
63
|
-
`bundle exec rubocop -
|
48
|
+
`bundle exec rubocop -D --auto-gen-config`
|
64
49
|
|
65
50
|
Then add `inherit_from: .rubocop_todo.yml` to your `.rubocop.yml` file. Adding `--exclude-limit 10000` can help prevent
|
66
51
|
the generated config from disabling cops entirely with `Enabled: false`.
|
data/config/default.yml
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# Common configuration.
|
2
1
|
# This file was copied directly from https://github.com/rubocop-hq/rubocop/blob/v0.68.1/config/default.yml
|
3
2
|
# That means it has more configuration than it needs, but it's easier to copy and paste into new versions
|
4
3
|
# since we're just adopting everything in the new version.
|
5
4
|
|
5
|
+
# Common configuration.
|
6
6
|
AllCops:
|
7
7
|
RubyInterpreters:
|
8
8
|
- ruby
|
@@ -76,7 +76,7 @@ AllCops:
|
|
76
76
|
DisplayStyleGuide: false
|
77
77
|
# When specifying style guide URLs, any paths and/or fragments will be
|
78
78
|
# evaluated relative to the base URL.
|
79
|
-
StyleGuideBaseURL: https://
|
79
|
+
StyleGuideBaseURL: https://rubystyle.guide
|
80
80
|
# Extra details are not displayed in offense messages by default. Change
|
81
81
|
# behavior by overriding ExtraDetails, or by giving the
|
82
82
|
# `-E/--extra-details` option.
|
@@ -126,16 +126,8 @@ AllCops:
|
|
126
126
|
# followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
|
127
127
|
# is specified in the Gemfile or gems.rb file, RuboCop reads the final value
|
128
128
|
# from the lock file.) If the Ruby version is still unresolved, RuboCop will
|
129
|
-
# use the oldest officially supported Ruby version (currently Ruby 2.
|
129
|
+
# use the oldest officially supported Ruby version (currently Ruby 2.3).
|
130
130
|
TargetRubyVersion: ~
|
131
|
-
# What version of Rails is the inspected code using? If a value is specified
|
132
|
-
# for TargetRailsVersion then it is used. Acceptable values are specificed
|
133
|
-
# as a float (i.e. 5.1); the patch version of Rails should not be included.
|
134
|
-
# If TargetRailsVersion is not set, RuboCop will parse the Gemfile.lock or
|
135
|
-
# gems.locked file to find the version of Rails that has been bound to the
|
136
|
-
# application. If neither of those files exist, RuboCop will use Rails 5.0
|
137
|
-
# as the default.
|
138
|
-
TargetRailsVersion: ~
|
139
131
|
|
140
132
|
#################### Bundler ###############################
|
141
133
|
|
@@ -152,11 +144,12 @@ Bundler/GemComment:
|
|
152
144
|
Description: 'Add a comment describing each gem.'
|
153
145
|
Enabled: false
|
154
146
|
VersionAdded: '0.59'
|
147
|
+
VersionChanged: '0.77'
|
155
148
|
Include:
|
156
149
|
- '**/*.gemfile'
|
157
150
|
- '**/Gemfile'
|
158
151
|
- '**/gems.rb'
|
159
|
-
|
152
|
+
IgnoredGems: []
|
160
153
|
|
161
154
|
Bundler/InsecureProtocolSource:
|
162
155
|
Description: >-
|
@@ -206,6 +199,13 @@ Gemspec/RequiredRubyVersion:
|
|
206
199
|
VersionAdded: '0.52'
|
207
200
|
Include:
|
208
201
|
- '**/*.gemspec'
|
202
|
+
-
|
203
|
+
Gemspec/RubyVersionGlobalsUsage:
|
204
|
+
Description: Checks usage of RUBY_VERSION in gemspec.
|
205
|
+
Enabled: true
|
206
|
+
VersionAdded: '0.72'
|
207
|
+
Include:
|
208
|
+
- '**/*.gemspec'
|
209
209
|
|
210
210
|
#################### Layout ###########################
|
211
211
|
|
@@ -222,13 +222,14 @@ Layout/AccessModifierIndentation:
|
|
222
222
|
# But it can be overridden by setting this parameter
|
223
223
|
IndentationWidth: ~
|
224
224
|
|
225
|
-
Layout/
|
225
|
+
Layout/ArgumentAlignment:
|
226
226
|
Description: >-
|
227
227
|
Align the arguments of a method call if they span more
|
228
228
|
than one line.
|
229
229
|
StyleGuide: '#no-double-indent'
|
230
230
|
Enabled: true
|
231
231
|
VersionAdded: '0.68'
|
232
|
+
VersionChanged: '0.77'
|
232
233
|
# Alignment of arguments in multi-line method calls.
|
233
234
|
#
|
234
235
|
# The `with_first_argument` style aligns the following lines along the same
|
@@ -250,116 +251,23 @@ Layout/AlignArguments:
|
|
250
251
|
# But it can be overridden by setting this parameter
|
251
252
|
IndentationWidth: ~
|
252
253
|
|
253
|
-
Layout/
|
254
|
+
Layout/ArrayAlignment:
|
254
255
|
Description: >-
|
255
256
|
Align the elements of an array literal if they span more than
|
256
257
|
one line.
|
257
258
|
StyleGuide: '#align-multiline-arrays'
|
258
259
|
Enabled: true
|
259
260
|
VersionAdded: '0.49'
|
261
|
+
VersionChanged: '0.77'
|
260
262
|
|
261
|
-
Layout/
|
262
|
-
Description: >-
|
263
|
-
Align the elements of a hash literal if they span more than
|
264
|
-
one line.
|
265
|
-
Enabled: true
|
266
|
-
VersionAdded: '0.49'
|
267
|
-
# Alignment of entries using hash rocket as separator. Valid values are:
|
268
|
-
#
|
269
|
-
# key - left alignment of keys
|
270
|
-
# 'a' => 2
|
271
|
-
# 'bb' => 3
|
272
|
-
# separator - alignment of hash rockets, keys are right aligned
|
273
|
-
# 'a' => 2
|
274
|
-
# 'bb' => 3
|
275
|
-
# table - left alignment of keys, hash rockets, and values
|
276
|
-
# 'a' => 2
|
277
|
-
# 'bb' => 3
|
278
|
-
EnforcedHashRocketStyle: key
|
279
|
-
SupportedHashRocketStyles:
|
280
|
-
- key
|
281
|
-
- separator
|
282
|
-
- table
|
283
|
-
# Alignment of entries using colon as separator. Valid values are:
|
284
|
-
#
|
285
|
-
# key - left alignment of keys
|
286
|
-
# a: 0
|
287
|
-
# bb: 1
|
288
|
-
# separator - alignment of colons, keys are right aligned
|
289
|
-
# a: 0
|
290
|
-
# bb: 1
|
291
|
-
# table - left alignment of keys and values
|
292
|
-
# a: 0
|
293
|
-
# bb: 1
|
294
|
-
EnforcedColonStyle: key
|
295
|
-
SupportedColonStyles:
|
296
|
-
- key
|
297
|
-
- separator
|
298
|
-
- table
|
299
|
-
# Select whether hashes that are the last argument in a method call should be
|
300
|
-
# inspected? Valid values are:
|
301
|
-
#
|
302
|
-
# always_inspect - Inspect both implicit and explicit hashes.
|
303
|
-
# Registers an offense for:
|
304
|
-
# function(a: 1,
|
305
|
-
# b: 2)
|
306
|
-
# Registers an offense for:
|
307
|
-
# function({a: 1,
|
308
|
-
# b: 2})
|
309
|
-
# always_ignore - Ignore both implicit and explicit hashes.
|
310
|
-
# Accepts:
|
311
|
-
# function(a: 1,
|
312
|
-
# b: 2)
|
313
|
-
# Accepts:
|
314
|
-
# function({a: 1,
|
315
|
-
# b: 2})
|
316
|
-
# ignore_implicit - Ignore only implicit hashes.
|
317
|
-
# Accepts:
|
318
|
-
# function(a: 1,
|
319
|
-
# b: 2)
|
320
|
-
# Registers an offense for:
|
321
|
-
# function({a: 1,
|
322
|
-
# b: 2})
|
323
|
-
# ignore_explicit - Ignore only explicit hashes.
|
324
|
-
# Accepts:
|
325
|
-
# function({a: 1,
|
326
|
-
# b: 2})
|
327
|
-
# Registers an offense for:
|
328
|
-
# function(a: 1,
|
329
|
-
# b: 2)
|
330
|
-
EnforcedLastArgumentHashStyle: always_inspect
|
331
|
-
SupportedLastArgumentHashStyles:
|
332
|
-
- always_inspect
|
333
|
-
- always_ignore
|
334
|
-
- ignore_implicit
|
335
|
-
- ignore_explicit
|
336
|
-
|
337
|
-
Layout/AlignParameters:
|
263
|
+
Layout/AssignmentIndentation:
|
338
264
|
Description: >-
|
339
|
-
|
340
|
-
|
341
|
-
StyleGuide: '#no-double-indent'
|
265
|
+
Checks the indentation of the first line of the
|
266
|
+
right-hand-side of a multi-line assignment.
|
342
267
|
Enabled: true
|
343
268
|
VersionAdded: '0.49'
|
344
|
-
VersionChanged: '0.
|
345
|
-
#
|
346
|
-
#
|
347
|
-
# The `with_first_parameter` style aligns the following lines along the same
|
348
|
-
# column as the first parameter.
|
349
|
-
#
|
350
|
-
# def method_foo(a,
|
351
|
-
# b)
|
352
|
-
#
|
353
|
-
# The `with_fixed_indentation` style aligns the following lines with one
|
354
|
-
# level of indentation relative to the start of the line with the method call.
|
355
|
-
#
|
356
|
-
# def method_foo(a,
|
357
|
-
# b)
|
358
|
-
EnforcedStyle: with_first_parameter
|
359
|
-
SupportedStyles:
|
360
|
-
- with_first_parameter
|
361
|
-
- with_fixed_indentation
|
362
|
-
# By default, the indentation width from Layout/IndentationWidth is used
|
269
|
+
VersionChanged: '0.77'
|
270
|
+
# By default, the indentation width from `Layout/IndentationWidth` is used
|
363
271
|
# But it can be overridden by setting this parameter
|
364
272
|
IndentationWidth: ~
|
365
273
|
|
@@ -511,6 +419,13 @@ Layout/EmptyLinesAroundAccessModifier:
|
|
511
419
|
StyleGuide: '#empty-lines-around-access-modifier'
|
512
420
|
Enabled: true
|
513
421
|
VersionAdded: '0.49'
|
422
|
+
EnforcedStyle: around
|
423
|
+
SupportedStyles:
|
424
|
+
- around
|
425
|
+
- only_before
|
426
|
+
Reference:
|
427
|
+
# A reference to `EnforcedStyle: only_before`.
|
428
|
+
- https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
|
514
429
|
|
515
430
|
Layout/EmptyLinesAroundArguments:
|
516
431
|
Description: "Keeps track of empty lines around method arguments."
|
@@ -620,56 +535,11 @@ Layout/ExtraSpacing:
|
|
620
535
|
# When true, forces the alignment of `=` in assignments on consecutive lines.
|
621
536
|
ForceEqualSignAlignment: false
|
622
537
|
|
623
|
-
Layout/
|
624
|
-
Description: >-
|
625
|
-
Checks for a line break before the first element in a
|
626
|
-
multi-line array.
|
627
|
-
Enabled: false
|
628
|
-
VersionAdded: '0.49'
|
629
|
-
|
630
|
-
Layout/FirstHashElementLineBreak:
|
631
|
-
Description: >-
|
632
|
-
Checks for a line break before the first element in a
|
633
|
-
multi-line hash.
|
634
|
-
Enabled: false
|
635
|
-
VersionAdded: '0.49'
|
636
|
-
|
637
|
-
Layout/FirstMethodArgumentLineBreak:
|
638
|
-
Description: >-
|
639
|
-
Checks for a line break before the first argument in a
|
640
|
-
multi-line method call.
|
641
|
-
Enabled: false
|
642
|
-
VersionAdded: '0.49'
|
643
|
-
|
644
|
-
Layout/FirstMethodParameterLineBreak:
|
645
|
-
Description: >-
|
646
|
-
Checks for a line break before the first parameter in a
|
647
|
-
multi-line method parameter definition.
|
648
|
-
Enabled: false
|
649
|
-
VersionAdded: '0.49'
|
650
|
-
|
651
|
-
Layout/HeredocArgumentClosingParenthesis:
|
652
|
-
Description: >-
|
653
|
-
Checks for the placement of the closing parenthesis in a
|
654
|
-
method call that passes a HEREDOC string as an argument.
|
655
|
-
Enabled: false
|
656
|
-
StyleGuide: '#heredoc-argument-closing-parentheses'
|
657
|
-
VersionAdded: '0.68'
|
658
|
-
|
659
|
-
Layout/IndentAssignment:
|
660
|
-
Description: >-
|
661
|
-
Checks the indentation of the first line of the
|
662
|
-
right-hand-side of a multi-line assignment.
|
663
|
-
Enabled: true
|
664
|
-
VersionAdded: '0.49'
|
665
|
-
# By default, the indentation width from `Layout/IndentationWidth` is used
|
666
|
-
# But it can be overridden by setting this parameter
|
667
|
-
IndentationWidth: ~
|
668
|
-
|
669
|
-
Layout/IndentFirstArgument:
|
538
|
+
Layout/FirstArgumentIndentation:
|
670
539
|
Description: 'Checks the indentation of the first argument in a method call.'
|
671
540
|
Enabled: true
|
672
541
|
VersionAdded: '0.68'
|
542
|
+
VersionChanged: '0.77'
|
673
543
|
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
674
544
|
SupportedStyles:
|
675
545
|
# The first parameter should always be indented one step more than the
|
@@ -690,12 +560,13 @@ Layout/IndentFirstArgument:
|
|
690
560
|
# But it can be overridden by setting this parameter
|
691
561
|
IndentationWidth: ~
|
692
562
|
|
693
|
-
Layout/
|
563
|
+
Layout/FirstArrayElementIndentation:
|
694
564
|
Description: >-
|
695
565
|
Checks the indentation of the first element in an array
|
696
566
|
literal.
|
697
567
|
Enabled: true
|
698
568
|
VersionAdded: '0.68'
|
569
|
+
VersionChanged: '0.77'
|
699
570
|
# The value `special_inside_parentheses` means that array literals with
|
700
571
|
# brackets that have their opening bracket on the same line as a surrounding
|
701
572
|
# opening round parenthesis, shall have their first element indented relative
|
@@ -716,10 +587,18 @@ Layout/IndentFirstArrayElement:
|
|
716
587
|
# But it can be overridden by setting this parameter
|
717
588
|
IndentationWidth: ~
|
718
589
|
|
719
|
-
Layout/
|
590
|
+
Layout/FirstArrayElementLineBreak:
|
591
|
+
Description: >-
|
592
|
+
Checks for a line break before the first element in a
|
593
|
+
multi-line array.
|
594
|
+
Enabled: false
|
595
|
+
VersionAdded: '0.49'
|
596
|
+
|
597
|
+
Layout/FirstHashElementIndentation:
|
720
598
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
721
599
|
Enabled: true
|
722
600
|
VersionAdded: '0.68'
|
601
|
+
VersionChanged: '0.77'
|
723
602
|
# The value `special_inside_parentheses` means that hash literals with braces
|
724
603
|
# that have their opening brace on the same line as a surrounding opening
|
725
604
|
# round parenthesis, shall have their first key indented relative to the
|
@@ -740,13 +619,34 @@ Layout/IndentFirstHashElement:
|
|
740
619
|
# But it can be overridden by setting this parameter
|
741
620
|
IndentationWidth: ~
|
742
621
|
|
743
|
-
Layout/
|
622
|
+
Layout/FirstHashElementLineBreak:
|
623
|
+
Description: >-
|
624
|
+
Checks for a line break before the first element in a
|
625
|
+
multi-line hash.
|
626
|
+
Enabled: false
|
627
|
+
VersionAdded: '0.49'
|
628
|
+
|
629
|
+
Layout/FirstMethodArgumentLineBreak:
|
630
|
+
Description: >-
|
631
|
+
Checks for a line break before the first argument in a
|
632
|
+
multi-line method call.
|
633
|
+
Enabled: false
|
634
|
+
VersionAdded: '0.49'
|
635
|
+
|
636
|
+
Layout/FirstMethodParameterLineBreak:
|
637
|
+
Description: >-
|
638
|
+
Checks for a line break before the first parameter in a
|
639
|
+
multi-line method parameter definition.
|
640
|
+
Enabled: false
|
641
|
+
VersionAdded: '0.49'
|
642
|
+
|
643
|
+
Layout/FirstParameterIndentation:
|
744
644
|
Description: >-
|
745
645
|
Checks the indentation of the first parameter in a
|
746
646
|
method definition.
|
747
647
|
Enabled: true
|
748
648
|
VersionAdded: '0.49'
|
749
|
-
VersionChanged: '0.
|
649
|
+
VersionChanged: '0.77'
|
750
650
|
EnforcedStyle: consistent
|
751
651
|
SupportedStyles:
|
752
652
|
- consistent
|
@@ -755,96 +655,188 @@ Layout/IndentFirstParameter:
|
|
755
655
|
# But it can be overridden by setting this parameter
|
756
656
|
IndentationWidth: ~
|
757
657
|
|
758
|
-
Layout/
|
759
|
-
Description: 'This cop checks the indentation of the here document bodies.'
|
760
|
-
StyleGuide: '#squiggly-heredocs'
|
761
|
-
Enabled: true
|
762
|
-
VersionAdded: '0.49'
|
763
|
-
EnforcedStyle: auto_detection
|
764
|
-
SupportedStyles:
|
765
|
-
- auto_detection
|
766
|
-
- squiggly
|
767
|
-
- active_support
|
768
|
-
- powerpack
|
769
|
-
- unindent
|
770
|
-
|
771
|
-
Layout/IndentationConsistency:
|
772
|
-
Description: 'Keep indentation straight.'
|
773
|
-
StyleGuide: '#spaces-indentation'
|
774
|
-
Enabled: true
|
775
|
-
VersionAdded: '0.49'
|
776
|
-
# The difference between `rails` and `normal` is that the `rails` style
|
777
|
-
# prescribes that in classes and modules the `protected` and `private`
|
778
|
-
# modifier keywords shall be indented the same as public methods and that
|
779
|
-
# protected and private members shall be indented one step more than the
|
780
|
-
# modifiers. Other than that, both styles mean that entities on the same
|
781
|
-
# logical depth shall have the same indentation.
|
782
|
-
EnforcedStyle: normal
|
783
|
-
SupportedStyles:
|
784
|
-
- normal
|
785
|
-
- rails
|
786
|
-
|
787
|
-
Layout/IndentationWidth:
|
788
|
-
Description: 'Use 2 spaces for indentation.'
|
789
|
-
StyleGuide: '#spaces-indentation'
|
790
|
-
Enabled: true
|
791
|
-
VersionAdded: '0.49'
|
792
|
-
# Number of spaces for each indentation level.
|
793
|
-
Width: 2
|
794
|
-
IgnoredPatterns: []
|
795
|
-
|
796
|
-
Layout/InitialIndentation:
|
797
|
-
Description: >-
|
798
|
-
Checks the indentation of the first non-blank non-comment line in a file.
|
799
|
-
Enabled: true
|
800
|
-
VersionAdded: '0.49'
|
801
|
-
|
802
|
-
Layout/LeadingBlankLines:
|
803
|
-
Description: Check for unnecessary blank lines at the beginning of a file.
|
804
|
-
Enabled: true
|
805
|
-
VersionAdded: '0.57'
|
806
|
-
|
807
|
-
Layout/LeadingCommentSpace:
|
808
|
-
Description: 'Comments should start with a space.'
|
809
|
-
StyleGuide: '#hash-space'
|
810
|
-
Enabled: true
|
811
|
-
VersionAdded: '0.49'
|
812
|
-
|
813
|
-
Layout/MultilineArrayBraceLayout:
|
658
|
+
Layout/HashAlignment:
|
814
659
|
Description: >-
|
815
|
-
|
816
|
-
|
817
|
-
a new line.
|
660
|
+
Align the elements of a hash literal if they span more than
|
661
|
+
one line.
|
818
662
|
Enabled: true
|
663
|
+
AllowMultipleStyles: true
|
819
664
|
VersionAdded: '0.49'
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
#
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
665
|
+
VersionChanged: '0.77'
|
666
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
667
|
+
#
|
668
|
+
# key - left alignment of keys
|
669
|
+
# 'a' => 2
|
670
|
+
# 'bb' => 3
|
671
|
+
# separator - alignment of hash rockets, keys are right aligned
|
672
|
+
# 'a' => 2
|
673
|
+
# 'bb' => 3
|
674
|
+
# table - left alignment of keys, hash rockets, and values
|
675
|
+
# 'a' => 2
|
676
|
+
# 'bb' => 3
|
677
|
+
EnforcedHashRocketStyle: key
|
678
|
+
SupportedHashRocketStyles:
|
679
|
+
- key
|
680
|
+
- separator
|
681
|
+
- table
|
682
|
+
# Alignment of entries using colon as separator. Valid values are:
|
683
|
+
#
|
684
|
+
# key - left alignment of keys
|
685
|
+
# a: 0
|
686
|
+
# bb: 1
|
687
|
+
# separator - alignment of colons, keys are right aligned
|
688
|
+
# a: 0
|
689
|
+
# bb: 1
|
690
|
+
# table - left alignment of keys and values
|
691
|
+
# a: 0
|
692
|
+
# bb: 1
|
693
|
+
EnforcedColonStyle: key
|
694
|
+
SupportedColonStyles:
|
695
|
+
- key
|
696
|
+
- separator
|
697
|
+
- table
|
698
|
+
# Select whether hashes that are the last argument in a method call should be
|
699
|
+
# inspected? Valid values are:
|
700
|
+
#
|
701
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
702
|
+
# Registers an offense for:
|
703
|
+
# function(a: 1,
|
704
|
+
# b: 2)
|
705
|
+
# Registers an offense for:
|
706
|
+
# function({a: 1,
|
707
|
+
# b: 2})
|
708
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
709
|
+
# Accepts:
|
710
|
+
# function(a: 1,
|
711
|
+
# b: 2)
|
712
|
+
# Accepts:
|
713
|
+
# function({a: 1,
|
714
|
+
# b: 2})
|
715
|
+
# ignore_implicit - Ignore only implicit hashes.
|
716
|
+
# Accepts:
|
717
|
+
# function(a: 1,
|
718
|
+
# b: 2)
|
719
|
+
# Registers an offense for:
|
720
|
+
# function({a: 1,
|
721
|
+
# b: 2})
|
722
|
+
# ignore_explicit - Ignore only explicit hashes.
|
723
|
+
# Accepts:
|
724
|
+
# function({a: 1,
|
725
|
+
# b: 2})
|
726
|
+
# Registers an offense for:
|
727
|
+
# function(a: 1,
|
728
|
+
# b: 2)
|
729
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
730
|
+
SupportedLastArgumentHashStyles:
|
731
|
+
- always_inspect
|
732
|
+
- always_ignore
|
733
|
+
- ignore_implicit
|
734
|
+
- ignore_explicit
|
735
|
+
|
736
|
+
Layout/HeredocArgumentClosingParenthesis:
|
737
|
+
Description: >-
|
738
|
+
Checks for the placement of the closing parenthesis in a
|
739
|
+
method call that passes a HEREDOC string as an argument.
|
740
|
+
Enabled: false
|
741
|
+
StyleGuide: '#heredoc-argument-closing-parentheses'
|
742
|
+
VersionAdded: '0.68'
|
743
|
+
|
744
|
+
Layout/HeredocIndentation:
|
745
|
+
Description: 'This cop checks the indentation of the here document bodies.'
|
746
|
+
StyleGuide: '#squiggly-heredocs'
|
747
|
+
Enabled: true
|
748
|
+
VersionAdded: '0.49'
|
749
|
+
VersionChanged: '0.77'
|
750
|
+
EnforcedStyle: squiggly
|
751
|
+
SupportedStyles:
|
752
|
+
- squiggly
|
753
|
+
- active_support
|
754
|
+
- powerpack
|
755
|
+
- unindent
|
756
|
+
|
757
|
+
Layout/IndentationConsistency:
|
758
|
+
Description: 'Keep indentation straight.'
|
759
|
+
StyleGuide: '#spaces-indentation'
|
760
|
+
Enabled: true
|
761
|
+
VersionAdded: '0.49'
|
762
|
+
# The difference between `indented` and `normal` is that the `indented_internal_methods`
|
763
|
+
# style prescribes that in classes and modules the `protected` and `private`
|
764
|
+
# modifier keywords shall be indented the same as public methods and that
|
765
|
+
# protected and private members shall be indented one step more than the
|
766
|
+
# modifiers. Other than that, both styles mean that entities on the same
|
767
|
+
# logical depth shall have the same indentation.
|
768
|
+
EnforcedStyle: normal
|
769
|
+
SupportedStyles:
|
770
|
+
- normal
|
771
|
+
- indented_internal_methods
|
772
|
+
Reference:
|
773
|
+
# A reference to `EnforcedStyle: indented_internal_methods`.
|
774
|
+
- https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
|
775
|
+
|
776
|
+
Layout/IndentationWidth:
|
777
|
+
Description: 'Use 2 spaces for indentation.'
|
778
|
+
StyleGuide: '#spaces-indentation'
|
779
|
+
Enabled: true
|
780
|
+
VersionAdded: '0.49'
|
781
|
+
# Number of spaces for each indentation level.
|
782
|
+
Width: 2
|
783
|
+
IgnoredPatterns: []
|
784
|
+
|
785
|
+
Layout/InitialIndentation:
|
786
|
+
Description: >-
|
787
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
788
|
+
Enabled: true
|
789
|
+
VersionAdded: '0.49'
|
790
|
+
|
791
|
+
Layout/LeadingCommentSpace:
|
792
|
+
Description: 'Comments should start with a space.'
|
793
|
+
StyleGuide: '#hash-space'
|
794
|
+
Enabled: true
|
795
|
+
VersionAdded: '0.49'
|
796
|
+
VersionChanged: '0.73'
|
797
|
+
AllowDoxygenCommentStyle: false
|
798
|
+
|
799
|
+
Layout/LeadingEmptyLines:
|
800
|
+
Description: Check for unnecessary blank lines at the beginning of a file.
|
801
|
+
Enabled: true
|
802
|
+
VersionAdded: '0.57'
|
803
|
+
VersionChanged: '0.77'
|
804
|
+
|
805
|
+
Layout/MultilineArrayBraceLayout:
|
806
|
+
Description: >-
|
807
|
+
Checks that the closing brace in an array literal is
|
808
|
+
either on the same line as the last array element, or
|
809
|
+
a new line.
|
810
|
+
Enabled: true
|
811
|
+
VersionAdded: '0.49'
|
812
|
+
EnforcedStyle: symmetrical
|
813
|
+
SupportedStyles:
|
814
|
+
# symmetrical: closing brace is positioned in same way as opening brace
|
815
|
+
# new_line: closing brace is always on a new line
|
816
|
+
# same_line: closing brace is always on the same line as last element
|
817
|
+
- symmetrical
|
818
|
+
- new_line
|
819
|
+
- same_line
|
820
|
+
|
821
|
+
Layout/MultilineArrayLineBreaks:
|
822
|
+
Description: >-
|
823
|
+
Checks that each item in a multi-line array literal
|
824
|
+
starts on a separate line.
|
825
|
+
Enabled: false
|
826
|
+
VersionAdded: '0.67'
|
827
|
+
|
828
|
+
Layout/MultilineAssignmentLayout:
|
829
|
+
Description: 'Check for a newline after the assignment operator in multi-line assignments.'
|
830
|
+
StyleGuide: '#indent-conditional-assignment'
|
831
|
+
Enabled: false
|
832
|
+
VersionAdded: '0.49'
|
833
|
+
# The types of assignments which are subject to this rule.
|
834
|
+
SupportedTypes:
|
835
|
+
- block
|
836
|
+
- case
|
837
|
+
- class
|
838
|
+
- if
|
839
|
+
- kwbegin
|
848
840
|
- module
|
849
841
|
EnforcedStyle: new_line
|
850
842
|
SupportedStyles:
|
@@ -951,6 +943,35 @@ Layout/MultilineOperationIndentation:
|
|
951
943
|
# But it can be overridden by setting this parameter
|
952
944
|
IndentationWidth: ~
|
953
945
|
|
946
|
+
Layout/ParameterAlignment:
|
947
|
+
Description: >-
|
948
|
+
Align the parameters of a method definition if they span more
|
949
|
+
than one line.
|
950
|
+
StyleGuide: '#no-double-indent'
|
951
|
+
Enabled: true
|
952
|
+
VersionAdded: '0.49'
|
953
|
+
VersionChanged: '0.77'
|
954
|
+
# Alignment of parameters in multi-line method calls.
|
955
|
+
#
|
956
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
957
|
+
# column as the first parameter.
|
958
|
+
#
|
959
|
+
# def method_foo(a,
|
960
|
+
# b)
|
961
|
+
#
|
962
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
963
|
+
# level of indentation relative to the start of the line with the method call.
|
964
|
+
#
|
965
|
+
# def method_foo(a,
|
966
|
+
# b)
|
967
|
+
EnforcedStyle: with_first_parameter
|
968
|
+
SupportedStyles:
|
969
|
+
- with_first_parameter
|
970
|
+
- with_fixed_indentation
|
971
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
972
|
+
# But it can be overridden by setting this parameter
|
973
|
+
IndentationWidth: ~
|
974
|
+
|
954
975
|
Layout/RescueEnsureAlignment:
|
955
976
|
Description: 'Align rescues and ensures correctly.'
|
956
977
|
Enabled: true
|
@@ -1193,11 +1214,12 @@ Layout/Tab:
|
|
1193
1214
|
# replace each tab.
|
1194
1215
|
IndentationWidth: ~
|
1195
1216
|
|
1196
|
-
Layout/
|
1217
|
+
Layout/TrailingEmptyLines:
|
1197
1218
|
Description: 'Checks trailing blank lines and final newline.'
|
1198
1219
|
StyleGuide: '#newline-eof'
|
1199
1220
|
Enabled: true
|
1200
1221
|
VersionAdded: '0.49'
|
1222
|
+
VersionChanged: '0.77'
|
1201
1223
|
EnforcedStyle: final_newline
|
1202
1224
|
SupportedStyles:
|
1203
1225
|
- final_newline
|
@@ -1281,16 +1303,17 @@ Lint/DuplicateCaseCondition:
|
|
1281
1303
|
Enabled: true
|
1282
1304
|
VersionAdded: '0.45'
|
1283
1305
|
|
1306
|
+
Lint/DuplicateHashKey:
|
1307
|
+
Description: 'Check for duplicate keys in hash literals.'
|
1308
|
+
Enabled: true
|
1309
|
+
VersionAdded: '0.34'
|
1310
|
+
VersionChanged: '0.77'
|
1311
|
+
|
1284
1312
|
Lint/DuplicateMethods:
|
1285
1313
|
Description: 'Check for duplicate method definitions.'
|
1286
1314
|
Enabled: true
|
1287
1315
|
VersionAdded: '0.29'
|
1288
1316
|
|
1289
|
-
Lint/DuplicatedKey:
|
1290
|
-
Description: 'Check for duplicate keys in hash literals.'
|
1291
|
-
Enabled: true
|
1292
|
-
VersionAdded: '0.34'
|
1293
|
-
|
1294
1317
|
Lint/EachWithObjectArgument:
|
1295
1318
|
Description: 'Check for immutable argument given to each_with_object.'
|
1296
1319
|
Enabled: true
|
@@ -1341,7 +1364,7 @@ Lint/ErbNewArguments:
|
|
1341
1364
|
VersionAdded: '0.56'
|
1342
1365
|
|
1343
1366
|
Lint/FlipFlop:
|
1344
|
-
Description: 'Checks for flip-flops'
|
1367
|
+
Description: 'Checks for flip-flops.'
|
1345
1368
|
StyleGuide: '#no-flip-flops'
|
1346
1369
|
Enabled: true
|
1347
1370
|
VersionAdded: '0.16'
|
@@ -1358,12 +1381,6 @@ Lint/FormatParameterMismatch:
|
|
1358
1381
|
Enabled: true
|
1359
1382
|
VersionAdded: '0.33'
|
1360
1383
|
|
1361
|
-
Lint/HandleExceptions:
|
1362
|
-
Description: "Don't suppress exception."
|
1363
|
-
StyleGuide: '#dont-hide-exceptions'
|
1364
|
-
Enabled: true
|
1365
|
-
VersionAdded: '0.9'
|
1366
|
-
|
1367
1384
|
Lint/HeredocMethodCallPosition:
|
1368
1385
|
Description: >-
|
1369
1386
|
Checks for the ordering of a method call where
|
@@ -1397,7 +1414,7 @@ Lint/InheritException:
|
|
1397
1414
|
- standard_error
|
1398
1415
|
|
1399
1416
|
Lint/InterpolationCheck:
|
1400
|
-
Description: 'Raise warning for interpolation in single q strs'
|
1417
|
+
Description: 'Raise warning for interpolation in single q strs.'
|
1401
1418
|
Enabled: true
|
1402
1419
|
VersionAdded: '0.50'
|
1403
1420
|
|
@@ -1421,7 +1438,7 @@ Lint/Loop:
|
|
1421
1438
|
VersionAdded: '0.9'
|
1422
1439
|
|
1423
1440
|
Lint/MissingCopEnableDirective:
|
1424
|
-
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable
|
1441
|
+
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
|
1425
1442
|
Enabled: true
|
1426
1443
|
VersionAdded: '0.52'
|
1427
1444
|
# Maximum number of consecutive lines the cop can be disabled for.
|
@@ -1433,10 +1450,11 @@ Lint/MissingCopEnableDirective:
|
|
1433
1450
|
# .inf for any size
|
1434
1451
|
MaximumRangeSize: .inf
|
1435
1452
|
|
1436
|
-
Lint/
|
1437
|
-
Description: "Use `&&` operator to compare multiple
|
1453
|
+
Lint/MultipleComparison:
|
1454
|
+
Description: "Use `&&` operator to compare multiple values."
|
1438
1455
|
Enabled: true
|
1439
1456
|
VersionAdded: '0.47'
|
1457
|
+
VersionChanged: '0.77'
|
1440
1458
|
|
1441
1459
|
Lint/NestedMethodDefinition:
|
1442
1460
|
Description: 'Do not use nested method definitions.'
|
@@ -1465,6 +1483,8 @@ Lint/NumberConversion:
|
|
1465
1483
|
Description: 'Checks unsafe usage of number conversion methods.'
|
1466
1484
|
Enabled: false
|
1467
1485
|
VersionAdded: '0.53'
|
1486
|
+
VersionChanged: '0.70'
|
1487
|
+
SafeAutoCorrect: false
|
1468
1488
|
|
1469
1489
|
Lint/OrderedMagicComments:
|
1470
1490
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
@@ -1483,6 +1503,7 @@ Lint/PercentStringArray:
|
|
1483
1503
|
Description: >-
|
1484
1504
|
Checks for unwanted commas and quotes in %w/%W literals.
|
1485
1505
|
Enabled: true
|
1506
|
+
Safe: false
|
1486
1507
|
VersionAdded: '0.41'
|
1487
1508
|
|
1488
1509
|
Lint/PercentSymbolArray:
|
@@ -1498,6 +1519,36 @@ Lint/RandOne:
|
|
1498
1519
|
Enabled: true
|
1499
1520
|
VersionAdded: '0.36'
|
1500
1521
|
|
1522
|
+
Lint/RedundantCopDisableDirective:
|
1523
|
+
Description: >-
|
1524
|
+
Checks for rubocop:disable comments that can be removed.
|
1525
|
+
Note: this cop is not disabled when disabling all cops.
|
1526
|
+
It must be explicitly disabled.
|
1527
|
+
Enabled: true
|
1528
|
+
VersionAdded: '0.76'
|
1529
|
+
|
1530
|
+
Lint/RedundantCopEnableDirective:
|
1531
|
+
Description: Checks for rubocop:enable comments that can be removed.
|
1532
|
+
Enabled: true
|
1533
|
+
VersionAdded: '0.76'
|
1534
|
+
|
1535
|
+
Lint/RedundantRequireStatement:
|
1536
|
+
Description: 'Checks for unnecessary `require` statement.'
|
1537
|
+
Enabled: true
|
1538
|
+
VersionAdded: '0.76'
|
1539
|
+
|
1540
|
+
Lint/RedundantSplatExpansion:
|
1541
|
+
Description: 'Checks for splat unnecessarily being called on literals.'
|
1542
|
+
Enabled: true
|
1543
|
+
VersionChanged: '0.76'
|
1544
|
+
|
1545
|
+
Lint/RedundantStringCoercion:
|
1546
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
1547
|
+
StyleGuide: '#no-to-s'
|
1548
|
+
Enabled: true
|
1549
|
+
VersionAdded: '0.19'
|
1550
|
+
VersionChanged: '0.77'
|
1551
|
+
|
1501
1552
|
Lint/RedundantWithIndex:
|
1502
1553
|
Description: 'Checks for redundant `with_index`.'
|
1503
1554
|
Enabled: true
|
@@ -1543,8 +1594,8 @@ Lint/SafeNavigationChain:
|
|
1543
1594
|
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
1544
1595
|
Enabled: true
|
1545
1596
|
VersionAdded: '0.47'
|
1546
|
-
VersionChanged: '0.
|
1547
|
-
|
1597
|
+
VersionChanged: '0.77'
|
1598
|
+
AllowedMethods:
|
1548
1599
|
- present?
|
1549
1600
|
- blank?
|
1550
1601
|
- presence
|
@@ -1558,14 +1609,14 @@ Lint/SafeNavigationConsistency:
|
|
1558
1609
|
for all method calls on that same object.
|
1559
1610
|
Enabled: true
|
1560
1611
|
VersionAdded: '0.55'
|
1561
|
-
|
1612
|
+
VersionChanged: '0.77'
|
1613
|
+
AllowedMethods:
|
1562
1614
|
- present?
|
1563
1615
|
- blank?
|
1564
1616
|
- presence
|
1565
1617
|
- try
|
1566
1618
|
- try!
|
1567
1619
|
|
1568
|
-
|
1569
1620
|
Lint/SafeNavigationWithEmpty:
|
1570
1621
|
Description: 'Avoid `foo&.empty?` in conditionals.'
|
1571
1622
|
Enabled: true
|
@@ -1577,6 +1628,11 @@ Lint/ScriptPermission:
|
|
1577
1628
|
VersionAdded: '0.49'
|
1578
1629
|
VersionChanged: '0.50'
|
1579
1630
|
|
1631
|
+
Lint/SendWithMixinArgument:
|
1632
|
+
Description: 'Checks for `send` method when using mixin.'
|
1633
|
+
Enabled: true
|
1634
|
+
VersionAdded: '0.75'
|
1635
|
+
|
1580
1636
|
Lint/ShadowedArgument:
|
1581
1637
|
Description: 'Avoid reassigning arguments before they were used.'
|
1582
1638
|
Enabled: true
|
@@ -1598,15 +1654,16 @@ Lint/ShadowingOuterLocalVariable:
|
|
1598
1654
|
Enabled: true
|
1599
1655
|
VersionAdded: '0.9'
|
1600
1656
|
|
1601
|
-
Lint/
|
1602
|
-
Description: '
|
1603
|
-
StyleGuide: '#
|
1657
|
+
Lint/SuppressedException:
|
1658
|
+
Description: "Don't suppress exceptions."
|
1659
|
+
StyleGuide: '#dont-hide-exceptions'
|
1604
1660
|
Enabled: true
|
1605
|
-
|
1606
|
-
|
1661
|
+
AllowComments: false
|
1662
|
+
VersionAdded: '0.9'
|
1663
|
+
VersionChanged: '0.77'
|
1607
1664
|
|
1608
1665
|
Lint/Syntax:
|
1609
|
-
Description: 'Checks syntax error'
|
1666
|
+
Description: 'Checks syntax error.'
|
1610
1667
|
Enabled: true
|
1611
1668
|
VersionAdded: '0.9'
|
1612
1669
|
|
@@ -1622,30 +1679,7 @@ Lint/UnderscorePrefixedVariableName:
|
|
1622
1679
|
AllowKeywordBlockArguments: false
|
1623
1680
|
|
1624
1681
|
Lint/UnifiedInteger:
|
1625
|
-
Description: 'Use Integer instead of Fixnum or Bignum'
|
1626
|
-
Enabled: true
|
1627
|
-
VersionAdded: '0.43'
|
1628
|
-
|
1629
|
-
Lint/UnneededCopDisableDirective:
|
1630
|
-
Description: >-
|
1631
|
-
Checks for rubocop:disable comments that can be removed.
|
1632
|
-
Note: this cop is not disabled when disabling all cops.
|
1633
|
-
It must be explicitly disabled.
|
1634
|
-
Enabled: true
|
1635
|
-
VersionAdded: '0.53'
|
1636
|
-
|
1637
|
-
Lint/UnneededCopEnableDirective:
|
1638
|
-
Description: Checks for rubocop:enable comments that can be removed.
|
1639
|
-
Enabled: true
|
1640
|
-
VersionAdded: '0.53'
|
1641
|
-
|
1642
|
-
Lint/UnneededRequireStatement:
|
1643
|
-
Description: 'Checks for unnecessary `require` statement.'
|
1644
|
-
Enabled: true
|
1645
|
-
VersionAdded: '0.51'
|
1646
|
-
|
1647
|
-
Lint/UnneededSplatExpansion:
|
1648
|
-
Description: 'Checks for splat unnecessarily being called on literals'
|
1682
|
+
Description: 'Use Integer instead of Fixnum or Bignum.'
|
1649
1683
|
Enabled: true
|
1650
1684
|
VersionAdded: '0.43'
|
1651
1685
|
|
@@ -1731,7 +1765,7 @@ Metrics/AbcSize:
|
|
1731
1765
|
branches, and conditions.
|
1732
1766
|
Reference:
|
1733
1767
|
- http://c2.com/cgi/wiki?AbcMetric
|
1734
|
-
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
1768
|
+
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
1735
1769
|
Enabled: true
|
1736
1770
|
VersionAdded: '0.27'
|
1737
1771
|
VersionChanged: '0.66'
|
@@ -1754,7 +1788,7 @@ Metrics/BlockLength:
|
|
1754
1788
|
- '**/*.gemspec'
|
1755
1789
|
|
1756
1790
|
Metrics/BlockNesting:
|
1757
|
-
Description: 'Avoid excessive block nesting'
|
1791
|
+
Description: 'Avoid excessive block nesting.'
|
1758
1792
|
StyleGuide: '#three-is-the-number-thou-shalt-count'
|
1759
1793
|
Enabled: true
|
1760
1794
|
VersionAdded: '0.25'
|
@@ -1795,7 +1829,7 @@ Metrics/LineLength:
|
|
1795
1829
|
- https
|
1796
1830
|
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
1797
1831
|
# directives like '# rubocop: enable ...' when calculating a line's length.
|
1798
|
-
IgnoreCopDirectives:
|
1832
|
+
IgnoreCopDirectives: true
|
1799
1833
|
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
1800
1834
|
# elements. Strings will be converted to Regexp objects. A line that matches
|
1801
1835
|
# any regular expression listed in this option will be ignored by LineLength.
|
@@ -1834,6 +1868,14 @@ Metrics/PerceivedComplexity:
|
|
1834
1868
|
VersionAdded: '0.25'
|
1835
1869
|
Max: 7
|
1836
1870
|
|
1871
|
+
################## Migration #############################
|
1872
|
+
|
1873
|
+
Migration/DepartmentName:
|
1874
|
+
Description: >-
|
1875
|
+
Check that cop names in rubocop:disable (etc) comments are
|
1876
|
+
given with department name.
|
1877
|
+
Enabled: false
|
1878
|
+
|
1837
1879
|
#################### Naming ##############################
|
1838
1880
|
|
1839
1881
|
Naming/AccessorMethodName:
|
@@ -1854,6 +1896,21 @@ Naming/BinaryOperatorParameterName:
|
|
1854
1896
|
Enabled: true
|
1855
1897
|
VersionAdded: '0.50'
|
1856
1898
|
|
1899
|
+
Naming/BlockParameterName:
|
1900
|
+
Description: >-
|
1901
|
+
Checks for block parameter names that contain capital letters,
|
1902
|
+
end in numbers, or do not meet a minimal length.
|
1903
|
+
Enabled: true
|
1904
|
+
VersionAdded: '0.53'
|
1905
|
+
VersionChanged: '0.77'
|
1906
|
+
# Parameter names may be equal to or greater than this value
|
1907
|
+
MinNameLength: 1
|
1908
|
+
AllowNamesEndingInNumbers: true
|
1909
|
+
# Allowed names that will not register an offense
|
1910
|
+
AllowedNames: []
|
1911
|
+
# Forbidden names that will register an offense
|
1912
|
+
ForbiddenNames: []
|
1913
|
+
|
1857
1914
|
Naming/ClassAndModuleCamelCase:
|
1858
1915
|
Description: 'Use CamelCase for classes and modules.'
|
1859
1916
|
StyleGuide: '#camelcase-classes'
|
@@ -1924,598 +1981,139 @@ Naming/FileName:
|
|
1924
1981
|
- URI
|
1925
1982
|
- URL
|
1926
1983
|
- UTF8
|
1927
|
-
- VM
|
1928
|
-
- XML
|
1929
|
-
- XMPP
|
1930
|
-
- XSRF
|
1931
|
-
- XSS
|
1932
|
-
|
1933
|
-
Naming/HeredocDelimiterCase:
|
1934
|
-
Description: 'Use configured case for heredoc delimiters.'
|
1935
|
-
StyleGuide: '#heredoc-delimiters'
|
1936
|
-
Enabled: true
|
1937
|
-
VersionAdded: '0.50'
|
1938
|
-
EnforcedStyle: uppercase
|
1939
|
-
SupportedStyles:
|
1940
|
-
- lowercase
|
1941
|
-
- uppercase
|
1942
|
-
|
1943
|
-
Naming/HeredocDelimiterNaming:
|
1944
|
-
Description: 'Use descriptive heredoc delimiters.'
|
1945
|
-
StyleGuide: '#heredoc-delimiters'
|
1946
|
-
Enabled: true
|
1947
|
-
VersionAdded: '0.50'
|
1948
|
-
Blacklist:
|
1949
|
-
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
1950
|
-
|
1951
|
-
Naming/MemoizedInstanceVariableName:
|
1952
|
-
Description: >-
|
1953
|
-
Memoized method name should match memo instance variable name.
|
1954
|
-
Enabled: true
|
1955
|
-
VersionAdded: '0.53'
|
1956
|
-
VersionChanged: '0.58'
|
1957
|
-
EnforcedStyleForLeadingUnderscores: disallowed
|
1958
|
-
SupportedStylesForLeadingUnderscores:
|
1959
|
-
- disallowed
|
1960
|
-
- required
|
1961
|
-
- optional
|
1962
|
-
|
1963
|
-
Naming/MethodName:
|
1964
|
-
Description: 'Use the configured style when naming methods.'
|
1965
|
-
StyleGuide: '#snake-case-symbols-methods-vars'
|
1966
|
-
Enabled: true
|
1967
|
-
VersionAdded: '0.50'
|
1968
|
-
EnforcedStyle: snake_case
|
1969
|
-
SupportedStyles:
|
1970
|
-
- snake_case
|
1971
|
-
- camelCase
|
1972
|
-
|
1973
|
-
Naming/PredicateName:
|
1974
|
-
Description: 'Check the names of predicate methods.'
|
1975
|
-
StyleGuide: '#bool-methods-qmark'
|
1976
|
-
Enabled: true
|
1977
|
-
VersionAdded: '0.50'
|
1978
|
-
VersionChanged: '0.51'
|
1979
|
-
# Predicate name prefixes.
|
1980
|
-
NamePrefix:
|
1981
|
-
- is_
|
1982
|
-
- has_
|
1983
|
-
- have_
|
1984
|
-
# Predicate name prefixes that should be removed.
|
1985
|
-
NamePrefixBlacklist:
|
1986
|
-
- is_
|
1987
|
-
- has_
|
1988
|
-
- have_
|
1989
|
-
# Predicate names which, despite having a blacklisted prefix, or no `?`,
|
1990
|
-
# should still be accepted
|
1991
|
-
NameWhitelist:
|
1992
|
-
- is_a?
|
1993
|
-
# Method definition macros for dynamically generated methods.
|
1994
|
-
MethodDefinitionMacros:
|
1995
|
-
- define_method
|
1996
|
-
- define_singleton_method
|
1997
|
-
# Exclude Rspec specs because there is a strong convention to write spec
|
1998
|
-
# helpers in the form of `have_something` or `be_something`.
|
1999
|
-
Exclude:
|
2000
|
-
- 'spec/**/*'
|
2001
|
-
|
2002
|
-
Naming/RescuedExceptionsVariableName:
|
2003
|
-
Description: 'Use consistent rescued exceptions variables naming.'
|
2004
|
-
Enabled: true
|
2005
|
-
VersionAdded: '0.67'
|
2006
|
-
VersionChanged: '0.68'
|
2007
|
-
PreferredName: e
|
2008
|
-
|
2009
|
-
Naming/UncommunicativeBlockParamName:
|
2010
|
-
Description: >-
|
2011
|
-
Checks for block parameter names that contain capital letters,
|
2012
|
-
end in numbers, or do not meet a minimal length.
|
2013
|
-
Enabled: true
|
2014
|
-
VersionAdded: '0.53'
|
2015
|
-
# Parameter names may be equal to or greater than this value
|
2016
|
-
MinNameLength: 1
|
2017
|
-
AllowNamesEndingInNumbers: true
|
2018
|
-
# Whitelisted names that will not register an offense
|
2019
|
-
AllowedNames: []
|
2020
|
-
# Blacklisted names that will register an offense
|
2021
|
-
ForbiddenNames: []
|
2022
|
-
|
2023
|
-
Naming/UncommunicativeMethodParamName:
|
2024
|
-
Description: >-
|
2025
|
-
Checks for method parameter names that contain capital letters,
|
2026
|
-
end in numbers, or do not meet a minimal length.
|
2027
|
-
Enabled: true
|
2028
|
-
VersionAdded: '0.53'
|
2029
|
-
VersionChanged: '0.59'
|
2030
|
-
# Parameter names may be equal to or greater than this value
|
2031
|
-
MinNameLength: 3
|
2032
|
-
AllowNamesEndingInNumbers: true
|
2033
|
-
# Whitelisted names that will not register an offense
|
2034
|
-
AllowedNames:
|
2035
|
-
- io
|
2036
|
-
- id
|
2037
|
-
- to
|
2038
|
-
- by
|
2039
|
-
- 'on'
|
2040
|
-
- in
|
2041
|
-
- at
|
2042
|
-
- ip
|
2043
|
-
- db
|
2044
|
-
# Blacklisted names that will register an offense
|
2045
|
-
ForbiddenNames: []
|
2046
|
-
|
2047
|
-
|
2048
|
-
Naming/VariableName:
|
2049
|
-
Description: 'Use the configured style when naming variables.'
|
2050
|
-
StyleGuide: '#snake-case-symbols-methods-vars'
|
2051
|
-
Enabled: true
|
2052
|
-
VersionAdded: '0.50'
|
2053
|
-
EnforcedStyle: snake_case
|
2054
|
-
SupportedStyles:
|
2055
|
-
- snake_case
|
2056
|
-
- camelCase
|
2057
|
-
|
2058
|
-
Naming/VariableNumber:
|
2059
|
-
Description: 'Use the configured style when numbering variables.'
|
2060
|
-
Enabled: true
|
2061
|
-
VersionAdded: '0.50'
|
2062
|
-
EnforcedStyle: normalcase
|
2063
|
-
SupportedStyles:
|
2064
|
-
- snake_case
|
2065
|
-
- normalcase
|
2066
|
-
- non_integer
|
2067
|
-
|
2068
|
-
#################### Rails #################################
|
2069
|
-
|
2070
|
-
# By default, the rails cops are not run. Override in project or home
|
2071
|
-
# directory .rubocop.yml files, or by giving the -R/--rails option.
|
2072
|
-
Rails:
|
2073
|
-
Enabled: false
|
2074
|
-
|
2075
|
-
Rails/ActionFilter:
|
2076
|
-
Description: 'Enforces consistent use of action filter methods.'
|
2077
|
-
Enabled: true
|
2078
|
-
VersionAdded: '0.19'
|
2079
|
-
EnforcedStyle: action
|
2080
|
-
SupportedStyles:
|
2081
|
-
- action
|
2082
|
-
- filter
|
2083
|
-
Include:
|
2084
|
-
- app/controllers/**/*.rb
|
2085
|
-
|
2086
|
-
Rails/ActiveRecordAliases:
|
2087
|
-
Description: >-
|
2088
|
-
Avoid Active Record aliases:
|
2089
|
-
Use `update` instead of `update_attributes`.
|
2090
|
-
Use `update!` instead of `update_attributes!`.
|
2091
|
-
Enabled: true
|
2092
|
-
VersionAdded: '0.53'
|
2093
|
-
|
2094
|
-
Rails/ActiveRecordOverride:
|
2095
|
-
Description: >-
|
2096
|
-
Check for overriding Active Record methods instead of using
|
2097
|
-
callbacks.
|
2098
|
-
Enabled: true
|
2099
|
-
VersionAdded: '0.67'
|
2100
|
-
Include:
|
2101
|
-
- app/models/**/*.rb
|
2102
|
-
|
2103
|
-
Rails/ActiveSupportAliases:
|
2104
|
-
Description: >-
|
2105
|
-
Avoid ActiveSupport aliases of standard ruby methods:
|
2106
|
-
`String#starts_with?`, `String#ends_with?`,
|
2107
|
-
`Array#append`, `Array#prepend`.
|
2108
|
-
Enabled: true
|
2109
|
-
VersionAdded: '0.48'
|
2110
|
-
|
2111
|
-
Rails/ApplicationJob:
|
2112
|
-
Description: 'Check that jobs subclass ApplicationJob.'
|
2113
|
-
Enabled: true
|
2114
|
-
VersionAdded: '0.49'
|
2115
|
-
|
2116
|
-
Rails/ApplicationRecord:
|
2117
|
-
Description: 'Check that models subclass ApplicationRecord.'
|
2118
|
-
Enabled: true
|
2119
|
-
VersionAdded: '0.49'
|
2120
|
-
|
2121
|
-
Rails/AssertNot:
|
2122
|
-
Description: 'Use `assert_not` instead of `assert !`.'
|
2123
|
-
Enabled: true
|
2124
|
-
VersionAdded: '0.56'
|
2125
|
-
Include:
|
2126
|
-
- '**/test/**/*'
|
2127
|
-
|
2128
|
-
Rails/BelongsTo:
|
2129
|
-
Description: >-
|
2130
|
-
Use `optional: true` instead of `required: false` for
|
2131
|
-
`belongs_to` relations'
|
2132
|
-
Enabled: true
|
2133
|
-
VersionAdded: '0.62'
|
2134
|
-
|
2135
|
-
Rails/Blank:
|
2136
|
-
Description: 'Enforces use of `blank?`.'
|
2137
|
-
Enabled: true
|
2138
|
-
VersionAdded: '0.48'
|
2139
|
-
VersionChanged: '0.67'
|
2140
|
-
# Convert usages of `nil? || empty?` to `blank?`
|
2141
|
-
NilOrEmpty: true
|
2142
|
-
# Convert usages of `!present?` to `blank?`
|
2143
|
-
NotPresent: true
|
2144
|
-
# Convert usages of `unless present?` to `if blank?`
|
2145
|
-
UnlessPresent: true
|
2146
|
-
|
2147
|
-
Rails/BulkChangeTable:
|
2148
|
-
Description: 'Check whether alter queries are combinable.'
|
2149
|
-
Enabled: true
|
2150
|
-
VersionAdded: '0.57'
|
2151
|
-
Database: null
|
2152
|
-
SupportedDatabases:
|
2153
|
-
- mysql
|
2154
|
-
- postgresql
|
2155
|
-
Include:
|
2156
|
-
- db/migrate/*.rb
|
2157
|
-
|
2158
|
-
Rails/CreateTableWithTimestamps:
|
2159
|
-
Description: >-
|
2160
|
-
Checks the migration for which timestamps are not included
|
2161
|
-
when creating a new table.
|
2162
|
-
Enabled: true
|
2163
|
-
VersionAdded: '0.52'
|
2164
|
-
Include:
|
2165
|
-
- db/migrate/*.rb
|
2166
|
-
|
2167
|
-
Rails/Date:
|
2168
|
-
Description: >-
|
2169
|
-
Checks the correct usage of date aware methods,
|
2170
|
-
such as Date.today, Date.current etc.
|
2171
|
-
Enabled: true
|
2172
|
-
VersionAdded: '0.30'
|
2173
|
-
VersionChanged: '0.33'
|
2174
|
-
# The value `strict` disallows usage of `Date.today`, `Date.current`,
|
2175
|
-
# `Date#to_time` etc.
|
2176
|
-
# The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc
|
2177
|
-
# (but not `Date.today`) which are overridden by ActiveSupport to handle current
|
2178
|
-
# time zone.
|
2179
|
-
EnforcedStyle: flexible
|
2180
|
-
SupportedStyles:
|
2181
|
-
- strict
|
2182
|
-
- flexible
|
2183
|
-
|
2184
|
-
Rails/Delegate:
|
2185
|
-
Description: 'Prefer delegate method for delegations.'
|
2186
|
-
Enabled: true
|
2187
|
-
VersionAdded: '0.21'
|
2188
|
-
VersionChanged: '0.50'
|
2189
|
-
# When set to true, using the target object as a prefix of the
|
2190
|
-
# method name without using the `delegate` method will be a
|
2191
|
-
# violation. When set to false, this case is legal.
|
2192
|
-
EnforceForPrefixed: true
|
2193
|
-
|
2194
|
-
Rails/DelegateAllowBlank:
|
2195
|
-
Description: 'Do not use allow_blank as an option to delegate.'
|
2196
|
-
Enabled: true
|
2197
|
-
VersionAdded: '0.44'
|
2198
|
-
|
2199
|
-
Rails/DynamicFindBy:
|
2200
|
-
Description: 'Use `find_by` instead of dynamic `find_by_*`.'
|
2201
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find_by'
|
2202
|
-
Enabled: true
|
2203
|
-
VersionAdded: '0.44'
|
2204
|
-
Whitelist:
|
2205
|
-
- find_by_sql
|
2206
|
-
|
2207
|
-
Rails/EnumUniqueness:
|
2208
|
-
Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
|
2209
|
-
Enabled: true
|
2210
|
-
VersionAdded: '0.46'
|
2211
|
-
Include:
|
2212
|
-
- app/models/**/*.rb
|
2213
|
-
|
2214
|
-
Rails/EnvironmentComparison:
|
2215
|
-
Description: "Favor `Rails.env.production?` over `Rails.env == 'production'`"
|
2216
|
-
Enabled: true
|
2217
|
-
VersionAdded: '0.52'
|
2218
|
-
|
2219
|
-
Rails/Exit:
|
2220
|
-
Description: >-
|
2221
|
-
Favor `fail`, `break`, `return`, etc. over `exit` in
|
2222
|
-
application or library code outside of Rake files to avoid
|
2223
|
-
exits during unit testing or running in production.
|
2224
|
-
Enabled: true
|
2225
|
-
VersionAdded: '0.41'
|
2226
|
-
Include:
|
2227
|
-
- app/**/*.rb
|
2228
|
-
- config/**/*.rb
|
2229
|
-
- lib/**/*.rb
|
2230
|
-
Exclude:
|
2231
|
-
- lib/**/*.rake
|
2232
|
-
|
2233
|
-
Rails/FilePath:
|
2234
|
-
Description: 'Use `Rails.root.join` for file path joining.'
|
2235
|
-
Enabled: true
|
2236
|
-
VersionAdded: '0.47'
|
2237
|
-
VersionChanged: '0.57'
|
2238
|
-
EnforcedStyle: arguments
|
2239
|
-
SupportedStyles:
|
2240
|
-
- slashes
|
2241
|
-
- arguments
|
2242
|
-
|
2243
|
-
Rails/FindBy:
|
2244
|
-
Description: 'Prefer find_by over where.first.'
|
2245
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find_by'
|
2246
|
-
Enabled: true
|
2247
|
-
VersionAdded: '0.30'
|
2248
|
-
Include:
|
2249
|
-
- app/models/**/*.rb
|
2250
|
-
|
2251
|
-
Rails/FindEach:
|
2252
|
-
Description: 'Prefer all.find_each over all.find.'
|
2253
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find-each'
|
2254
|
-
Enabled: true
|
2255
|
-
VersionAdded: '0.30'
|
2256
|
-
Include:
|
2257
|
-
- app/models/**/*.rb
|
2258
|
-
|
2259
|
-
Rails/HasAndBelongsToMany:
|
2260
|
-
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
2261
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#has-many-through'
|
2262
|
-
Enabled: true
|
2263
|
-
VersionAdded: '0.12'
|
2264
|
-
Include:
|
2265
|
-
- app/models/**/*.rb
|
2266
|
-
|
2267
|
-
Rails/HasManyOrHasOneDependent:
|
2268
|
-
Description: 'Define the dependent option to the has_many and has_one associations.'
|
2269
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#has_many-has_one-dependent-option'
|
2270
|
-
Enabled: true
|
2271
|
-
VersionAdded: '0.50'
|
2272
|
-
Include:
|
2273
|
-
- app/models/**/*.rb
|
2274
|
-
|
2275
|
-
Rails/HttpPositionalArguments:
|
2276
|
-
Description: 'Use keyword arguments instead of positional arguments in http method calls.'
|
2277
|
-
Enabled: true
|
2278
|
-
VersionAdded: '0.44'
|
2279
|
-
Include:
|
2280
|
-
- 'spec/**/*'
|
2281
|
-
- 'test/**/*'
|
1984
|
+
- VM
|
1985
|
+
- XML
|
1986
|
+
- XMPP
|
1987
|
+
- XSRF
|
1988
|
+
- XSS
|
2282
1989
|
|
2283
|
-
|
2284
|
-
Description: '
|
1990
|
+
Naming/HeredocDelimiterCase:
|
1991
|
+
Description: 'Use configured case for heredoc delimiters.'
|
1992
|
+
StyleGuide: '#heredoc-delimiters'
|
2285
1993
|
Enabled: true
|
2286
|
-
VersionAdded: '0.
|
2287
|
-
EnforcedStyle:
|
1994
|
+
VersionAdded: '0.50'
|
1995
|
+
EnforcedStyle: uppercase
|
2288
1996
|
SupportedStyles:
|
2289
|
-
-
|
2290
|
-
-
|
2291
|
-
|
2292
|
-
Rails/IgnoredSkipActionFilterOption:
|
2293
|
-
Description: 'Checks that `if` and `only` (or `except`) are not used together as options of `skip_*` action filter.'
|
2294
|
-
Reference: 'https://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html#method-i-_normalize_callback_options'
|
2295
|
-
Enabled: true
|
2296
|
-
VersionAdded: '0.63'
|
2297
|
-
Include:
|
2298
|
-
- app/controllers/**/*.rb
|
2299
|
-
|
2300
|
-
Rails/InverseOf:
|
2301
|
-
Description: 'Checks for associations where the inverse cannot be determined automatically.'
|
2302
|
-
Enabled: true
|
2303
|
-
VersionAdded: '0.52'
|
2304
|
-
Include:
|
2305
|
-
- app/models/**/*.rb
|
2306
|
-
|
2307
|
-
Rails/LexicallyScopedActionFilter:
|
2308
|
-
Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the controller."
|
2309
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#lexically-scoped-action-filter'
|
2310
|
-
Enabled: true
|
2311
|
-
Safe: false
|
2312
|
-
VersionAdded: '0.52'
|
2313
|
-
Include:
|
2314
|
-
- app/controllers/**/*.rb
|
2315
|
-
|
2316
|
-
Rails/LinkToBlank:
|
2317
|
-
Description: 'Checks that `link_to` with a `target: "_blank"` have a `rel: "noopener"` option passed to them.'
|
2318
|
-
Reference: https://mathiasbynens.github.io/rel-noopener/
|
2319
|
-
Enabled: true
|
2320
|
-
VersionAdded: '0.62'
|
2321
|
-
|
2322
|
-
Rails/NotNullColumn:
|
2323
|
-
Description: 'Do not add a NOT NULL column without a default value'
|
2324
|
-
Enabled: true
|
2325
|
-
VersionAdded: '0.43'
|
2326
|
-
Include:
|
2327
|
-
- db/migrate/*.rb
|
2328
|
-
|
2329
|
-
Rails/Output:
|
2330
|
-
Description: 'Checks for calls to puts, print, etc.'
|
2331
|
-
Enabled: true
|
2332
|
-
VersionAdded: '0.15'
|
2333
|
-
VersionChanged: '0.19'
|
2334
|
-
Include:
|
2335
|
-
- app/**/*.rb
|
2336
|
-
- config/**/*.rb
|
2337
|
-
- db/**/*.rb
|
2338
|
-
- lib/**/*.rb
|
2339
|
-
|
2340
|
-
Rails/OutputSafety:
|
2341
|
-
Description: 'The use of `html_safe` or `raw` may be a security risk.'
|
2342
|
-
Enabled: true
|
2343
|
-
VersionAdded: '0.41'
|
2344
|
-
|
2345
|
-
Rails/PluralizationGrammar:
|
2346
|
-
Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
|
2347
|
-
Enabled: true
|
2348
|
-
VersionAdded: '0.35'
|
2349
|
-
|
2350
|
-
Rails/Presence:
|
2351
|
-
Description: 'Checks code that can be written more easily using `Object#presence` defined by Active Support.'
|
2352
|
-
Enabled: true
|
2353
|
-
VersionAdded: '0.52'
|
1997
|
+
- lowercase
|
1998
|
+
- uppercase
|
2354
1999
|
|
2355
|
-
|
2356
|
-
Description: '
|
2357
|
-
|
2358
|
-
VersionAdded: '0.48'
|
2359
|
-
VersionChanged: '0.67'
|
2360
|
-
# Convert usages of `!nil? && !empty?` to `present?`
|
2361
|
-
NotNilAndNotEmpty: true
|
2362
|
-
# Convert usages of `!blank?` to `present?`
|
2363
|
-
NotBlank: true
|
2364
|
-
# Convert usages of `unless blank?` to `if present?`
|
2365
|
-
UnlessBlank: true
|
2366
|
-
|
2367
|
-
Rails/ReadWriteAttribute:
|
2368
|
-
Description: >-
|
2369
|
-
Checks for read_attribute(:attr) and
|
2370
|
-
write_attribute(:attr, val).
|
2371
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#read-attribute'
|
2000
|
+
Naming/HeredocDelimiterNaming:
|
2001
|
+
Description: 'Use descriptive heredoc delimiters.'
|
2002
|
+
StyleGuide: '#heredoc-delimiters'
|
2372
2003
|
Enabled: true
|
2373
|
-
VersionAdded: '0.
|
2374
|
-
|
2375
|
-
|
2376
|
-
- app/models/**/*.rb
|
2004
|
+
VersionAdded: '0.50'
|
2005
|
+
ForbiddenDelimiters:
|
2006
|
+
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
2377
2007
|
|
2378
|
-
|
2008
|
+
Naming/MemoizedInstanceVariableName:
|
2379
2009
|
Description: >-
|
2380
|
-
|
2381
|
-
certain values in model validations.
|
2382
|
-
Enabled: true
|
2383
|
-
VersionAdded: '0.67'
|
2384
|
-
Include:
|
2385
|
-
- app/models/**/*.rb
|
2386
|
-
|
2387
|
-
Rails/RedundantReceiverInWithOptions:
|
2388
|
-
Description: 'Checks for redundant receiver in `with_options`.'
|
2389
|
-
Enabled: true
|
2390
|
-
VersionAdded: '0.52'
|
2391
|
-
|
2392
|
-
Rails/ReflectionClassName:
|
2393
|
-
Description: 'Use a string for `class_name` option value in the definition of a reflection.'
|
2394
|
-
Enabled: true
|
2395
|
-
VersionAdded: '0.64'
|
2396
|
-
|
2397
|
-
Rails/RefuteMethods:
|
2398
|
-
Description: 'Use `assert_not` methods instead of `refute` methods.'
|
2399
|
-
Enabled: true
|
2400
|
-
VersionAdded: '0.56'
|
2401
|
-
Include:
|
2402
|
-
- '**/test/**/*'
|
2403
|
-
|
2404
|
-
Rails/RelativeDateConstant:
|
2405
|
-
Description: 'Do not assign relative date to constants.'
|
2010
|
+
Memoized method name should match memo instance variable name.
|
2406
2011
|
Enabled: true
|
2407
|
-
VersionAdded: '0.
|
2408
|
-
VersionChanged: '0.
|
2409
|
-
|
2012
|
+
VersionAdded: '0.53'
|
2013
|
+
VersionChanged: '0.58'
|
2014
|
+
EnforcedStyleForLeadingUnderscores: disallowed
|
2015
|
+
SupportedStylesForLeadingUnderscores:
|
2016
|
+
- disallowed
|
2017
|
+
- required
|
2018
|
+
- optional
|
2410
2019
|
|
2411
|
-
|
2412
|
-
Description: 'Use
|
2020
|
+
Naming/MethodName:
|
2021
|
+
Description: 'Use the configured style when naming methods.'
|
2022
|
+
StyleGuide: '#snake-case-symbols-methods-vars'
|
2413
2023
|
Enabled: true
|
2414
|
-
VersionAdded: '0.
|
2415
|
-
EnforcedStyle:
|
2024
|
+
VersionAdded: '0.50'
|
2025
|
+
EnforcedStyle: snake_case
|
2416
2026
|
SupportedStyles:
|
2417
|
-
-
|
2418
|
-
-
|
2419
|
-
|
2420
|
-
|
2421
|
-
|
2422
|
-
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
Include:
|
2427
|
-
- db/migrate/*.rb
|
2027
|
+
- snake_case
|
2028
|
+
- camelCase
|
2029
|
+
# Method names matching patterns are always allowed.
|
2030
|
+
#
|
2031
|
+
# IgnoredPatterns:
|
2032
|
+
# - '\A\s*onSelectionBulkChange\s*'
|
2033
|
+
# - '\A\s*onSelectionCleared\s*'
|
2034
|
+
#
|
2035
|
+
IgnoredPatterns: []
|
2428
2036
|
|
2429
|
-
|
2430
|
-
Description:
|
2037
|
+
Naming/MethodParameterName:
|
2038
|
+
Description: >-
|
2039
|
+
Checks for method parameter names that contain capital letters,
|
2040
|
+
end in numbers, or do not meet a minimal length.
|
2431
2041
|
Enabled: true
|
2432
|
-
VersionAdded: '0.
|
2433
|
-
|
2434
|
-
#
|
2435
|
-
|
2436
|
-
|
2437
|
-
|
2438
|
-
|
2439
|
-
|
2440
|
-
|
2441
|
-
|
2442
|
-
|
2443
|
-
|
2444
|
-
|
2445
|
-
|
2446
|
-
|
2042
|
+
VersionAdded: '0.53'
|
2043
|
+
VersionChanged: '0.77'
|
2044
|
+
# Parameter names may be equal to or greater than this value
|
2045
|
+
MinNameLength: 3
|
2046
|
+
AllowNamesEndingInNumbers: true
|
2047
|
+
# Allowed names that will not register an offense
|
2048
|
+
AllowedNames:
|
2049
|
+
- io
|
2050
|
+
- id
|
2051
|
+
- to
|
2052
|
+
- by
|
2053
|
+
- 'on'
|
2054
|
+
- in
|
2055
|
+
- at
|
2056
|
+
- ip
|
2057
|
+
- db
|
2058
|
+
- os
|
2059
|
+
# Forbidden names that will register an offense
|
2060
|
+
ForbiddenNames: []
|
2447
2061
|
|
2448
|
-
|
2449
|
-
Description: '
|
2062
|
+
Naming/PredicateName:
|
2063
|
+
Description: 'Check the names of predicate methods.'
|
2064
|
+
StyleGuide: '#bool-methods-qmark'
|
2450
2065
|
Enabled: true
|
2451
|
-
VersionAdded: '0.
|
2452
|
-
|
2453
|
-
|
2066
|
+
VersionAdded: '0.50'
|
2067
|
+
VersionChanged: '0.77'
|
2068
|
+
# Predicate name prefixes.
|
2069
|
+
NamePrefix:
|
2070
|
+
- is_
|
2071
|
+
- has_
|
2072
|
+
- have_
|
2073
|
+
# Predicate name prefixes that should be removed.
|
2074
|
+
ForbiddenPrefixes:
|
2075
|
+
- is_
|
2076
|
+
- has_
|
2077
|
+
- have_
|
2078
|
+
# Predicate names which, despite having a forbidden prefix, or no `?`,
|
2079
|
+
# should still be accepted
|
2080
|
+
AllowedMethods:
|
2081
|
+
- is_a?
|
2082
|
+
# Method definition macros for dynamically generated methods.
|
2083
|
+
MethodDefinitionMacros:
|
2084
|
+
- define_method
|
2085
|
+
- define_singleton_method
|
2086
|
+
# Exclude Rspec specs because there is a strong convention to write spec
|
2087
|
+
# helpers in the form of `have_something` or `be_something`.
|
2088
|
+
Exclude:
|
2089
|
+
- 'spec/**/*'
|
2454
2090
|
|
2455
|
-
|
2456
|
-
Description:
|
2457
|
-
Use methods that skips model validations with caution.
|
2458
|
-
See reference for more information.
|
2459
|
-
Reference: 'https://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
|
2460
|
-
Enabled: true
|
2461
|
-
VersionAdded: '0.47'
|
2462
|
-
VersionChanged: '0.60'
|
2463
|
-
Blacklist:
|
2464
|
-
- decrement!
|
2465
|
-
- decrement_counter
|
2466
|
-
- increment!
|
2467
|
-
- increment_counter
|
2468
|
-
- toggle!
|
2469
|
-
- touch
|
2470
|
-
- update_all
|
2471
|
-
- update_attribute
|
2472
|
-
- update_column
|
2473
|
-
- update_columns
|
2474
|
-
- update_counters
|
2475
|
-
Whitelist: []
|
2476
|
-
|
2477
|
-
Rails/TimeZone:
|
2478
|
-
Description: 'Checks the correct usage of time zone aware methods.'
|
2479
|
-
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#time'
|
2480
|
-
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
|
2091
|
+
Naming/RescuedExceptionsVariableName:
|
2092
|
+
Description: 'Use consistent rescued exceptions variables naming.'
|
2481
2093
|
Enabled: true
|
2482
|
-
|
2483
|
-
VersionAdded: '0.30'
|
2094
|
+
VersionAdded: '0.67'
|
2484
2095
|
VersionChanged: '0.68'
|
2485
|
-
|
2486
|
-
# The value `flexible` allows usage of `in_time_zone` instead of `zone`.
|
2487
|
-
EnforcedStyle: flexible
|
2488
|
-
SupportedStyles:
|
2489
|
-
- strict
|
2490
|
-
- flexible
|
2096
|
+
PreferredName: e
|
2491
2097
|
|
2492
|
-
|
2493
|
-
Description: '
|
2098
|
+
Naming/VariableName:
|
2099
|
+
Description: 'Use the configured style when naming variables.'
|
2100
|
+
StyleGuide: '#snake-case-symbols-methods-vars'
|
2494
2101
|
Enabled: true
|
2495
|
-
VersionAdded: '0.
|
2496
|
-
|
2497
|
-
EnforcedStyle: conservative
|
2102
|
+
VersionAdded: '0.50'
|
2103
|
+
EnforcedStyle: snake_case
|
2498
2104
|
SupportedStyles:
|
2499
|
-
-
|
2500
|
-
-
|
2501
|
-
AutoCorrect: false
|
2502
|
-
|
2503
|
-
Rails/UnknownEnv:
|
2504
|
-
Description: 'Use correct environment name.'
|
2505
|
-
Enabled: true
|
2506
|
-
VersionAdded: '0.51'
|
2507
|
-
Environments:
|
2508
|
-
- development
|
2509
|
-
- test
|
2510
|
-
- production
|
2105
|
+
- snake_case
|
2106
|
+
- camelCase
|
2511
2107
|
|
2512
|
-
|
2513
|
-
Description: 'Use
|
2108
|
+
Naming/VariableNumber:
|
2109
|
+
Description: 'Use the configured style when numbering variables.'
|
2514
2110
|
Enabled: true
|
2515
|
-
VersionAdded: '0.
|
2516
|
-
|
2517
|
-
|
2518
|
-
-
|
2111
|
+
VersionAdded: '0.50'
|
2112
|
+
EnforcedStyle: normalcase
|
2113
|
+
SupportedStyles:
|
2114
|
+
- snake_case
|
2115
|
+
- normalcase
|
2116
|
+
- non_integer
|
2519
2117
|
|
2520
2118
|
#################### Security ##############################
|
2521
2119
|
|
@@ -2573,7 +2171,7 @@ Style/AccessModifierDeclarations:
|
|
2573
2171
|
|
2574
2172
|
Style/Alias:
|
2575
2173
|
Description: 'Use alias instead of alias_method.'
|
2576
|
-
StyleGuide: '#alias-method'
|
2174
|
+
StyleGuide: '#alias-method-lexically'
|
2577
2175
|
Enabled: true
|
2578
2176
|
VersionAdded: '0.9'
|
2579
2177
|
VersionChanged: '0.36'
|
@@ -2924,6 +2522,13 @@ Style/ConditionalAssignment:
|
|
2924
2522
|
SingleLineConditionsOnly: true
|
2925
2523
|
IncludeTernaryExpressions: true
|
2926
2524
|
|
2525
|
+
Style/ConstantVisibility:
|
2526
|
+
Description: >-
|
2527
|
+
Check that class- and module constants have
|
2528
|
+
visibility declarations.
|
2529
|
+
Enabled: false
|
2530
|
+
VersionAdded: '0.66'
|
2531
|
+
|
2927
2532
|
# Checks that you have put a copyright in a comment before any code.
|
2928
2533
|
#
|
2929
2534
|
# You can override the default Notice in your .rubocop.yml file.
|
@@ -2942,13 +2547,6 @@ Style/ConditionalAssignment:
|
|
2942
2547
|
# Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
|
2943
2548
|
# AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
|
2944
2549
|
#
|
2945
|
-
Style/ConstantVisibility:
|
2946
|
-
Description: >-
|
2947
|
-
Check that class- and module constants have
|
2948
|
-
visibility declarations.
|
2949
|
-
Enabled: false
|
2950
|
-
VersionAdded: '0.66'
|
2951
|
-
|
2952
2550
|
Style/Copyright:
|
2953
2551
|
Description: 'Include a copyright notice in each file before any code.'
|
2954
2552
|
Enabled: false
|
@@ -2995,6 +2593,11 @@ Style/DocumentationMethod:
|
|
2995
2593
|
- 'test/**/*'
|
2996
2594
|
RequireForNonPublicMethods: false
|
2997
2595
|
|
2596
|
+
Style/DoubleCopDisableDirective:
|
2597
|
+
Description: 'Checks for double rubocop:disable comments on a single line.'
|
2598
|
+
Enabled: true
|
2599
|
+
VersionAdded: '0.73'
|
2600
|
+
|
2998
2601
|
Style/DoubleNegation:
|
2999
2602
|
Description: 'Checks for uses of double negation (!!).'
|
3000
2603
|
StyleGuide: '#no-bang-bang'
|
@@ -3079,7 +2682,7 @@ Style/EvalWithLocation:
|
|
3079
2682
|
VersionAdded: '0.52'
|
3080
2683
|
|
3081
2684
|
Style/EvenOdd:
|
3082
|
-
Description: 'Favor the use of Integer#even
|
2685
|
+
Description: 'Favor the use of `Integer#even?` && `Integer#odd?`.'
|
3083
2686
|
StyleGuide: '#predicate-methods'
|
3084
2687
|
Enabled: true
|
3085
2688
|
VersionAdded: '0.12'
|
@@ -3090,6 +2693,19 @@ Style/ExpandPathArguments:
|
|
3090
2693
|
Enabled: true
|
3091
2694
|
VersionAdded: '0.53'
|
3092
2695
|
|
2696
|
+
Style/FloatDivision:
|
2697
|
+
Description: 'For performing float division, coerce one side only.'
|
2698
|
+
StyleGuide: '#float-division'
|
2699
|
+
Reference: 'https://github.com/rubocop-hq/ruby-style-guide/issues/628'
|
2700
|
+
Enabled: true
|
2701
|
+
VersionAdded: '0.72'
|
2702
|
+
EnforcedStyle: single_coerce
|
2703
|
+
SupportedStyles:
|
2704
|
+
- left_coerce
|
2705
|
+
- right_coerce
|
2706
|
+
- single_coerce
|
2707
|
+
- fdiv
|
2708
|
+
|
3093
2709
|
Style/For:
|
3094
2710
|
Description: 'Checks use of for or each in multiline loops.'
|
3095
2711
|
StyleGuide: '#no-for-loops'
|
@@ -3125,7 +2741,7 @@ Style/FormatStringToken:
|
|
3125
2741
|
- template
|
3126
2742
|
- unannotated
|
3127
2743
|
VersionAdded: '0.49'
|
3128
|
-
VersionChanged: '0.
|
2744
|
+
VersionChanged: '0.75'
|
3129
2745
|
|
3130
2746
|
Style/FrozenStringLiteralComment:
|
3131
2747
|
Description: >-
|
@@ -3133,12 +2749,9 @@ Style/FrozenStringLiteralComment:
|
|
3133
2749
|
to help transition to frozen string literals by default.
|
3134
2750
|
Enabled: true
|
3135
2751
|
VersionAdded: '0.36'
|
3136
|
-
VersionChanged: '0.
|
3137
|
-
EnforcedStyle:
|
2752
|
+
VersionChanged: '0.69'
|
2753
|
+
EnforcedStyle: always
|
3138
2754
|
SupportedStyles:
|
3139
|
-
# `when_needed` will add the frozen string literal comment to files
|
3140
|
-
# only when the `TargetRubyVersion` is set to 2.3+.
|
3141
|
-
- when_needed
|
3142
2755
|
# `always` will always add the frozen string literal comment to a file
|
3143
2756
|
# regardless of the Ruby version or if `freeze` or `<<` are called on a
|
3144
2757
|
# string literal. If you run code against multiple versions of Ruby, it is
|
@@ -3158,7 +2771,7 @@ Style/GlobalVars:
|
|
3158
2771
|
AllowedVariables: []
|
3159
2772
|
|
3160
2773
|
Style/GuardClause:
|
3161
|
-
Description: 'Check for conditionals that can be replaced with guard clauses'
|
2774
|
+
Description: 'Check for conditionals that can be replaced with guard clauses.'
|
3162
2775
|
StyleGuide: '#no-nested-conditionals'
|
3163
2776
|
Enabled: true
|
3164
2777
|
VersionAdded: '0.20'
|
@@ -3201,6 +2814,7 @@ Style/IdenticalConditionalBranches:
|
|
3201
2814
|
Style/IfInsideElse:
|
3202
2815
|
Description: 'Finds if nodes inside else, which can be converted to elsif.'
|
3203
2816
|
Enabled: true
|
2817
|
+
AllowIfModifier: false
|
3204
2818
|
VersionAdded: '0.36'
|
3205
2819
|
|
3206
2820
|
Style/IfUnlessModifier:
|
@@ -3275,8 +2889,9 @@ Style/IpAddresses:
|
|
3275
2889
|
Description: "Don't include literal IP addresses in code."
|
3276
2890
|
Enabled: false
|
3277
2891
|
VersionAdded: '0.58'
|
3278
|
-
|
3279
|
-
|
2892
|
+
VersionChanged: '0.77'
|
2893
|
+
# Allow addresses to be permitted
|
2894
|
+
AllowedAddresses:
|
3280
2895
|
- "::"
|
3281
2896
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
3282
2897
|
|
@@ -3320,6 +2935,7 @@ Style/MethodCallWithArgsParentheses:
|
|
3320
2935
|
VersionChanged: '0.61'
|
3321
2936
|
IgnoreMacros: true
|
3322
2937
|
IgnoredMethods: []
|
2938
|
+
IgnoredPatterns: []
|
3323
2939
|
IncludedMacros: []
|
3324
2940
|
AllowParenthesesInMultilineCall: false
|
3325
2941
|
AllowParenthesesInChaining: false
|
@@ -3366,7 +2982,7 @@ Style/MethodMissingSuper:
|
|
3366
2982
|
Style/MinMax:
|
3367
2983
|
Description: >-
|
3368
2984
|
Use `Enumerable#minmax` instead of `Enumerable#min`
|
3369
|
-
and `Enumerable#max` in conjunction.
|
2985
|
+
and `Enumerable#max` in conjunction.
|
3370
2986
|
Enabled: true
|
3371
2987
|
VersionAdded: '0.50'
|
3372
2988
|
|
@@ -3376,7 +2992,7 @@ Style/MissingElse:
|
|
3376
2992
|
If enabled, it is recommended that
|
3377
2993
|
Style/UnlessElse and Style/EmptyElse be enabled.
|
3378
2994
|
This will conflict with Style/EmptyElse if
|
3379
|
-
Style/EmptyElse is configured to style "both"
|
2995
|
+
Style/EmptyElse is configured to style "both".
|
3380
2996
|
Enabled: false
|
3381
2997
|
VersionAdded: '0.30'
|
3382
2998
|
VersionChanged: '0.38'
|
@@ -3470,6 +3086,12 @@ Style/MultilineTernaryOperator:
|
|
3470
3086
|
Enabled: true
|
3471
3087
|
VersionAdded: '0.9'
|
3472
3088
|
|
3089
|
+
Style/MultilineWhenThen:
|
3090
|
+
Description: 'Do not use then for multi-line when statement.'
|
3091
|
+
StyleGuide: '#no-then'
|
3092
|
+
Enabled: true
|
3093
|
+
VersionAdded: '0.73'
|
3094
|
+
|
3473
3095
|
Style/MultipleComparison:
|
3474
3096
|
Description: >-
|
3475
3097
|
Avoid comparing a variable with multiple items in a conditional,
|
@@ -3510,6 +3132,20 @@ Style/NegatedIf:
|
|
3510
3132
|
- prefix
|
3511
3133
|
- postfix
|
3512
3134
|
|
3135
|
+
Style/NegatedUnless:
|
3136
|
+
Description: 'Favor if over unless for negative conditions.'
|
3137
|
+
StyleGuide: '#if-for-negatives'
|
3138
|
+
Enabled: true
|
3139
|
+
VersionAdded: '0.69'
|
3140
|
+
EnforcedStyle: both
|
3141
|
+
SupportedStyles:
|
3142
|
+
# both: prefix and postfix negated `unless` should both use `if`
|
3143
|
+
# prefix: only use `if` for negated `unless` statements positioned before the body of the statement
|
3144
|
+
# postfix: only use `if` for negated `unless` statements positioned after the body of the statement
|
3145
|
+
- both
|
3146
|
+
- prefix
|
3147
|
+
- postfix
|
3148
|
+
|
3513
3149
|
Style/NegatedWhile:
|
3514
3150
|
Description: 'Favor until over while for negative conditions.'
|
3515
3151
|
StyleGuide: '#until-for-negatives'
|
@@ -3528,8 +3164,8 @@ Style/NestedParenthesizedCalls:
|
|
3528
3164
|
argument list of another parenthesized method call.
|
3529
3165
|
Enabled: true
|
3530
3166
|
VersionAdded: '0.36'
|
3531
|
-
VersionChanged: '0.
|
3532
|
-
|
3167
|
+
VersionChanged: '0.77'
|
3168
|
+
AllowedMethods:
|
3533
3169
|
- be
|
3534
3170
|
- be_a
|
3535
3171
|
- be_an
|
@@ -3674,7 +3310,7 @@ Style/OptionHash:
|
|
3674
3310
|
Style/OptionalArguments:
|
3675
3311
|
Description: >-
|
3676
3312
|
Checks for optional arguments that do not appear at the end
|
3677
|
-
of the argument list
|
3313
|
+
of the argument list.
|
3678
3314
|
StyleGuide: '#optional-arguments'
|
3679
3315
|
Enabled: true
|
3680
3316
|
VersionAdded: '0.33'
|
@@ -3706,7 +3342,7 @@ Style/ParenthesesAroundCondition:
|
|
3706
3342
|
AllowInMultilineConditions: false
|
3707
3343
|
|
3708
3344
|
Style/PercentLiteralDelimiters:
|
3709
|
-
Description: 'Use `%`-literal delimiters consistently'
|
3345
|
+
Description: 'Use `%`-literal delimiters consistently.'
|
3710
3346
|
StyleGuide: '#percent-literal-braces'
|
3711
3347
|
Enabled: true
|
3712
3348
|
VersionAdded: '0.19'
|
@@ -3741,8 +3377,9 @@ Style/PreferredHashMethods:
|
|
3741
3377
|
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
|
3742
3378
|
StyleGuide: '#hash-key'
|
3743
3379
|
Enabled: true
|
3380
|
+
Safe: false
|
3744
3381
|
VersionAdded: '0.41'
|
3745
|
-
VersionChanged: '0.
|
3382
|
+
VersionChanged: '0.70'
|
3746
3383
|
EnforcedStyle: short
|
3747
3384
|
SupportedStyles:
|
3748
3385
|
- short
|
@@ -3781,6 +3418,16 @@ Style/RedundantBegin:
|
|
3781
3418
|
VersionAdded: '0.10'
|
3782
3419
|
VersionChanged: '0.21'
|
3783
3420
|
|
3421
|
+
Style/RedundantCapitalW:
|
3422
|
+
Description: 'Checks for %W when interpolation is not needed.'
|
3423
|
+
Enabled: true
|
3424
|
+
VersionAdded: '0.76'
|
3425
|
+
|
3426
|
+
Style/RedundantCondition:
|
3427
|
+
Description: 'Checks for unnecessary conditional expressions.'
|
3428
|
+
Enabled: true
|
3429
|
+
VersionAdded: '0.76'
|
3430
|
+
|
3784
3431
|
Style/RedundantConditional:
|
3785
3432
|
Description: "Don't return true/false from a conditional."
|
3786
3433
|
Enabled: true
|
@@ -3799,11 +3446,22 @@ Style/RedundantFreeze:
|
|
3799
3446
|
VersionAdded: '0.34'
|
3800
3447
|
VersionChanged: '0.66'
|
3801
3448
|
|
3449
|
+
Style/RedundantInterpolation:
|
3450
|
+
Description: 'Checks for strings that are just an interpolated expression.'
|
3451
|
+
Enabled: true
|
3452
|
+
VersionAdded: '0.76'
|
3453
|
+
|
3802
3454
|
Style/RedundantParentheses:
|
3803
3455
|
Description: "Checks for parentheses that seem not to serve any purpose."
|
3804
3456
|
Enabled: true
|
3805
3457
|
VersionAdded: '0.36'
|
3806
3458
|
|
3459
|
+
Style/RedundantPercentQ:
|
3460
|
+
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
3461
|
+
StyleGuide: '#percent-q'
|
3462
|
+
Enabled: true
|
3463
|
+
VersionAdded: '0.76'
|
3464
|
+
|
3807
3465
|
Style/RedundantReturn:
|
3808
3466
|
Description: "Don't use return where it's not required."
|
3809
3467
|
StyleGuide: '#no-explicit-return'
|
@@ -3820,6 +3478,13 @@ Style/RedundantSelf:
|
|
3820
3478
|
VersionAdded: '0.10'
|
3821
3479
|
VersionChanged: '0.13'
|
3822
3480
|
|
3481
|
+
Style/RedundantSort:
|
3482
|
+
Description: >-
|
3483
|
+
Use `min` instead of `sort.first`,
|
3484
|
+
`max_by` instead of `sort_by...last`, etc.
|
3485
|
+
Enabled: true
|
3486
|
+
VersionAdded: '0.76'
|
3487
|
+
|
3823
3488
|
Style/RedundantSortBy:
|
3824
3489
|
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
|
3825
3490
|
Enabled: true
|
@@ -3877,11 +3542,11 @@ Style/SafeNavigation:
|
|
3877
3542
|
safe navigation (`&.`).
|
3878
3543
|
Enabled: true
|
3879
3544
|
VersionAdded: '0.43'
|
3880
|
-
VersionChanged: '0.
|
3545
|
+
VersionChanged: '0.77'
|
3881
3546
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
3882
3547
|
# to whatever it used to return.
|
3883
3548
|
ConvertCodeThatCanStartToReturnNil: false
|
3884
|
-
|
3549
|
+
AllowedMethods:
|
3885
3550
|
- present?
|
3886
3551
|
- blank?
|
3887
3552
|
- presence
|
@@ -3986,6 +3651,8 @@ Style/StringHashKeys:
|
|
3986
3651
|
StyleGuide: '#symbols-as-keys'
|
3987
3652
|
Enabled: false
|
3988
3653
|
VersionAdded: '0.52'
|
3654
|
+
VersionChanged: '0.75'
|
3655
|
+
Safe: false
|
3989
3656
|
|
3990
3657
|
Style/StringLiterals:
|
3991
3658
|
Description: 'Checks if uses of quotes match the configured preference.'
|
@@ -4157,7 +3824,7 @@ Style/TrivialAccessors:
|
|
4157
3824
|
StyleGuide: '#attr_family'
|
4158
3825
|
Enabled: true
|
4159
3826
|
VersionAdded: '0.9'
|
4160
|
-
VersionChanged: '0.
|
3827
|
+
VersionChanged: '0.77'
|
4161
3828
|
# When set to `false` the cop will suggest the use of accessor methods
|
4162
3829
|
# in situations like:
|
4163
3830
|
#
|
@@ -4178,7 +3845,7 @@ Style/TrivialAccessors:
|
|
4178
3845
|
# Commonly used in DSLs
|
4179
3846
|
AllowDSLWriters: false
|
4180
3847
|
IgnoreClassMethods: false
|
4181
|
-
|
3848
|
+
AllowedMethods:
|
4182
3849
|
- to_ary
|
4183
3850
|
- to_a
|
4184
3851
|
- to_c
|
@@ -4205,39 +3872,10 @@ Style/UnlessElse:
|
|
4205
3872
|
Enabled: true
|
4206
3873
|
VersionAdded: '0.9'
|
4207
3874
|
|
4208
|
-
Style/UnneededCapitalW:
|
4209
|
-
Description: 'Checks for %W when interpolation is not needed.'
|
4210
|
-
Enabled: true
|
4211
|
-
VersionAdded: '0.21'
|
4212
|
-
VersionChanged: '0.24'
|
4213
|
-
|
4214
|
-
Style/UnneededCondition:
|
4215
|
-
Description: 'Checks for unnecessary conditional expressions.'
|
4216
|
-
Enabled: true
|
4217
|
-
VersionAdded: '0.57'
|
4218
|
-
|
4219
|
-
Style/UnneededInterpolation:
|
4220
|
-
Description: 'Checks for strings that are just an interpolated expression.'
|
4221
|
-
Enabled: true
|
4222
|
-
VersionAdded: '0.36'
|
4223
|
-
|
4224
|
-
Style/UnneededPercentQ:
|
4225
|
-
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
|
4226
|
-
StyleGuide: '#percent-q'
|
4227
|
-
Enabled: true
|
4228
|
-
VersionAdded: '0.24'
|
4229
|
-
|
4230
|
-
Style/UnneededSort:
|
4231
|
-
Description: >-
|
4232
|
-
Use `min` instead of `sort.first`,
|
4233
|
-
`max_by` instead of `sort_by...last`, etc.
|
4234
|
-
Enabled: true
|
4235
|
-
VersionAdded: '0.55'
|
4236
|
-
|
4237
3875
|
Style/UnpackFirst:
|
4238
3876
|
Description: >-
|
4239
3877
|
Checks for accessing the first element of `String#unpack`
|
4240
|
-
instead of using `unpack1
|
3878
|
+
instead of using `unpack1`.
|
4241
3879
|
Enabled: true
|
4242
3880
|
VersionAdded: '0.54'
|
4243
3881
|
|
@@ -4288,7 +3926,7 @@ Style/WordArray:
|
|
4288
3926
|
# whose element count is greater than or equal to `MinSize`.
|
4289
3927
|
MinSize: 2
|
4290
3928
|
# The regular expression `WordRegex` decides what is considered a word.
|
4291
|
-
WordRegex: !ruby/regexp '/\A
|
3929
|
+
WordRegex: !ruby/regexp '/\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/'
|
4292
3930
|
|
4293
3931
|
Style/YodaCondition:
|
4294
3932
|
Description: 'Forbid or enforce yoda conditions.'
|
@@ -4304,8 +3942,9 @@ Style/YodaCondition:
|
|
4304
3942
|
- require_for_all_comparison_operators
|
4305
3943
|
# enforce yoda only for equality operators: `!=` and `==`
|
4306
3944
|
- require_for_equality_operators_only
|
3945
|
+
Safe: false
|
4307
3946
|
VersionAdded: '0.49'
|
4308
|
-
VersionChanged: '0.
|
3947
|
+
VersionChanged: '0.75'
|
4309
3948
|
|
4310
3949
|
Style/ZeroLengthPredicate:
|
4311
3950
|
Description: 'Use #empty? when testing for objects of length 0.'
|