makandra-rubocop 4.2.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +65 -1
- data/Gemfile.lock +33 -13
- data/README.md +14 -6
- data/config/default.yml +386 -297
- data/config/ext/rails.yml +68 -2
- data/config/ext/rspec.yml +641 -0
- data/lib/makandra_rubocop/version.rb +1 -1
- data/makandra-rubocop.gemspec +3 -2
- metadata +22 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 130275bf7eac5a3587234e0af2be5da8a6e4c2af9303d7b0f3e61d3f937e725e
|
4
|
+
data.tar.gz: 6ed0279266665f4f7e45c0f2d263c462241a45e384267ce5aa7787e7abdee7e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5573837e49fcf4843cdfa2c37624648d6ac6c9779fc490f554b2c2b3bc57464294bde51500c466122e7dbf9e7164404acdd56e32712c794ee1272ae563c10aa6
|
7
|
+
data.tar.gz: eaabf0764c6510ed5ee69df46b6ba253dd080ca03475f71df83ce9dda6aa9d1d098057bab89f253a61fa86a9bbac51016c6bdf5d6de05c2416567977a2aaaa13
|
data/CHANGELOG.md
CHANGED
@@ -9,12 +9,76 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
9
9
|
### Compatible changes
|
10
10
|
|
11
11
|
|
12
|
-
##
|
12
|
+
## 5.2.0 - 2020-07-06
|
13
|
+
|
14
|
+
### Breaking changes
|
15
|
+
|
16
|
+
### Compatible changes
|
17
|
+
|
18
|
+
- Disable `RSpec/LetSetup`
|
19
|
+
|
20
|
+
|
21
|
+
## 5.1.0 - 2020-06-29
|
22
|
+
|
23
|
+
### Breaking changes
|
24
|
+
|
25
|
+
### Compatible changes
|
26
|
+
|
27
|
+
- Add [rubocop-rspec](https://github.com/rubocop-hq/rubocop-rspec)
|
28
|
+
|
29
|
+
You can add it to a project like this:
|
30
|
+
|
31
|
+
```yaml
|
32
|
+
inherit_gem:
|
33
|
+
makandra-rubocop:
|
34
|
+
- config/default.yml
|
35
|
+
- config/ext/rspec.yml
|
36
|
+
```
|
37
|
+
- Disable the `Style/ClassCheck` cop (#22)
|
38
|
+
|
39
|
+
|
40
|
+
## 5.0.0 - 2020-04-07
|
41
|
+
|
42
|
+
### Breaking changes
|
43
|
+
|
44
|
+
- Upgrade `rubocop`
|
45
|
+
- Upgrade `rubocop-rails`
|
46
|
+
|
47
|
+
Migration notes:
|
48
|
+
|
49
|
+
In case you are using a project with Ruby < 2.5 you need to add these lines to your `.rubocop.yml`:
|
50
|
+
|
51
|
+
```
|
52
|
+
Style/HashTransformKeys:
|
53
|
+
Enable: false # Disabled until Ruby 2.5 upgrade
|
54
|
+
|
55
|
+
Style/HashTransformValues:
|
56
|
+
Enable: false # Disabled until Ruby 2.5 upgrade
|
57
|
+
```
|
58
|
+
|
59
|
+
|
60
|
+
## 4.4.0 - 2020-04-06
|
13
61
|
|
14
62
|
### Breaking changes
|
15
63
|
|
16
64
|
### Compatible changes
|
17
65
|
|
66
|
+
- Disable `Lint/EmptyWhen` (#18)
|
67
|
+
- Disable `Naming/RescuedExceptionsVariableName` (#19)
|
68
|
+
|
69
|
+
|
70
|
+
## 4.3.0 - 2020-02-13
|
71
|
+
|
72
|
+
### Compatible changes
|
73
|
+
|
74
|
+
- Temporary disable `Layout/RescueEnsureAlignment` again, rubocop-hq/rubocop#6771 seems not to have fixed the issue
|
75
|
+
in our 4.0.0 release.
|
76
|
+
|
77
|
+
|
78
|
+
## 4.2.0 - 2020-01-02
|
79
|
+
|
80
|
+
### Compatible changes
|
81
|
+
|
18
82
|
- Disable `Rails/HelperInstanceVariable`
|
19
83
|
- Disable `Rails/HasManyOrHasOneDependent`
|
20
84
|
|
data/Gemfile.lock
CHANGED
@@ -1,33 +1,53 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
makandra-rubocop (
|
5
|
-
rubocop (~> 0.
|
6
|
-
rubocop-rails (~> 2.
|
4
|
+
makandra-rubocop (5.2.0)
|
5
|
+
rubocop (~> 0.81.0)
|
6
|
+
rubocop-rails (~> 2.5.1)
|
7
|
+
rubocop-rspec (~> 1.40.0)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
11
|
-
|
12
|
+
activesupport (6.0.3.2)
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
+
i18n (>= 0.7, < 2)
|
15
|
+
minitest (~> 5.1)
|
16
|
+
tzinfo (~> 1.1)
|
17
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
18
|
+
ast (2.4.1)
|
19
|
+
concurrent-ruby (1.1.6)
|
20
|
+
i18n (1.8.3)
|
21
|
+
concurrent-ruby (~> 1.0)
|
12
22
|
jaro_winkler (1.5.4)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
23
|
+
minitest (5.14.1)
|
24
|
+
parallel (1.19.2)
|
25
|
+
parser (2.7.1.4)
|
26
|
+
ast (~> 2.4.1)
|
27
|
+
rack (2.2.3)
|
17
28
|
rainbow (3.0.0)
|
18
29
|
rake (12.3.2)
|
19
|
-
|
30
|
+
rexml (3.2.4)
|
31
|
+
rubocop (0.81.0)
|
20
32
|
jaro_winkler (~> 1.5.1)
|
21
33
|
parallel (~> 1.10)
|
22
|
-
parser (>= 2.
|
34
|
+
parser (>= 2.7.0.1)
|
23
35
|
rainbow (>= 2.2.2, < 4.0)
|
36
|
+
rexml
|
24
37
|
ruby-progressbar (~> 1.7)
|
25
|
-
unicode-display_width (>= 1.4.0, <
|
26
|
-
rubocop-rails (2.
|
38
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
39
|
+
rubocop-rails (2.5.2)
|
40
|
+
activesupport
|
27
41
|
rack (>= 1.1)
|
28
42
|
rubocop (>= 0.72.0)
|
43
|
+
rubocop-rspec (1.40.0)
|
44
|
+
rubocop (>= 0.68.1)
|
29
45
|
ruby-progressbar (1.10.1)
|
30
|
-
|
46
|
+
thread_safe (0.3.6)
|
47
|
+
tzinfo (1.2.7)
|
48
|
+
thread_safe (~> 0.1)
|
49
|
+
unicode-display_width (1.7.0)
|
50
|
+
zeitwerk (2.3.1)
|
31
51
|
|
32
52
|
PLATFORMS
|
33
53
|
ruby
|
data/README.md
CHANGED
@@ -39,6 +39,15 @@ inherit_gem:
|
|
39
39
|
- config/ext/rails.yml
|
40
40
|
```
|
41
41
|
|
42
|
+
**For RSpec**
|
43
|
+
|
44
|
+
```yaml
|
45
|
+
inherit_gem:
|
46
|
+
makandra-rubocop:
|
47
|
+
- config/default.yml
|
48
|
+
- config/ext/rspec.yml
|
49
|
+
```
|
50
|
+
|
42
51
|
Any per-project rules can then be defined in the `.rubocop.yml`:
|
43
52
|
|
44
53
|
```yaml
|
@@ -99,7 +108,6 @@ See [Rubocop's configuration manual](https://github.com/rubocop-hq/rubocop/blob/
|
|
99
108
|
Note that disabling cops should be an exception for extremely rare cases where your code can not be aligned with Rubocop's requirements.
|
100
109
|
If our defaults don't match your opinion, you should discuss with the team.
|
101
110
|
|
102
|
-
|
103
111
|
## Development
|
104
112
|
|
105
113
|
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -112,12 +120,12 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
112
120
|
2. `bundle`
|
113
121
|
3. `git add remote rubocop https://github.com/rubocop-hq/rubocop.git`
|
114
122
|
4. `git fetch rubocop --no-tags` (we can't import their tags or they would clash with ours)
|
115
|
-
5. Find out the commit SHA of the release you put into the gemspec.
|
116
|
-
6. `git
|
117
|
-
7.
|
118
|
-
8.
|
119
|
-
9. Commit.
|
123
|
+
5. Find out the commit SHA of the release you put into the gemspec and the commit SHA of the newest release (with a tag).
|
124
|
+
6. `git diff $OLDER_SHA $NEWER_SHA config/default.yml | git apply --3way`
|
125
|
+
7. Resolve the merge conflicts carefully and review all changes. We do not want to loose our overrides.
|
126
|
+
8. Commit.
|
120
127
|
|
128
|
+
This procedure is the same for `rubocop-rails`.
|
121
129
|
|
122
130
|
## Contributing
|
123
131
|
|
data/config/default.yml
CHANGED
@@ -54,11 +54,13 @@ AllCops:
|
|
54
54
|
- '**/Puppetfile'
|
55
55
|
- '**/Rakefile'
|
56
56
|
- '**/Snapfile'
|
57
|
+
- '**/Steepfile'
|
57
58
|
- '**/Thorfile'
|
58
59
|
- '**/Vagabondfile'
|
59
60
|
- '**/Vagrantfile'
|
60
61
|
Exclude:
|
61
62
|
- 'node_modules/**/*'
|
63
|
+
- 'tmp/**/*'
|
62
64
|
- 'vendor/**/*'
|
63
65
|
- '.git/**/*'
|
64
66
|
- 'bin/**/*'
|
@@ -145,11 +147,12 @@ Bundler/GemComment:
|
|
145
147
|
Description: 'Add a comment describing each gem.'
|
146
148
|
Enabled: false
|
147
149
|
VersionAdded: '0.59'
|
150
|
+
VersionChanged: '0.77'
|
148
151
|
Include:
|
149
152
|
- '**/*.gemfile'
|
150
153
|
- '**/Gemfile'
|
151
154
|
- '**/gems.rb'
|
152
|
-
|
155
|
+
IgnoredGems: []
|
153
156
|
|
154
157
|
Bundler/InsecureProtocolSource:
|
155
158
|
Description: >-
|
@@ -199,9 +202,10 @@ Gemspec/RequiredRubyVersion:
|
|
199
202
|
VersionAdded: '0.52'
|
200
203
|
Include:
|
201
204
|
- '**/*.gemspec'
|
202
|
-
|
205
|
+
|
203
206
|
Gemspec/RubyVersionGlobalsUsage:
|
204
207
|
Description: Checks usage of RUBY_VERSION in gemspec.
|
208
|
+
StyleGuide: '#no-ruby-version-in-the-gemspec'
|
205
209
|
Enabled: false
|
206
210
|
VersionAdded: '0.72'
|
207
211
|
Include:
|
@@ -222,13 +226,14 @@ Layout/AccessModifierIndentation:
|
|
222
226
|
# But it can be overridden by setting this parameter
|
223
227
|
IndentationWidth: ~
|
224
228
|
|
225
|
-
Layout/
|
229
|
+
Layout/ArgumentAlignment:
|
226
230
|
Description: >-
|
227
231
|
Align the arguments of a method call if they span more
|
228
232
|
than one line.
|
229
233
|
StyleGuide: '#no-double-indent'
|
230
234
|
Enabled: false
|
231
235
|
VersionAdded: '0.68'
|
236
|
+
VersionChanged: '0.77'
|
232
237
|
# Alignment of arguments in multi-line method calls.
|
233
238
|
#
|
234
239
|
# The `with_first_argument` style aligns the following lines along the same
|
@@ -250,120 +255,46 @@ Layout/AlignArguments:
|
|
250
255
|
# But it can be overridden by setting this parameter
|
251
256
|
IndentationWidth: ~
|
252
257
|
|
253
|
-
Layout/
|
254
|
-
Description: >-
|
255
|
-
Align the elements of an array literal if they span more than
|
256
|
-
one line.
|
257
|
-
StyleGuide: '#align-multiline-arrays'
|
258
|
-
Enabled: false
|
259
|
-
VersionAdded: '0.49'
|
260
|
-
|
261
|
-
Layout/AlignHash:
|
258
|
+
Layout/ArrayAlignment:
|
262
259
|
Description: >-
|
263
|
-
|
264
|
-
|
265
|
-
Enabled: false
|
266
|
-
AllowMultipleStyles: true
|
267
|
-
VersionAdded: '0.49'
|
268
|
-
# Alignment of entries using hash rocket as separator. Valid values are:
|
269
|
-
#
|
270
|
-
# key - left alignment of keys
|
271
|
-
# 'a' => 2
|
272
|
-
# 'bb' => 3
|
273
|
-
# separator - alignment of hash rockets, keys are right aligned
|
274
|
-
# 'a' => 2
|
275
|
-
# 'bb' => 3
|
276
|
-
# table - left alignment of keys, hash rockets, and values
|
277
|
-
# 'a' => 2
|
278
|
-
# 'bb' => 3
|
279
|
-
EnforcedHashRocketStyle: key
|
280
|
-
SupportedHashRocketStyles:
|
281
|
-
- key
|
282
|
-
- separator
|
283
|
-
- table
|
284
|
-
# Alignment of entries using colon as separator. Valid values are:
|
285
|
-
#
|
286
|
-
# key - left alignment of keys
|
287
|
-
# a: 0
|
288
|
-
# bb: 1
|
289
|
-
# separator - alignment of colons, keys are right aligned
|
290
|
-
# a: 0
|
291
|
-
# bb: 1
|
292
|
-
# table - left alignment of keys and values
|
293
|
-
# a: 0
|
294
|
-
# bb: 1
|
295
|
-
EnforcedColonStyle: key
|
296
|
-
SupportedColonStyles:
|
297
|
-
- key
|
298
|
-
- separator
|
299
|
-
- table
|
300
|
-
# Select whether hashes that are the last argument in a method call should be
|
301
|
-
# inspected? Valid values are:
|
302
|
-
#
|
303
|
-
# always_inspect - Inspect both implicit and explicit hashes.
|
304
|
-
# Registers an offense for:
|
305
|
-
# function(a: 1,
|
306
|
-
# b: 2)
|
307
|
-
# Registers an offense for:
|
308
|
-
# function({a: 1,
|
309
|
-
# b: 2})
|
310
|
-
# always_ignore - Ignore both implicit and explicit hashes.
|
311
|
-
# Accepts:
|
312
|
-
# function(a: 1,
|
313
|
-
# b: 2)
|
314
|
-
# Accepts:
|
315
|
-
# function({a: 1,
|
316
|
-
# b: 2})
|
317
|
-
# ignore_implicit - Ignore only implicit hashes.
|
318
|
-
# Accepts:
|
319
|
-
# function(a: 1,
|
320
|
-
# b: 2)
|
321
|
-
# Registers an offense for:
|
322
|
-
# function({a: 1,
|
323
|
-
# b: 2})
|
324
|
-
# ignore_explicit - Ignore only explicit hashes.
|
325
|
-
# Accepts:
|
326
|
-
# function({a: 1,
|
327
|
-
# b: 2})
|
328
|
-
# Registers an offense for:
|
329
|
-
# function(a: 1,
|
330
|
-
# b: 2)
|
331
|
-
EnforcedLastArgumentHashStyle: always_inspect
|
332
|
-
SupportedLastArgumentHashStyles:
|
333
|
-
- always_inspect
|
334
|
-
- always_ignore
|
335
|
-
- ignore_implicit
|
336
|
-
- ignore_explicit
|
337
|
-
|
338
|
-
Layout/AlignParameters:
|
339
|
-
Description: >-
|
340
|
-
Align the parameters of a method definition if they span more
|
341
|
-
than one line.
|
260
|
+
Align the elements of an array literal if they span more than
|
261
|
+
one line.
|
342
262
|
StyleGuide: '#no-double-indent'
|
343
263
|
Enabled: false
|
344
264
|
VersionAdded: '0.49'
|
345
|
-
VersionChanged: '0.
|
346
|
-
# Alignment of
|
265
|
+
VersionChanged: '0.77'
|
266
|
+
# Alignment of elements of a multi-line array.
|
347
267
|
#
|
348
268
|
# The `with_first_parameter` style aligns the following lines along the same
|
349
|
-
# column as the first
|
269
|
+
# column as the first element.
|
350
270
|
#
|
351
|
-
#
|
352
|
-
#
|
271
|
+
# array = [1, 2, 3,
|
272
|
+
# 4, 5, 6]
|
353
273
|
#
|
354
274
|
# The `with_fixed_indentation` style aligns the following lines with one
|
355
|
-
# level of indentation relative to the start of the line with
|
275
|
+
# level of indentation relative to the start of the line with start of array.
|
356
276
|
#
|
357
|
-
#
|
358
|
-
#
|
359
|
-
EnforcedStyle:
|
277
|
+
# array = [1, 2, 3,
|
278
|
+
# 4, 5, 6]
|
279
|
+
EnforcedStyle: with_first_element
|
360
280
|
SupportedStyles:
|
361
|
-
-
|
281
|
+
- with_first_element
|
362
282
|
- with_fixed_indentation
|
363
283
|
# By default, the indentation width from Layout/IndentationWidth is used
|
364
284
|
# But it can be overridden by setting this parameter
|
365
285
|
IndentationWidth: ~
|
366
286
|
|
287
|
+
Layout/AssignmentIndentation:
|
288
|
+
Description: >-
|
289
|
+
Checks the indentation of the first line of the
|
290
|
+
right-hand-side of a multi-line assignment.
|
291
|
+
Enabled: false # We do not want to write the assignment in the following line
|
292
|
+
VersionAdded: '0.49'
|
293
|
+
VersionChanged: '0.77'
|
294
|
+
# By default, the indentation width from `Layout/IndentationWidth` is used
|
295
|
+
# But it can be overridden by setting this parameter
|
296
|
+
IndentationWidth: ~
|
297
|
+
|
367
298
|
Layout/BlockAlignment:
|
368
299
|
Description: 'Align block ends correctly.'
|
369
300
|
Enabled: true
|
@@ -628,57 +559,12 @@ Layout/ExtraSpacing:
|
|
628
559
|
# When true, forces the alignment of `=` in assignments on consecutive lines.
|
629
560
|
ForceEqualSignAlignment: false
|
630
561
|
|
631
|
-
Layout/
|
632
|
-
Description: >-
|
633
|
-
Checks for a line break before the first element in a
|
634
|
-
multi-line array.
|
635
|
-
Enabled: false
|
636
|
-
VersionAdded: '0.49'
|
637
|
-
|
638
|
-
Layout/FirstHashElementLineBreak:
|
639
|
-
Description: >-
|
640
|
-
Checks for a line break before the first element in a
|
641
|
-
multi-line hash.
|
642
|
-
Enabled: false
|
643
|
-
VersionAdded: '0.49'
|
644
|
-
|
645
|
-
Layout/FirstMethodArgumentLineBreak:
|
646
|
-
Description: >-
|
647
|
-
Checks for a line break before the first argument in a
|
648
|
-
multi-line method call.
|
649
|
-
Enabled: false
|
650
|
-
VersionAdded: '0.49'
|
651
|
-
|
652
|
-
Layout/FirstMethodParameterLineBreak:
|
653
|
-
Description: >-
|
654
|
-
Checks for a line break before the first parameter in a
|
655
|
-
multi-line method parameter definition.
|
656
|
-
Enabled: false
|
657
|
-
VersionAdded: '0.49'
|
658
|
-
|
659
|
-
Layout/HeredocArgumentClosingParenthesis:
|
660
|
-
Description: >-
|
661
|
-
Checks for the placement of the closing parenthesis in a
|
662
|
-
method call that passes a HEREDOC string as an argument.
|
663
|
-
Enabled: false
|
664
|
-
StyleGuide: '#heredoc-argument-closing-parentheses'
|
665
|
-
VersionAdded: '0.68'
|
666
|
-
|
667
|
-
Layout/IndentAssignment:
|
668
|
-
Description: >-
|
669
|
-
Checks the indentation of the first line of the
|
670
|
-
right-hand-side of a multi-line assignment.
|
671
|
-
Enabled: false # We do not want to write the assignment in the following line
|
672
|
-
VersionAdded: '0.49'
|
673
|
-
# By default, the indentation width from `Layout/IndentationWidth` is used
|
674
|
-
# But it can be overridden by setting this parameter
|
675
|
-
IndentationWidth: ~
|
676
|
-
|
677
|
-
Layout/IndentFirstArgument:
|
562
|
+
Layout/FirstArgumentIndentation:
|
678
563
|
Description: 'Checks the indentation of the first argument in a method call.'
|
679
564
|
Enabled: true
|
680
565
|
VersionAdded: '0.68'
|
681
|
-
|
566
|
+
VersionChanged: '0.77'
|
567
|
+
EnforcedStyle: consistent
|
682
568
|
SupportedStyles:
|
683
569
|
# The first parameter should always be indented one step more than the
|
684
570
|
# preceding line.
|
@@ -698,12 +584,13 @@ Layout/IndentFirstArgument:
|
|
698
584
|
# But it can be overridden by setting this parameter
|
699
585
|
IndentationWidth: ~
|
700
586
|
|
701
|
-
Layout/
|
587
|
+
Layout/FirstArrayElementIndentation:
|
702
588
|
Description: >-
|
703
589
|
Checks the indentation of the first element in an array
|
704
590
|
literal.
|
705
591
|
Enabled: true
|
706
592
|
VersionAdded: '0.68'
|
593
|
+
VersionChanged: '0.77'
|
707
594
|
# The value `special_inside_parentheses` means that array literals with
|
708
595
|
# brackets that have their opening bracket on the same line as a surrounding
|
709
596
|
# opening round parenthesis, shall have their first element indented relative
|
@@ -724,10 +611,18 @@ Layout/IndentFirstArrayElement:
|
|
724
611
|
# But it can be overridden by setting this parameter
|
725
612
|
IndentationWidth: ~
|
726
613
|
|
727
|
-
Layout/
|
614
|
+
Layout/FirstArrayElementLineBreak:
|
615
|
+
Description: >-
|
616
|
+
Checks for a line break before the first element in a
|
617
|
+
multi-line array.
|
618
|
+
Enabled: false
|
619
|
+
VersionAdded: '0.49'
|
620
|
+
|
621
|
+
Layout/FirstHashElementIndentation:
|
728
622
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
729
623
|
Enabled: true
|
730
624
|
VersionAdded: '0.68'
|
625
|
+
VersionChanged: '0.77'
|
731
626
|
# The value `special_inside_parentheses` means that hash literals with braces
|
732
627
|
# that have their opening brace on the same line as a surrounding opening
|
733
628
|
# round parenthesis, shall have their first key indented relative to the
|
@@ -748,13 +643,34 @@ Layout/IndentFirstHashElement:
|
|
748
643
|
# But it can be overridden by setting this parameter
|
749
644
|
IndentationWidth: ~
|
750
645
|
|
751
|
-
Layout/
|
646
|
+
Layout/FirstHashElementLineBreak:
|
647
|
+
Description: >-
|
648
|
+
Checks for a line break before the first element in a
|
649
|
+
multi-line hash.
|
650
|
+
Enabled: false
|
651
|
+
VersionAdded: '0.49'
|
652
|
+
|
653
|
+
Layout/FirstMethodArgumentLineBreak:
|
654
|
+
Description: >-
|
655
|
+
Checks for a line break before the first argument in a
|
656
|
+
multi-line method call.
|
657
|
+
Enabled: false
|
658
|
+
VersionAdded: '0.49'
|
659
|
+
|
660
|
+
Layout/FirstMethodParameterLineBreak:
|
661
|
+
Description: >-
|
662
|
+
Checks for a line break before the first parameter in a
|
663
|
+
multi-line method parameter definition.
|
664
|
+
Enabled: false
|
665
|
+
VersionAdded: '0.49'
|
666
|
+
|
667
|
+
Layout/FirstParameterIndentation:
|
752
668
|
Description: >-
|
753
669
|
Checks the indentation of the first parameter in a
|
754
670
|
method definition.
|
755
671
|
Enabled: true
|
756
672
|
VersionAdded: '0.49'
|
757
|
-
VersionChanged: '0.
|
673
|
+
VersionChanged: '0.77'
|
758
674
|
EnforcedStyle: consistent
|
759
675
|
SupportedStyles:
|
760
676
|
- consistent
|
@@ -763,12 +679,98 @@ Layout/IndentFirstParameter:
|
|
763
679
|
# But it can be overridden by setting this parameter
|
764
680
|
IndentationWidth: ~
|
765
681
|
|
766
|
-
Layout/
|
682
|
+
Layout/HashAlignment:
|
683
|
+
Description: >-
|
684
|
+
Align the elements of a hash literal if they span more than
|
685
|
+
one line.
|
686
|
+
Enabled: false
|
687
|
+
AllowMultipleStyles: true
|
688
|
+
VersionAdded: '0.49'
|
689
|
+
VersionChanged: '0.77'
|
690
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
691
|
+
#
|
692
|
+
# key - left alignment of keys
|
693
|
+
# 'a' => 2
|
694
|
+
# 'bb' => 3
|
695
|
+
# separator - alignment of hash rockets, keys are right aligned
|
696
|
+
# 'a' => 2
|
697
|
+
# 'bb' => 3
|
698
|
+
# table - left alignment of keys, hash rockets, and values
|
699
|
+
# 'a' => 2
|
700
|
+
# 'bb' => 3
|
701
|
+
EnforcedHashRocketStyle: key
|
702
|
+
SupportedHashRocketStyles:
|
703
|
+
- key
|
704
|
+
- separator
|
705
|
+
- table
|
706
|
+
# Alignment of entries using colon as separator. Valid values are:
|
707
|
+
#
|
708
|
+
# key - left alignment of keys
|
709
|
+
# a: 0
|
710
|
+
# bb: 1
|
711
|
+
# separator - alignment of colons, keys are right aligned
|
712
|
+
# a: 0
|
713
|
+
# bb: 1
|
714
|
+
# table - left alignment of keys and values
|
715
|
+
# a: 0
|
716
|
+
# bb: 1
|
717
|
+
EnforcedColonStyle: key
|
718
|
+
SupportedColonStyles:
|
719
|
+
- key
|
720
|
+
- separator
|
721
|
+
- table
|
722
|
+
# Select whether hashes that are the last argument in a method call should be
|
723
|
+
# inspected? Valid values are:
|
724
|
+
#
|
725
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
726
|
+
# Registers an offense for:
|
727
|
+
# function(a: 1,
|
728
|
+
# b: 2)
|
729
|
+
# Registers an offense for:
|
730
|
+
# function({a: 1,
|
731
|
+
# b: 2})
|
732
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
733
|
+
# Accepts:
|
734
|
+
# function(a: 1,
|
735
|
+
# b: 2)
|
736
|
+
# Accepts:
|
737
|
+
# function({a: 1,
|
738
|
+
# b: 2})
|
739
|
+
# ignore_implicit - Ignore only implicit hashes.
|
740
|
+
# Accepts:
|
741
|
+
# function(a: 1,
|
742
|
+
# b: 2)
|
743
|
+
# Registers an offense for:
|
744
|
+
# function({a: 1,
|
745
|
+
# b: 2})
|
746
|
+
# ignore_explicit - Ignore only explicit hashes.
|
747
|
+
# Accepts:
|
748
|
+
# function({a: 1,
|
749
|
+
# b: 2})
|
750
|
+
# Registers an offense for:
|
751
|
+
# function(a: 1,
|
752
|
+
# b: 2)
|
753
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
754
|
+
SupportedLastArgumentHashStyles:
|
755
|
+
- always_inspect
|
756
|
+
- always_ignore
|
757
|
+
- ignore_implicit
|
758
|
+
- ignore_explicit
|
759
|
+
|
760
|
+
Layout/HeredocArgumentClosingParenthesis:
|
761
|
+
Description: >-
|
762
|
+
Checks for the placement of the closing parenthesis in a
|
763
|
+
method call that passes a HEREDOC string as an argument.
|
764
|
+
Enabled: false
|
765
|
+
StyleGuide: '#heredoc-argument-closing-parentheses'
|
766
|
+
VersionAdded: '0.68'
|
767
|
+
|
768
|
+
Layout/HeredocIndentation:
|
767
769
|
Description: 'This cop checks the indentation of the here document bodies.'
|
768
770
|
StyleGuide: '#squiggly-heredocs'
|
769
771
|
Enabled: true
|
770
772
|
VersionAdded: '0.49'
|
771
|
-
VersionChanged: '0.
|
773
|
+
VersionChanged: '0.77'
|
772
774
|
EnforcedStyle: squiggly
|
773
775
|
SupportedStyles:
|
774
776
|
- squiggly
|
@@ -810,11 +812,6 @@ Layout/InitialIndentation:
|
|
810
812
|
Enabled: true
|
811
813
|
VersionAdded: '0.49'
|
812
814
|
|
813
|
-
Layout/LeadingBlankLines:
|
814
|
-
Description: Check for unnecessary blank lines at the beginning of a file.
|
815
|
-
Enabled: true
|
816
|
-
VersionAdded: '0.57'
|
817
|
-
|
818
815
|
Layout/LeadingCommentSpace:
|
819
816
|
Description: 'Comments should start with a space.'
|
820
817
|
StyleGuide: '#hash-space'
|
@@ -822,6 +819,36 @@ Layout/LeadingCommentSpace:
|
|
822
819
|
VersionAdded: '0.49'
|
823
820
|
VersionChanged: '0.73'
|
824
821
|
AllowDoxygenCommentStyle: false
|
822
|
+
AllowGemfileRubyComment: false
|
823
|
+
|
824
|
+
Layout/LeadingEmptyLines:
|
825
|
+
Description: Check for unnecessary blank lines at the beginning of a file.
|
826
|
+
Enabled: true
|
827
|
+
VersionAdded: '0.57'
|
828
|
+
VersionChanged: '0.77'
|
829
|
+
|
830
|
+
Layout/LineLength:
|
831
|
+
Description: 'Limit lines to 80 characters.'
|
832
|
+
StyleGuide: '#80-character-limits'
|
833
|
+
Enabled: false
|
834
|
+
VersionAdded: '0.25'
|
835
|
+
VersionChanged: '0.78'
|
836
|
+
AutoCorrect: false
|
837
|
+
Max: 80
|
838
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
839
|
+
# containing a URI to be longer than Max.
|
840
|
+
AllowHeredoc: true
|
841
|
+
AllowURI: true
|
842
|
+
URISchemes:
|
843
|
+
- http
|
844
|
+
- https
|
845
|
+
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
846
|
+
# directives like '# rubocop: enable ...' when calculating a line's length.
|
847
|
+
IgnoreCopDirectives: true
|
848
|
+
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
849
|
+
# elements. Strings will be converted to Regexp objects. A line that matches
|
850
|
+
# any regular expression listed in this option will be ignored by LineLength.
|
851
|
+
IgnoredPatterns: []
|
825
852
|
|
826
853
|
Layout/MultilineArrayBraceLayout:
|
827
854
|
Description: >-
|
@@ -964,9 +991,38 @@ Layout/MultilineOperationIndentation:
|
|
964
991
|
# But it can be overridden by setting this parameter
|
965
992
|
IndentationWidth: ~
|
966
993
|
|
994
|
+
Layout/ParameterAlignment:
|
995
|
+
Description: >-
|
996
|
+
Align the parameters of a method definition if they span more
|
997
|
+
than one line.
|
998
|
+
StyleGuide: '#no-double-indent'
|
999
|
+
Enabled: true
|
1000
|
+
VersionAdded: '0.49'
|
1001
|
+
VersionChanged: '0.77'
|
1002
|
+
# Alignment of parameters in multi-line method calls.
|
1003
|
+
#
|
1004
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
1005
|
+
# column as the first parameter.
|
1006
|
+
#
|
1007
|
+
# def method_foo(a,
|
1008
|
+
# b)
|
1009
|
+
#
|
1010
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
1011
|
+
# level of indentation relative to the start of the line with the method call.
|
1012
|
+
#
|
1013
|
+
# def method_foo(a,
|
1014
|
+
# b)
|
1015
|
+
EnforcedStyle: with_first_parameter
|
1016
|
+
SupportedStyles:
|
1017
|
+
- with_first_parameter
|
1018
|
+
- with_fixed_indentation
|
1019
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
1020
|
+
# But it can be overridden by setting this parameter
|
1021
|
+
IndentationWidth: ~
|
1022
|
+
|
967
1023
|
Layout/RescueEnsureAlignment:
|
968
1024
|
Description: 'Align rescues and ensures correctly.'
|
969
|
-
Enabled:
|
1025
|
+
Enabled: false # Temporary disable this cop again #16, rubocop-hq/rubocop#6771 seems not have fixed the issue
|
970
1026
|
VersionAdded: '0.49'
|
971
1027
|
|
972
1028
|
Layout/SpaceAfterColon:
|
@@ -1037,6 +1093,10 @@ Layout/SpaceAroundOperators:
|
|
1037
1093
|
# with an operator on the previous or next line, not counting empty lines
|
1038
1094
|
# or comment lines.
|
1039
1095
|
AllowForAlignment: true
|
1096
|
+
EnforcedStyleForExponentOperator: no_space
|
1097
|
+
SupportedStylesForExponentOperator:
|
1098
|
+
- space
|
1099
|
+
- no_space
|
1040
1100
|
|
1041
1101
|
Layout/SpaceBeforeBlockBraces:
|
1042
1102
|
Description: >-
|
@@ -1206,11 +1266,12 @@ Layout/Tab:
|
|
1206
1266
|
# replace each tab.
|
1207
1267
|
IndentationWidth: ~
|
1208
1268
|
|
1209
|
-
Layout/
|
1269
|
+
Layout/TrailingEmptyLines:
|
1210
1270
|
Description: 'Checks trailing blank lines and final newline.'
|
1211
1271
|
StyleGuide: '#newline-eof'
|
1212
1272
|
Enabled: true
|
1213
1273
|
VersionAdded: '0.49'
|
1274
|
+
VersionChanged: '0.77'
|
1214
1275
|
EnforcedStyle: final_newline
|
1215
1276
|
SupportedStyles:
|
1216
1277
|
- final_newline
|
@@ -1266,6 +1327,7 @@ Lint/BooleanSymbol:
|
|
1266
1327
|
Description: 'Check for `:true` and `:false` symbols.'
|
1267
1328
|
Enabled: true
|
1268
1329
|
VersionAdded: '0.50'
|
1330
|
+
VersionChanged: '0.81'
|
1269
1331
|
|
1270
1332
|
Lint/CircularArgumentReference:
|
1271
1333
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
@@ -1294,16 +1356,17 @@ Lint/DuplicateCaseCondition:
|
|
1294
1356
|
Enabled: true
|
1295
1357
|
VersionAdded: '0.45'
|
1296
1358
|
|
1359
|
+
Lint/DuplicateHashKey:
|
1360
|
+
Description: 'Check for duplicate keys in hash literals.'
|
1361
|
+
Enabled: true
|
1362
|
+
VersionAdded: '0.34'
|
1363
|
+
VersionChanged: '0.77'
|
1364
|
+
|
1297
1365
|
Lint/DuplicateMethods:
|
1298
1366
|
Description: 'Check for duplicate method definitions.'
|
1299
1367
|
Enabled: true
|
1300
1368
|
VersionAdded: '0.29'
|
1301
1369
|
|
1302
|
-
Lint/DuplicatedKey:
|
1303
|
-
Description: 'Check for duplicate keys in hash literals.'
|
1304
|
-
Enabled: true
|
1305
|
-
VersionAdded: '0.34'
|
1306
|
-
|
1307
1370
|
Lint/EachWithObjectArgument:
|
1308
1371
|
Description: 'Check for immutable argument given to each_with_object.'
|
1309
1372
|
Enabled: true
|
@@ -1334,14 +1397,9 @@ Lint/EmptyInterpolation:
|
|
1334
1397
|
|
1335
1398
|
Lint/EmptyWhen:
|
1336
1399
|
Description: 'Checks for `when` branches with empty bodies.'
|
1337
|
-
Enabled:
|
1400
|
+
Enabled: false # We want to write comments in when branches without any return value https://github.com/makandra/makandra-rubocop/issues/18
|
1338
1401
|
VersionAdded: '0.45'
|
1339
1402
|
|
1340
|
-
Lint/EndInMethod:
|
1341
|
-
Description: 'END blocks should not be placed inside method definitions.'
|
1342
|
-
Enabled: true
|
1343
|
-
VersionAdded: '0.9'
|
1344
|
-
|
1345
1403
|
Lint/EnsureReturn:
|
1346
1404
|
Description: 'Do not use return in an ensure block.'
|
1347
1405
|
StyleGuide: '#no-return-ensure'
|
@@ -1371,14 +1429,6 @@ Lint/FormatParameterMismatch:
|
|
1371
1429
|
Enabled: true
|
1372
1430
|
VersionAdded: '0.33'
|
1373
1431
|
|
1374
|
-
Lint/HandleExceptions:
|
1375
|
-
Description: "Don't suppress exception."
|
1376
|
-
StyleGuide: '#dont-hide-exceptions'
|
1377
|
-
Enabled: false
|
1378
|
-
AllowComments: false
|
1379
|
-
VersionAdded: '0.9'
|
1380
|
-
VersionChanged: '0.70'
|
1381
|
-
|
1382
1432
|
Lint/HeredocMethodCallPosition:
|
1383
1433
|
Description: >-
|
1384
1434
|
Checks for the ordering of a method call where
|
@@ -1448,10 +1498,11 @@ Lint/MissingCopEnableDirective:
|
|
1448
1498
|
# .inf for any size
|
1449
1499
|
MaximumRangeSize: .inf
|
1450
1500
|
|
1451
|
-
Lint/
|
1452
|
-
Description: "Use `&&` operator to compare multiple
|
1501
|
+
Lint/MultipleComparison:
|
1502
|
+
Description: "Use `&&` operator to compare multiple values."
|
1453
1503
|
Enabled: true
|
1454
1504
|
VersionAdded: '0.47'
|
1505
|
+
VersionChanged: '0.77'
|
1455
1506
|
|
1456
1507
|
Lint/NestedMethodDefinition:
|
1457
1508
|
Description: 'Do not use nested method definitions.'
|
@@ -1471,6 +1522,12 @@ Lint/NextWithoutAccumulator:
|
|
1471
1522
|
Enabled: true
|
1472
1523
|
VersionAdded: '0.36'
|
1473
1524
|
|
1525
|
+
Lint/NonDeterministicRequireOrder:
|
1526
|
+
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1527
|
+
Enabled: true
|
1528
|
+
VersionAdded: '0.78'
|
1529
|
+
Safe: false
|
1530
|
+
|
1474
1531
|
Lint/NonLocalExitFromIterator:
|
1475
1532
|
Description: 'Do not use return in iterator to cause non-local exit.'
|
1476
1533
|
Enabled: true
|
@@ -1509,6 +1566,12 @@ Lint/PercentSymbolArray:
|
|
1509
1566
|
Enabled: true
|
1510
1567
|
VersionAdded: '0.41'
|
1511
1568
|
|
1569
|
+
Lint/RaiseException:
|
1570
|
+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1571
|
+
StyleGuide: '#raise-exception'
|
1572
|
+
Enabled: true
|
1573
|
+
VersionAdded: '0.81'
|
1574
|
+
|
1512
1575
|
Lint/RandOne:
|
1513
1576
|
Description: >-
|
1514
1577
|
Checks for `rand(1)` calls. Such calls always return `0`
|
@@ -1537,7 +1600,14 @@ Lint/RedundantRequireStatement:
|
|
1537
1600
|
Lint/RedundantSplatExpansion:
|
1538
1601
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
1539
1602
|
Enabled: true
|
1540
|
-
|
1603
|
+
VersionAdded: '0.76'
|
1604
|
+
|
1605
|
+
Lint/RedundantStringCoercion:
|
1606
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
1607
|
+
StyleGuide: '#no-to-s'
|
1608
|
+
Enabled: true
|
1609
|
+
VersionAdded: '0.19'
|
1610
|
+
VersionChanged: '0.77'
|
1541
1611
|
|
1542
1612
|
Lint/RedundantWithIndex:
|
1543
1613
|
Description: 'Checks for redundant `with_index`.'
|
@@ -1584,8 +1654,8 @@ Lint/SafeNavigationChain:
|
|
1584
1654
|
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
1585
1655
|
Enabled: true
|
1586
1656
|
VersionAdded: '0.47'
|
1587
|
-
VersionChanged: '0.
|
1588
|
-
|
1657
|
+
VersionChanged: '0.77'
|
1658
|
+
AllowedMethods:
|
1589
1659
|
- present?
|
1590
1660
|
- blank?
|
1591
1661
|
- presence
|
@@ -1599,14 +1669,14 @@ Lint/SafeNavigationConsistency:
|
|
1599
1669
|
for all method calls on that same object.
|
1600
1670
|
Enabled: true
|
1601
1671
|
VersionAdded: '0.55'
|
1602
|
-
|
1672
|
+
VersionChanged: '0.77'
|
1673
|
+
AllowedMethods:
|
1603
1674
|
- present?
|
1604
1675
|
- blank?
|
1605
1676
|
- presence
|
1606
1677
|
- try
|
1607
1678
|
- try!
|
1608
1679
|
|
1609
|
-
|
1610
1680
|
Lint/SafeNavigationWithEmpty:
|
1611
1681
|
Description: 'Avoid `foo&.empty?` in conditionals.'
|
1612
1682
|
Enabled: true
|
@@ -1644,12 +1714,18 @@ Lint/ShadowingOuterLocalVariable:
|
|
1644
1714
|
Enabled: true
|
1645
1715
|
VersionAdded: '0.9'
|
1646
1716
|
|
1647
|
-
Lint/
|
1648
|
-
Description: '
|
1649
|
-
StyleGuide: '#no-to-s'
|
1717
|
+
Lint/StructNewOverride:
|
1718
|
+
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1650
1719
|
Enabled: true
|
1651
|
-
VersionAdded: '0.
|
1652
|
-
|
1720
|
+
VersionAdded: '0.81'
|
1721
|
+
|
1722
|
+
Lint/SuppressedException:
|
1723
|
+
Description: "Don't suppress exceptions."
|
1724
|
+
StyleGuide: '#dont-hide-exceptions'
|
1725
|
+
Enabled: true
|
1726
|
+
AllowComments: true
|
1727
|
+
VersionAdded: '0.9'
|
1728
|
+
VersionChanged: '0.81'
|
1653
1729
|
|
1654
1730
|
Lint/Syntax:
|
1655
1731
|
Description: 'Checks syntax error.'
|
@@ -1660,6 +1736,7 @@ Lint/Syntax:
|
|
1660
1736
|
Lint/ToJSON:
|
1661
1737
|
Description: 'Ensure #to_json includes an optional argument.'
|
1662
1738
|
Enabled: true
|
1739
|
+
VersionAdded: '0.66'
|
1663
1740
|
|
1664
1741
|
Lint/UnderscorePrefixedVariableName:
|
1665
1742
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
@@ -1691,9 +1768,10 @@ Lint/UnusedMethodArgument:
|
|
1691
1768
|
StyleGuide: '#underscore-unused-vars'
|
1692
1769
|
Enabled: true
|
1693
1770
|
VersionAdded: '0.21'
|
1694
|
-
VersionChanged: '0.
|
1771
|
+
VersionChanged: '0.81'
|
1695
1772
|
AllowUnusedKeywordArguments: false
|
1696
1773
|
IgnoreEmptyMethods: true
|
1774
|
+
IgnoreNotImplementedMethods: true
|
1697
1775
|
|
1698
1776
|
Lint/UriEscapeUnescape:
|
1699
1777
|
Description: >-
|
@@ -1739,6 +1817,8 @@ Lint/UselessSetterCall:
|
|
1739
1817
|
Description: 'Checks for useless setter call to a local variable.'
|
1740
1818
|
Enabled: true
|
1741
1819
|
VersionAdded: '0.13'
|
1820
|
+
VersionChanged: '0.80'
|
1821
|
+
Safe: false
|
1742
1822
|
|
1743
1823
|
Lint/Void:
|
1744
1824
|
Description: 'Possible use of operator/literal/variable in void context.'
|
@@ -1757,9 +1837,10 @@ Metrics/AbcSize:
|
|
1757
1837
|
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
1758
1838
|
Enabled: false
|
1759
1839
|
VersionAdded: '0.27'
|
1760
|
-
VersionChanged: '0.
|
1840
|
+
VersionChanged: '0.81'
|
1761
1841
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
1762
1842
|
# a Float.
|
1843
|
+
IgnoredMethods: []
|
1763
1844
|
Max: 15
|
1764
1845
|
|
1765
1846
|
Metrics/BlockLength:
|
@@ -1799,31 +1880,10 @@ Metrics/CyclomaticComplexity:
|
|
1799
1880
|
of test cases needed to validate a method.
|
1800
1881
|
Enabled: false
|
1801
1882
|
VersionAdded: '0.25'
|
1883
|
+
VersionChanged: '0.81'
|
1884
|
+
IgnoredMethods: []
|
1802
1885
|
Max: 6
|
1803
1886
|
|
1804
|
-
Metrics/LineLength:
|
1805
|
-
Description: 'Limit lines to 80 characters.'
|
1806
|
-
StyleGuide: '#80-character-limits'
|
1807
|
-
Enabled: false
|
1808
|
-
VersionAdded: '0.25'
|
1809
|
-
VersionChanged: '0.68'
|
1810
|
-
AutoCorrect: false
|
1811
|
-
Max: 80
|
1812
|
-
# To make it possible to copy or click on URIs in the code, we allow lines
|
1813
|
-
# containing a URI to be longer than Max.
|
1814
|
-
AllowHeredoc: true
|
1815
|
-
AllowURI: true
|
1816
|
-
URISchemes:
|
1817
|
-
- http
|
1818
|
-
- https
|
1819
|
-
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
1820
|
-
# directives like '# rubocop: enable ...' when calculating a line's length.
|
1821
|
-
IgnoreCopDirectives: false
|
1822
|
-
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
1823
|
-
# elements. Strings will be converted to Regexp objects. A line that matches
|
1824
|
-
# any regular expression listed in this option will be ignored by LineLength.
|
1825
|
-
IgnoredPatterns: []
|
1826
|
-
|
1827
1887
|
Metrics/MethodLength:
|
1828
1888
|
Description: 'Avoid methods longer than 10 lines of code.'
|
1829
1889
|
StyleGuide: '#short-methods'
|
@@ -1855,6 +1915,8 @@ Metrics/PerceivedComplexity:
|
|
1855
1915
|
human reader.
|
1856
1916
|
Enabled: false
|
1857
1917
|
VersionAdded: '0.25'
|
1918
|
+
VersionChanged: '0.81'
|
1919
|
+
IgnoredMethods: []
|
1858
1920
|
Max: 7
|
1859
1921
|
|
1860
1922
|
################## Migration #############################
|
@@ -1863,7 +1925,8 @@ Migration/DepartmentName:
|
|
1863
1925
|
Description: >-
|
1864
1926
|
Check that cop names in rubocop:disable (etc) comments are
|
1865
1927
|
given with department name.
|
1866
|
-
Enabled:
|
1928
|
+
Enabled: true
|
1929
|
+
VersionAdded: '0.75'
|
1867
1930
|
|
1868
1931
|
#################### Naming ##############################
|
1869
1932
|
|
@@ -1885,6 +1948,21 @@ Naming/BinaryOperatorParameterName:
|
|
1885
1948
|
Enabled: false
|
1886
1949
|
VersionAdded: '0.50'
|
1887
1950
|
|
1951
|
+
Naming/BlockParameterName:
|
1952
|
+
Description: >-
|
1953
|
+
Checks for block parameter names that contain capital letters,
|
1954
|
+
end in numbers, or do not meet a minimal length.
|
1955
|
+
Enabled: true
|
1956
|
+
VersionAdded: '0.53'
|
1957
|
+
VersionChanged: '0.77'
|
1958
|
+
# Parameter names may be equal to or greater than this value
|
1959
|
+
MinNameLength: 1
|
1960
|
+
AllowNamesEndingInNumbers: true
|
1961
|
+
# Allowed names that will not register an offense
|
1962
|
+
AllowedNames: []
|
1963
|
+
# Forbidden names that will register an offense
|
1964
|
+
ForbiddenNames: []
|
1965
|
+
|
1888
1966
|
Naming/ClassAndModuleCamelCase:
|
1889
1967
|
Description: 'Use CamelCase for classes and modules.'
|
1890
1968
|
StyleGuide: '#camelcase-classes'
|
@@ -1976,7 +2054,7 @@ Naming/HeredocDelimiterNaming:
|
|
1976
2054
|
StyleGuide: '#heredoc-delimiters'
|
1977
2055
|
Enabled: true
|
1978
2056
|
VersionAdded: '0.50'
|
1979
|
-
|
2057
|
+
ForbiddenDelimiters:
|
1980
2058
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
1981
2059
|
|
1982
2060
|
Naming/MemoizedInstanceVariableName:
|
@@ -2008,25 +2086,51 @@ Naming/MethodName:
|
|
2008
2086
|
#
|
2009
2087
|
IgnoredPatterns: []
|
2010
2088
|
|
2089
|
+
Naming/MethodParameterName:
|
2090
|
+
Description: >-
|
2091
|
+
Checks for method parameter names that contain capital letters,
|
2092
|
+
end in numbers, or do not meet a minimal length.
|
2093
|
+
Enabled: true
|
2094
|
+
VersionAdded: '0.53'
|
2095
|
+
VersionChanged: '0.77'
|
2096
|
+
# Parameter names may be equal to or greater than this value
|
2097
|
+
MinNameLength: 1
|
2098
|
+
AllowNamesEndingInNumbers: true
|
2099
|
+
# Allowed names that will not register an offense
|
2100
|
+
AllowedNames:
|
2101
|
+
- io
|
2102
|
+
- id
|
2103
|
+
- to
|
2104
|
+
- by
|
2105
|
+
- 'on'
|
2106
|
+
- in
|
2107
|
+
- at
|
2108
|
+
- ip
|
2109
|
+
- db
|
2110
|
+
- os
|
2111
|
+
- pp
|
2112
|
+
# Forbidden names that will register an offense
|
2113
|
+
ForbiddenNames: []
|
2114
|
+
|
2011
2115
|
Naming/PredicateName:
|
2012
2116
|
Description: 'Check the names of predicate methods.'
|
2013
2117
|
StyleGuide: '#bool-methods-qmark'
|
2014
2118
|
Enabled: false # It is not very important for us and there are cases where people want to use it (See issue #6)
|
2015
2119
|
VersionAdded: '0.50'
|
2016
|
-
VersionChanged: '0.
|
2120
|
+
VersionChanged: '0.77'
|
2017
2121
|
# Predicate name prefixes.
|
2018
2122
|
NamePrefix:
|
2019
2123
|
- is_
|
2020
2124
|
- has_
|
2021
2125
|
- have_
|
2022
2126
|
# Predicate name prefixes that should be removed.
|
2023
|
-
|
2127
|
+
ForbiddenPrefixes:
|
2024
2128
|
- is_
|
2025
2129
|
- has_
|
2026
2130
|
- have_
|
2027
|
-
# Predicate names which, despite having a
|
2131
|
+
# Predicate names which, despite having a forbidden prefix, or no `?`,
|
2028
2132
|
# should still be accepted
|
2029
|
-
|
2133
|
+
AllowedMethods:
|
2030
2134
|
- is_a?
|
2031
2135
|
# Method definition macros for dynamically generated methods.
|
2032
2136
|
MethodDefinitionMacros:
|
@@ -2039,51 +2143,11 @@ Naming/PredicateName:
|
|
2039
2143
|
|
2040
2144
|
Naming/RescuedExceptionsVariableName:
|
2041
2145
|
Description: 'Use consistent rescued exceptions variables naming.'
|
2042
|
-
Enabled:
|
2146
|
+
Enabled: false # We want to be more flexible with the exception name #19
|
2043
2147
|
VersionAdded: '0.67'
|
2044
2148
|
VersionChanged: '0.68'
|
2045
2149
|
PreferredName: e
|
2046
2150
|
|
2047
|
-
Naming/UncommunicativeBlockParamName:
|
2048
|
-
Description: >-
|
2049
|
-
Checks for block parameter names that contain capital letters,
|
2050
|
-
end in numbers, or do not meet a minimal length.
|
2051
|
-
Enabled: false
|
2052
|
-
VersionAdded: '0.53'
|
2053
|
-
# Parameter names may be equal to or greater than this value
|
2054
|
-
MinNameLength: 1
|
2055
|
-
AllowNamesEndingInNumbers: true
|
2056
|
-
# Whitelisted names that will not register an offense
|
2057
|
-
AllowedNames: []
|
2058
|
-
# Blacklisted names that will register an offense
|
2059
|
-
ForbiddenNames: []
|
2060
|
-
|
2061
|
-
Naming/UncommunicativeMethodParamName:
|
2062
|
-
Description: >-
|
2063
|
-
Checks for method parameter names that contain capital letters,
|
2064
|
-
end in numbers, or do not meet a minimal length.
|
2065
|
-
Enabled: false
|
2066
|
-
VersionAdded: '0.53'
|
2067
|
-
VersionChanged: '0.59'
|
2068
|
-
# Parameter names may be equal to or greater than this value
|
2069
|
-
MinNameLength: 3
|
2070
|
-
AllowNamesEndingInNumbers: true
|
2071
|
-
# Whitelisted names that will not register an offense
|
2072
|
-
AllowedNames:
|
2073
|
-
- io
|
2074
|
-
- id
|
2075
|
-
- to
|
2076
|
-
- by
|
2077
|
-
- 'on'
|
2078
|
-
- in
|
2079
|
-
- at
|
2080
|
-
- ip
|
2081
|
-
- db
|
2082
|
-
- os
|
2083
|
-
# Blacklisted names that will register an offense
|
2084
|
-
ForbiddenNames: []
|
2085
|
-
|
2086
|
-
|
2087
2151
|
Naming/VariableName:
|
2088
2152
|
Description: 'Use the configured style when naming variables.'
|
2089
2153
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
@@ -2153,10 +2217,12 @@ Style/AccessModifierDeclarations:
|
|
2153
2217
|
Description: 'Checks style of how access modifiers are used.'
|
2154
2218
|
Enabled: true
|
2155
2219
|
VersionAdded: '0.57'
|
2220
|
+
VersionChanged: '0.81'
|
2156
2221
|
EnforcedStyle: group
|
2157
2222
|
SupportedStyles:
|
2158
2223
|
- inline
|
2159
2224
|
- group
|
2225
|
+
AllowModifiersOnSymbols: true
|
2160
2226
|
|
2161
2227
|
Style/Alias:
|
2162
2228
|
Description: 'Use alias instead of alias_method.'
|
@@ -2335,24 +2401,12 @@ Style/BlockDelimiters:
|
|
2335
2401
|
# # also good
|
2336
2402
|
# collection.each do |element| puts element end
|
2337
2403
|
AllowBracesOnProceduralOneLiners: false
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
EnforcedStyle: no_braces
|
2345
|
-
SupportedStyles:
|
2346
|
-
# The `braces` style enforces braces around all method parameters that are
|
2347
|
-
# hashes.
|
2348
|
-
- braces
|
2349
|
-
# The `no_braces` style checks that the last parameter doesn't have braces
|
2350
|
-
# around it.
|
2351
|
-
- no_braces
|
2352
|
-
# The `context_dependent` style checks that the last parameter doesn't have
|
2353
|
-
# braces around it, but requires braces if the second to last parameter is
|
2354
|
-
# also a hash literal.
|
2355
|
-
- context_dependent
|
2404
|
+
# The BracesRequiredMethods overrides all other configurations except
|
2405
|
+
# IgnoredMethods. It can be used to enforce that all blocks for specific
|
2406
|
+
# methods use braces. For example, you can use this to enforce Sorbet
|
2407
|
+
# signatures use braces even when the rest of your codebase enforces
|
2408
|
+
# the `line_count_based` style.
|
2409
|
+
BracesRequiredMethods: []
|
2356
2410
|
|
2357
2411
|
Style/CaseEquality:
|
2358
2412
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
@@ -2399,7 +2453,7 @@ Style/ClassAndModuleChildren:
|
|
2399
2453
|
|
2400
2454
|
Style/ClassCheck:
|
2401
2455
|
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
2402
|
-
Enabled:
|
2456
|
+
Enabled: false # These methods are not the same, see https://github.com/makandra/makandra-rubocop/issues/22
|
2403
2457
|
VersionAdded: '0.24'
|
2404
2458
|
EnforcedStyle: is_a?
|
2405
2459
|
SupportedStyles:
|
@@ -2422,7 +2476,7 @@ Style/ClassVars:
|
|
2422
2476
|
# Align with the style guide.
|
2423
2477
|
Style/CollectionMethods:
|
2424
2478
|
Description: 'Preferred collection methods.'
|
2425
|
-
StyleGuide: '#map-find-select-reduce-size'
|
2479
|
+
StyleGuide: '#map-find-select-reduce-include-size'
|
2426
2480
|
Enabled: false # We'll maybe enable this later.
|
2427
2481
|
VersionAdded: '0.9'
|
2428
2482
|
VersionChanged: '0.27'
|
@@ -2439,6 +2493,7 @@ Style/CollectionMethods:
|
|
2439
2493
|
inject: 'reduce'
|
2440
2494
|
detect: 'find'
|
2441
2495
|
find_all: 'select'
|
2496
|
+
member?: 'include?'
|
2442
2497
|
|
2443
2498
|
Style/ColonMethodCall:
|
2444
2499
|
Description: 'Do not use :: for method call.'
|
@@ -2664,6 +2719,7 @@ Style/EndBlock:
|
|
2664
2719
|
StyleGuide: '#no-END-blocks'
|
2665
2720
|
Enabled: true
|
2666
2721
|
VersionAdded: '0.9'
|
2722
|
+
VersionChanged: '0.81'
|
2667
2723
|
|
2668
2724
|
Style/EvalWithLocation:
|
2669
2725
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
@@ -2738,7 +2794,7 @@ Style/FrozenStringLiteralComment:
|
|
2738
2794
|
to help transition to frozen string literals by default.
|
2739
2795
|
Enabled: false
|
2740
2796
|
VersionAdded: '0.36'
|
2741
|
-
VersionChanged: '0.
|
2797
|
+
VersionChanged: '0.79'
|
2742
2798
|
EnforcedStyle: always
|
2743
2799
|
SupportedStyles:
|
2744
2800
|
# `always` will always add the frozen string literal comment to a file
|
@@ -2746,9 +2802,14 @@ Style/FrozenStringLiteralComment:
|
|
2746
2802
|
# string literal. If you run code against multiple versions of Ruby, it is
|
2747
2803
|
# possible that this will create errors in Ruby 2.3.0+.
|
2748
2804
|
- always
|
2805
|
+
# `always_true` will add the frozen string literal comment to a file,
|
2806
|
+
# similarly to the `always` style, but will also change any disabled
|
2807
|
+
# comments (e.g. `# frozen_string_literal: false`) to be enabled.
|
2808
|
+
- always_true
|
2749
2809
|
# `never` will enforce that the frozen string literal comment does not
|
2750
2810
|
# exist in a file.
|
2751
2811
|
- never
|
2812
|
+
Safe: false
|
2752
2813
|
|
2753
2814
|
Style/GlobalVars:
|
2754
2815
|
Description: 'Do not introduce global variables.'
|
@@ -2769,6 +2830,13 @@ Style/GuardClause:
|
|
2769
2830
|
# needs to have to trigger this cop
|
2770
2831
|
MinBodyLength: 1
|
2771
2832
|
|
2833
|
+
Style/HashEachMethods:
|
2834
|
+
Description: 'Use Hash#each_key and Hash#each_value.'
|
2835
|
+
StyleGuide: '#hash-each'
|
2836
|
+
Enabled: true
|
2837
|
+
VersionAdded: '0.80'
|
2838
|
+
Safe: false
|
2839
|
+
|
2772
2840
|
Style/HashSyntax:
|
2773
2841
|
Description: >-
|
2774
2842
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
@@ -2792,6 +2860,18 @@ Style/HashSyntax:
|
|
2792
2860
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
2793
2861
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
2794
2862
|
|
2863
|
+
Style/HashTransformKeys:
|
2864
|
+
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
2865
|
+
Enabled: true
|
2866
|
+
VersionAdded: '0.80'
|
2867
|
+
Safe: false
|
2868
|
+
|
2869
|
+
Style/HashTransformValues:
|
2870
|
+
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
2871
|
+
Enabled: true
|
2872
|
+
VersionAdded: '0.80'
|
2873
|
+
Safe: false
|
2874
|
+
|
2795
2875
|
Style/IdenticalConditionalBranches:
|
2796
2876
|
Description: >-
|
2797
2877
|
Checks that conditional statements do not have an identical
|
@@ -2878,8 +2958,9 @@ Style/IpAddresses:
|
|
2878
2958
|
Description: "Don't include literal IP addresses in code."
|
2879
2959
|
Enabled: false
|
2880
2960
|
VersionAdded: '0.58'
|
2881
|
-
|
2882
|
-
|
2961
|
+
VersionChanged: '0.77'
|
2962
|
+
# Allow addresses to be permitted
|
2963
|
+
AllowedAddresses:
|
2883
2964
|
- "::"
|
2884
2965
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
2885
2966
|
|
@@ -2899,7 +2980,7 @@ Style/LambdaCall:
|
|
2899
2980
|
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
2900
2981
|
StyleGuide: '#proc-call'
|
2901
2982
|
Enabled: true
|
2902
|
-
VersionAdded: '0.13
|
2983
|
+
VersionAdded: '0.13'
|
2903
2984
|
VersionChanged: '0.14'
|
2904
2985
|
EnforcedStyle: call
|
2905
2986
|
SupportedStyles:
|
@@ -3029,6 +3110,7 @@ Style/ModuleFunction:
|
|
3029
3110
|
SupportedStyles:
|
3030
3111
|
- module_function
|
3031
3112
|
- extend_self
|
3113
|
+
- forbidden
|
3032
3114
|
Autocorrect: false
|
3033
3115
|
SafeAutoCorrect: false
|
3034
3116
|
|
@@ -3154,8 +3236,8 @@ Style/NestedParenthesizedCalls:
|
|
3154
3236
|
argument list of another parenthesized method call.
|
3155
3237
|
Enabled: true
|
3156
3238
|
VersionAdded: '0.36'
|
3157
|
-
VersionChanged: '0.
|
3158
|
-
|
3239
|
+
VersionChanged: '0.77'
|
3240
|
+
AllowedMethods:
|
3159
3241
|
- be
|
3160
3242
|
- be_a
|
3161
3243
|
- be_an
|
@@ -3532,11 +3614,11 @@ Style/SafeNavigation:
|
|
3532
3614
|
safe navigation (`&.`).
|
3533
3615
|
Enabled: true
|
3534
3616
|
VersionAdded: '0.43'
|
3535
|
-
VersionChanged: '0.
|
3617
|
+
VersionChanged: '0.77'
|
3536
3618
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
3537
3619
|
# to whatever it used to return.
|
3538
3620
|
ConvertCodeThatCanStartToReturnNil: false
|
3539
|
-
|
3621
|
+
AllowedMethods:
|
3540
3622
|
- present?
|
3541
3623
|
- blank?
|
3542
3624
|
- presence
|
@@ -3770,22 +3852,29 @@ Style/TrailingCommaInArrayLiteral:
|
|
3770
3852
|
StyleGuide: '#no-trailing-array-commas'
|
3771
3853
|
Enabled: true
|
3772
3854
|
VersionAdded: '0.53'
|
3855
|
+
# If `comma`, the cop requires a comma after the last item in an array,
|
3773
3856
|
# but only when each item is on its own line.
|
3774
3857
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
3775
|
-
# non-empty array literals.
|
3858
|
+
# non-empty, multiline array literals.
|
3776
3859
|
EnforcedStyleForMultiline: comma
|
3777
3860
|
SupportedStylesForMultiline:
|
3778
3861
|
- comma
|
3779
3862
|
- consistent_comma
|
3780
3863
|
- no_comma
|
3781
3864
|
|
3865
|
+
Style/TrailingCommaInBlockArgs:
|
3866
|
+
Description: 'Checks for useless trailing commas in block arguments.'
|
3867
|
+
Enabled: false # We want to enabled this cop later, currently it is not working properly
|
3868
|
+
Safe: false
|
3869
|
+
VersionAdded: '0.81'
|
3870
|
+
|
3782
3871
|
Style/TrailingCommaInHashLiteral:
|
3783
3872
|
Description: 'Checks for trailing comma in hash literals.'
|
3784
3873
|
Enabled: true
|
3785
3874
|
# If `comma`, the cop requires a comma after the last item in a hash,
|
3786
3875
|
# but only when each item is on its own line.
|
3787
3876
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
3788
|
-
# non-empty hash literals.
|
3877
|
+
# non-empty, multiline hash literals.
|
3789
3878
|
EnforcedStyleForMultiline: comma
|
3790
3879
|
SupportedStylesForMultiline:
|
3791
3880
|
- comma
|
@@ -3814,7 +3903,7 @@ Style/TrivialAccessors:
|
|
3814
3903
|
StyleGuide: '#attr_family'
|
3815
3904
|
Enabled: false
|
3816
3905
|
VersionAdded: '0.9'
|
3817
|
-
VersionChanged: '0.
|
3906
|
+
VersionChanged: '0.77'
|
3818
3907
|
# When set to `false` the cop will suggest the use of accessor methods
|
3819
3908
|
# in situations like:
|
3820
3909
|
#
|
@@ -3835,7 +3924,7 @@ Style/TrivialAccessors:
|
|
3835
3924
|
# Commonly used in DSLs
|
3836
3925
|
AllowDSLWriters: false
|
3837
3926
|
IgnoreClassMethods: false
|
3838
|
-
|
3927
|
+
AllowedMethods:
|
3839
3928
|
- to_ary
|
3840
3929
|
- to_a
|
3841
3930
|
- to_c
|