makandra-rubocop 6.2.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 971fab26cb30baaf1d55688257511cefde34e0dc57c10e02ec85615847e41503
4
- data.tar.gz: 149c349a25dc128a613ef58fc99704d2c3c55a2ff3edd4208328edb227344b47
3
+ metadata.gz: 39a992a355565828a8739ee1de3e5cc63d08853af6ab58284f672c635b0150fe
4
+ data.tar.gz: 5875e86931fa518e02c63f32d249dfa99f41a10206768faaa9a7fad0b35dda92
5
5
  SHA512:
6
- metadata.gz: b3f28b134d26a8e8aef1faabb8d7e4c664a24fa2545cd6ee1afe4c46307537a1f3306542abd9da4357016fc6d2dd8b172e6eb4dc81534641490e4230ccfd343b
7
- data.tar.gz: 222230ed722ba70d485e2d52379e953e302b6f00178868499a8022bb81e09571b7fa91593f37b92ef2c7823e452da358fc486e0e7b91ad9d474734dedb237537
6
+ metadata.gz: 7aa5f818869cd36b3af73b052c1d264b18a94a3d0ec08e6ebdfafa1f42ff04b305daf855ee93f159e445fc4ed7082c65d1cde73c816b39a36d1a5d5a360f00a9
7
+ data.tar.gz: 377113ce7ae04535ca701771b3de4e22ab0ccc9b3405509495a98b029d0cceda072ac9ef2453a4729e99fc663a1809ba5e7492673f5e8e88c3c9a7181fb7d167
data/CHANGELOG.md CHANGED
@@ -8,6 +8,17 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
8
8
 
9
9
  ### Compatible changes
10
10
 
11
+ ## 7.0.0 - 2021-09-16
12
+
13
+ ### Breaking changes
14
+
15
+ - Dropped support for Ruby < `2.5.0`.
16
+ - Upgrade `rubocop` from version `1.9.1` to `1.18.4`.
17
+ - Upgrade `rubocop-rails` from version `2.9.1` to `2.11.3`.
18
+ - Upgrade `rubocop-rspec` from version `2.2.0` to `2.4.0`.
19
+
20
+
21
+
11
22
  ## 6.2.0 - 2021-06-20
12
23
 
13
24
  ### Compatible changes
data/Gemfile.lock CHANGED
@@ -1,55 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- makandra-rubocop (6.2.0)
5
- rubocop (~> 1.9.1)
6
- rubocop-rails (~> 2.9.1)
7
- rubocop-rspec (~> 2.2.0)
4
+ makandra-rubocop (7.0.0)
5
+ rubocop (~> 1.18.4)
6
+ rubocop-rails (~> 2.11.3)
7
+ rubocop-rspec (~> 2.4.0)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.1.3)
12
+ activesupport (6.1.4.1)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 1.6, < 2)
15
15
  minitest (>= 5.1)
16
16
  tzinfo (~> 2.0)
17
17
  zeitwerk (~> 2.3)
18
18
  ast (2.4.2)
19
- concurrent-ruby (1.1.8)
20
- i18n (1.8.9)
19
+ concurrent-ruby (1.1.9)
20
+ i18n (1.8.10)
21
21
  concurrent-ruby (~> 1.0)
22
22
  minitest (5.14.4)
23
- parallel (1.20.1)
24
- parser (3.0.0.0)
23
+ parallel (1.21.0)
24
+ parser (3.0.2.0)
25
25
  ast (~> 2.4.1)
26
26
  rack (2.2.3)
27
27
  rainbow (3.0.0)
28
28
  rake (12.3.2)
29
29
  regexp_parser (2.1.1)
30
- rexml (3.2.4)
31
- rubocop (1.9.1)
30
+ rexml (3.2.5)
31
+ rubocop (1.18.4)
32
32
  parallel (~> 1.10)
33
33
  parser (>= 3.0.0.0)
34
34
  rainbow (>= 2.2.2, < 4.0)
35
35
  regexp_parser (>= 1.8, < 3.0)
36
36
  rexml
37
- rubocop-ast (>= 1.2.0, < 2.0)
37
+ rubocop-ast (>= 1.8.0, < 2.0)
38
38
  ruby-progressbar (~> 1.7)
39
39
  unicode-display_width (>= 1.4.0, < 3.0)
40
- rubocop-ast (1.4.1)
41
- parser (>= 2.7.1.5)
42
- rubocop-rails (2.9.1)
40
+ rubocop-ast (1.11.0)
41
+ parser (>= 3.0.1.1)
42
+ rubocop-rails (2.11.3)
43
43
  activesupport (>= 4.2.0)
44
44
  rack (>= 1.1)
45
- rubocop (>= 0.90.0, < 2.0)
46
- rubocop-rspec (2.2.0)
45
+ rubocop (>= 1.7.0, < 2.0)
46
+ rubocop-rspec (2.4.0)
47
47
  rubocop (~> 1.0)
48
48
  rubocop-ast (>= 1.1.0)
49
49
  ruby-progressbar (1.11.0)
50
50
  tzinfo (2.0.4)
51
51
  concurrent-ruby (~> 1.0)
52
- unicode-display_width (2.0.0)
52
+ unicode-display_width (2.1.0)
53
53
  zeitwerk (2.4.2)
54
54
 
55
55
  PLATFORMS
@@ -61,4 +61,4 @@ DEPENDENCIES
61
61
  rake (~> 12.3)
62
62
 
63
63
  BUNDLED WITH
64
- 2.1.2
64
+ 2.2.25
data/config/default.yml CHANGED
@@ -142,7 +142,7 @@ AllCops:
142
142
  # or gems.locked file. (Although the Ruby version is specified in the Gemfile
143
143
  # or gems.rb file, RuboCop reads the final value from the lock file.) If the
144
144
  # Ruby version is still unresolved, RuboCop will use the oldest officially
145
- # supported Ruby version (currently Ruby 2.4).
145
+ # supported Ruby version (currently Ruby 2.5).
146
146
  TargetRubyVersion: ~
147
147
  # Determines if a notification for extension libraries should be shown when
148
148
  # rubocop is run. Keys are the name of the extension, and values are an array
@@ -178,6 +178,20 @@ Bundler/GemComment:
178
178
  IgnoredGems: []
179
179
  OnlyFor: []
180
180
 
181
+ Bundler/GemVersion:
182
+ Description: 'Requires or forbids specifying gem versions.'
183
+ Enabled: false
184
+ VersionAdded: '1.14'
185
+ EnforcedStyle: 'required'
186
+ SupportedStyles:
187
+ - 'required'
188
+ - 'forbidden'
189
+ Include:
190
+ - '**/*.gemfile'
191
+ - '**/Gemfile'
192
+ - '**/gems.rb'
193
+ AllowedGems: []
194
+
181
195
  Bundler/InsecureProtocolSource:
182
196
  Description: >-
183
197
  The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
@@ -207,6 +221,13 @@ Bundler/OrderedGems:
207
221
 
208
222
  #################### Gemspec ###############################
209
223
 
224
+ Gemspec/DateAssignment:
225
+ Description: 'Checks that `date =` is not used in gemspec file, it is set automatically when the gem is packaged.'
226
+ Enabled: true
227
+ VersionAdded: '1.10'
228
+ Include:
229
+ - '**/*.gemspec'
230
+
210
231
  Gemspec/DuplicatedAssignment:
211
232
  Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
212
233
  Enabled: true
@@ -360,10 +381,11 @@ Layout/BlockEndNewline:
360
381
  VersionAdded: '0.49'
361
382
 
362
383
  Layout/CaseIndentation:
363
- Description: 'Indentation of when in a case/when/[else/]end.'
384
+ Description: 'Indentation of when in a case/(when|in)/[else/]end.'
364
385
  StyleGuide: '#indent-when-to-case'
365
386
  Enabled: true
366
387
  VersionAdded: '0.49'
388
+ VersionChanged: '1.16'
367
389
  EnforcedStyle: end
368
390
  SupportedStyles:
369
391
  - case
@@ -754,7 +776,7 @@ Layout/HashAlignment:
754
776
  Enabled: false
755
777
  AllowMultipleStyles: true
756
778
  VersionAdded: '0.49'
757
- VersionChanged: '0.77'
779
+ VersionChanged: '1.16'
758
780
  # Alignment of entries using hash rocket as separator. Valid values are:
759
781
  #
760
782
  # key - left alignment of keys
@@ -865,8 +887,8 @@ Layout/IndentationStyle:
865
887
  Enabled: true
866
888
  VersionAdded: '0.49'
867
889
  VersionChanged: '0.82'
868
- # By default, the indentation width from Layout/IndentationWidth is used
869
- # But it can be overridden by setting this parameter
890
+ # By default the indentation width from `Layout/IndentationWidth` is used,
891
+ # but it can be overridden by setting this parameter.
870
892
  # It is used during auto-correction to determine how many spaces should
871
893
  # replace each tab.
872
894
  IndentationWidth: ~
@@ -905,6 +927,20 @@ Layout/LeadingEmptyLines:
905
927
  VersionAdded: '0.57'
906
928
  VersionChanged: '0.77'
907
929
 
930
+ Layout/LineEndStringConcatenationIndentation:
931
+ Description: >-
932
+ Checks the indentation of the next line after a line that
933
+ ends with a string literal and a backslash.
934
+ Enabled: false
935
+ VersionAdded: '1.18'
936
+ EnforcedStyle: aligned
937
+ SupportedStyles:
938
+ - aligned
939
+ - indented
940
+ # By default the indentation width from `Layout/IndentationWidth` is used,
941
+ # but it can be overridden by setting this parameter.
942
+ IndentationWidth: ~
943
+
908
944
  Layout/LineLength:
909
945
  Description: 'Checks that line length does not exceed the configured limit.'
910
946
  StyleGuide: '#max-line-length'
@@ -1035,8 +1071,8 @@ Layout/MultilineMethodCallIndentation:
1035
1071
  - aligned
1036
1072
  - indented
1037
1073
  - indented_relative_to_receiver
1038
- # By default, the indentation width from Layout/IndentationWidth is used
1039
- # But it can be overridden by setting this parameter
1074
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1075
+ # but it can be overridden by setting this parameter.
1040
1076
  IndentationWidth: ~
1041
1077
 
1042
1078
  Layout/MultilineMethodDefinitionBraceLayout:
@@ -1065,8 +1101,8 @@ Layout/MultilineOperationIndentation:
1065
1101
  SupportedStyles:
1066
1102
  - aligned
1067
1103
  - indented
1068
- # By default, the indentation width from `Layout/IndentationWidth` is used
1069
- # But it can be overridden by setting this parameter
1104
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1105
+ # but it can be overridden by setting this parameter.
1070
1106
  IndentationWidth: ~
1071
1107
 
1072
1108
  Layout/ParameterAlignment:
@@ -1094,15 +1130,28 @@ Layout/ParameterAlignment:
1094
1130
  SupportedStyles:
1095
1131
  - with_first_parameter
1096
1132
  - with_fixed_indentation
1097
- # By default, the indentation width from Layout/IndentationWidth is used
1098
- # But it can be overridden by setting this parameter
1133
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1134
+ # but it can be overridden by setting this parameter.
1099
1135
  IndentationWidth: ~
1100
1136
 
1137
+ Layout/RedundantLineBreak:
1138
+ Description: >-
1139
+ Do not break up an expression into multiple lines when it fits
1140
+ on a single line.
1141
+ Enabled: false
1142
+ InspectBlocks: false
1143
+ VersionAdded: '1.13'
1144
+
1101
1145
  Layout/RescueEnsureAlignment:
1102
1146
  Description: 'Align rescues and ensures correctly.'
1103
1147
  Enabled: true
1104
1148
  VersionAdded: '0.49'
1105
1149
 
1150
+ Layout/SingleLineBlockChain:
1151
+ Description: 'Put method call on a separate line if chained to a single line block.'
1152
+ Enabled: false
1153
+ VersionAdded: '1.14'
1154
+
1106
1155
  Layout/SpaceAfterColon:
1107
1156
  Description: 'Use spaces after colons.'
1108
1157
  StyleGuide: '#spaces-operators'
@@ -1377,6 +1426,8 @@ Lint/AmbiguousBlockAssociation:
1377
1426
  StyleGuide: '#syntax'
1378
1427
  Enabled: false
1379
1428
  VersionAdded: '0.48'
1429
+ VersionChanged: '1.13'
1430
+ IgnoredMethods: []
1380
1431
 
1381
1432
  Lint/AmbiguousOperator:
1382
1433
  Description: >-
@@ -1453,23 +1504,30 @@ Lint/Debugger:
1453
1504
  Description: 'Check for debugger calls.'
1454
1505
  Enabled: false
1455
1506
  VersionAdded: '0.14'
1456
- VersionChanged: '0.49'
1457
- DebuggerReceivers:
1458
- - binding
1459
- - Kernel
1460
- - Pry
1507
+ VersionChanged: '1.10'
1461
1508
  DebuggerMethods:
1462
- - debugger
1463
- - byebug
1464
- - remote_byebug
1465
- - pry
1466
- - remote_pry
1467
- - pry_remote
1468
- - console
1469
- - rescue
1470
- - save_and_open_page
1471
- - save_and_open_screenshot
1472
- - irb
1509
+ # Groups are available so that a specific group can be disabled in
1510
+ # a user's configuration, but are otherwise not significant.
1511
+ Kernel:
1512
+ - binding.irb
1513
+ Byebug:
1514
+ - byebug
1515
+ - remote_byebug
1516
+ - Kernel.byebug
1517
+ - Kernel.remote_byebug
1518
+ Capybara:
1519
+ - save_and_open_page
1520
+ - save_and_open_screenshot
1521
+ Pry:
1522
+ - binding.pry
1523
+ - binding.remote_pry
1524
+ - binding.pry_remote
1525
+ - Pry.rescue
1526
+ Rails:
1527
+ - debugger
1528
+ - Kernel.debugger
1529
+ WebConsole:
1530
+ - binding.console
1473
1531
 
1474
1532
  Lint/DeprecatedClassMethods:
1475
1533
  Description: 'Check for deprecated class method calls.'
@@ -1608,6 +1666,12 @@ Lint/EmptyFile:
1608
1666
  AllowComments: true
1609
1667
  VersionAdded: '0.90'
1610
1668
 
1669
+ Lint/EmptyInPattern:
1670
+ Description: 'Checks for the presence of `in` pattern branches without a body.'
1671
+ Enabled: true
1672
+ AllowComments: true
1673
+ VersionAdded: '1.16'
1674
+
1611
1675
  Lint/EmptyInterpolation:
1612
1676
  Description: 'Checks for empty string interpolation.'
1613
1677
  Enabled: true
@@ -2047,13 +2111,19 @@ Lint/SuppressedException:
2047
2111
  StyleGuide: '#dont-hide-exceptions'
2048
2112
  Enabled: true
2049
2113
  AllowComments: true
2114
+ AllowNil: true
2050
2115
  VersionAdded: '0.9'
2051
- VersionChanged: '0.81'
2116
+ VersionChanged: '1.12'
2052
2117
 
2053
2118
  Lint/SymbolConversion:
2054
2119
  Description: 'Checks for unnecessary symbol conversions.'
2055
2120
  Enabled: true
2056
2121
  VersionAdded: '1.9'
2122
+ VersionChanged: '1.16'
2123
+ EnforcedStyle: strict
2124
+ SupportedStyles:
2125
+ - strict
2126
+ - consistent
2057
2127
 
2058
2128
  Lint/Syntax:
2059
2129
  Description: 'Checks for syntax errors.'
@@ -2468,6 +2538,31 @@ Naming/HeredocDelimiterNaming:
2468
2538
  ForbiddenDelimiters:
2469
2539
  - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
2470
2540
 
2541
+ Naming/InclusiveLanguage:
2542
+ Description: 'Recommend the use of inclusive language instead of problematic terms.'
2543
+ Enabled: true
2544
+ VersionAdded: '1.18'
2545
+ CheckIdentifiers: true
2546
+ CheckConstants: true
2547
+ CheckVariables: true
2548
+ CheckStrings: false
2549
+ CheckSymbols: true
2550
+ CheckComments: true
2551
+ CheckFilepaths: true
2552
+ FlaggedTerms:
2553
+ whitelist:
2554
+ Regex: !ruby/regexp '/white[-_\s]?list/'
2555
+ Suggestions:
2556
+ - allowlist
2557
+ - permit
2558
+ blacklist:
2559
+ Regex: !ruby/regexp '/black[-_\s]?list/'
2560
+ Suggestions:
2561
+ - denylist
2562
+ - block
2563
+ slave:
2564
+ Suggestions: ['replica', 'secondary', 'follower']
2565
+
2471
2566
  Naming/MemoizedInstanceVariableName:
2472
2567
  Description: >-
2473
2568
  Memoized method name should match memo instance variable name.
@@ -2479,6 +2574,7 @@ Naming/MemoizedInstanceVariableName:
2479
2574
  - disallowed
2480
2575
  - required
2481
2576
  - optional
2577
+ Safe: false
2482
2578
 
2483
2579
  Naming/MethodName:
2484
2580
  Description: 'Use the configured style when naming methods.'
@@ -3064,6 +3160,7 @@ Style/CommentAnnotation:
3064
3160
  - HACK
3065
3161
  - REVIEW
3066
3162
  - NOTE
3163
+ RequireColon: true
3067
3164
 
3068
3165
  Style/CommentedKeyword:
3069
3166
  Description: 'Do not place comments on the same line as certain keywords.'
@@ -3098,6 +3195,8 @@ Style/ConstantVisibility:
3098
3195
  visibility declarations.
3099
3196
  Enabled: false
3100
3197
  VersionAdded: '0.66'
3198
+ VersionChanged: '1.10'
3199
+ IgnoreModules: false
3101
3200
 
3102
3201
  # Checks that you have put a copyright in a comment before any code.
3103
3202
  #
@@ -3168,6 +3267,7 @@ Style/Documentation:
3168
3267
  Description: 'Document classes and non-namespace modules.'
3169
3268
  Enabled: false
3170
3269
  VersionAdded: '0.9'
3270
+ AllowedConstants: []
3171
3271
  Exclude:
3172
3272
  - 'spec/**/*'
3173
3273
  - 'test/**/*'
@@ -3436,12 +3536,22 @@ Style/HashAsLastArrayItem:
3436
3536
  - braces
3437
3537
  - no_braces
3438
3538
 
3539
+ Style/HashConversion:
3540
+ Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
3541
+ StyleGuide: '#avoid-hash-constructor'
3542
+ Enabled: true
3543
+ VersionAdded: '1.10'
3544
+ VersionChanged: '1.11'
3545
+ AllowSplatArgument: true
3546
+
3439
3547
  Style/HashEachMethods:
3440
3548
  Description: 'Use Hash#each_key and Hash#each_value.'
3441
3549
  StyleGuide: '#hash-each'
3442
3550
  Enabled: true
3443
- VersionAdded: '0.80'
3444
3551
  Safe: false
3552
+ VersionAdded: '0.80'
3553
+ VersionChanged: '1.16'
3554
+ AllowedReceivers: []
3445
3555
 
3446
3556
  Style/HashExcept:
3447
3557
  Description: >-
@@ -3504,6 +3614,7 @@ Style/IdenticalConditionalBranches:
3504
3614
  out of the conditional.
3505
3615
  Enabled: true
3506
3616
  VersionAdded: '0.36'
3617
+ VersionChanged: '1.16'
3507
3618
 
3508
3619
  Style/IfInsideElse:
3509
3620
  Description: 'Finds if nodes inside else, which can be converted to elsif.'
@@ -3550,6 +3661,12 @@ Style/ImplicitRuntimeError:
3550
3661
  Enabled: false
3551
3662
  VersionAdded: '0.41'
3552
3663
 
3664
+ Style/InPatternThen:
3665
+ Description: 'Checks for `in;` uses in `case` expressions.'
3666
+ StyleGuide: '#no-in-pattern-semicolons'
3667
+ Enabled: true
3668
+ VersionAdded: '1.16'
3669
+
3553
3670
  Style/InfiniteLoop:
3554
3671
  Description: >-
3555
3672
  Use Kernel#loop for infinite loops.
@@ -3659,6 +3776,7 @@ Style/MethodCallWithArgsParentheses:
3659
3776
  AllowParenthesesInMultilineCall: false
3660
3777
  AllowParenthesesInChaining: false
3661
3778
  AllowParenthesesInCamelCaseMethod: false
3779
+ AllowParenthesesInStringInterpolation: false
3662
3780
  EnforcedStyle: require_parentheses
3663
3781
  SupportedStyles:
3664
3782
  - require_parentheses
@@ -3779,6 +3897,12 @@ Style/MultilineIfThen:
3779
3897
  VersionAdded: '0.9'
3780
3898
  VersionChanged: '0.26'
3781
3899
 
3900
+ Style/MultilineInPatternThen:
3901
+ Description: 'Do not use `then` for multi-line `in` statement.'
3902
+ StyleGuide: '#no-then'
3903
+ Enabled: true
3904
+ VersionAdded: '1.16'
3905
+
3782
3906
  Style/MultilineMemoization:
3783
3907
  Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
3784
3908
  Enabled: true
@@ -3950,6 +4074,7 @@ Style/NilLambda:
3950
4074
  Description: 'Prefer `-> {}` to `-> { nil }`.'
3951
4075
  Enabled: true
3952
4076
  VersionAdded: '1.3'
4077
+ VersionChanged: '1.15'
3953
4078
 
3954
4079
  Style/NonNilCheck:
3955
4080
  Description: 'Checks for redundant nil checks.'
@@ -4136,6 +4261,16 @@ Style/Proc:
4136
4261
  VersionAdded: '0.9'
4137
4262
  VersionChanged: '0.18'
4138
4263
 
4264
+ Style/QuotedSymbols:
4265
+ Description: 'Use a consistent style for quoted symbols.'
4266
+ Enabled: true
4267
+ VersionAdded: '1.16'
4268
+ EnforcedStyle: same_as_string_literals
4269
+ SupportedStyles:
4270
+ - same_as_string_literals
4271
+ - single_quotes
4272
+ - double_quotes
4273
+
4139
4274
  Style/RaiseArgs:
4140
4275
  Description: 'Checks the arguments passed to raise/fail.'
4141
4276
  StyleGuide: '#exception-class-messages'
@@ -4480,13 +4615,21 @@ Style/StderrPuts:
4480
4615
  Enabled: true
4481
4616
  VersionAdded: '0.51'
4482
4617
 
4618
+ Style/StringChars:
4619
+ Description: 'Checks for uses of `String#split` with empty string or regexp literal argument.'
4620
+ StyleGuide: '#string-chars'
4621
+ Enabled: true
4622
+ Safe: false
4623
+ VersionAdded: '1.12'
4624
+
4483
4625
  Style/StringConcatenation:
4484
4626
  Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
4485
4627
  StyleGuide: '#string-interpolation'
4486
4628
  Enabled: true
4487
4629
  Safe: false
4488
4630
  VersionAdded: '0.89'
4489
- VersionChanged: '1.6'
4631
+ VersionChanged: '1.18'
4632
+ Mode: aggressive
4490
4633
 
4491
4634
  Style/StringHashKeys:
4492
4635
  Description: 'Prefer symbols instead of strings as hash keys.'
@@ -4577,6 +4720,7 @@ Style/SymbolProc:
4577
4720
  Safe: false
4578
4721
  VersionAdded: '0.26'
4579
4722
  VersionChanged: '1.5'
4723
+ AllowMethodsWithArguments: false
4580
4724
  # A list of method names to be ignored by the check.
4581
4725
  # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
4582
4726
  IgnoredMethods:
@@ -4595,6 +4739,12 @@ Style/TernaryParentheses:
4595
4739
  - require_parentheses_when_complex
4596
4740
  AllowSafeAssignment: true
4597
4741
 
4742
+ Style/TopLevelMethodDefinition:
4743
+ Description: 'This cop looks for top-level method definitions.'
4744
+ StyleGuide: '#top-level-methods'
4745
+ Enabled: false
4746
+ VersionAdded: '1.15'
4747
+
4598
4748
  Style/TrailingBodyOnClass:
4599
4749
  Description: 'Class body goes below class statement.'
4600
4750
  Enabled: true
@@ -4681,7 +4831,7 @@ Style/TrivialAccessors:
4681
4831
  StyleGuide: '#attr_family'
4682
4832
  Enabled: false
4683
4833
  VersionAdded: '0.9'
4684
- VersionChanged: '0.77'
4834
+ VersionChanged: '1.15'
4685
4835
  # When set to `false` the cop will suggest the use of accessor methods
4686
4836
  # in situations like:
4687
4837
  #
@@ -4729,6 +4879,16 @@ Style/UnlessElse:
4729
4879
  Enabled: true
4730
4880
  VersionAdded: '0.9'
4731
4881
 
4882
+ Style/UnlessLogicalOperators:
4883
+ Description: >-
4884
+ Checks for use of logical operators in an unless condition.
4885
+ Enabled: false
4886
+ VersionAdded: '1.11'
4887
+ EnforcedStyle: forbid_mixed_logical_operators
4888
+ SupportedStyles:
4889
+ - forbid_mixed_logical_operators
4890
+ - forbid_logical_operators
4891
+
4732
4892
  Style/UnpackFirst:
4733
4893
  Description: >-
4734
4894
  Checks for accessing the first element of `String#unpack`
data/config/ext/rails.yml CHANGED
@@ -23,6 +23,27 @@ AllCops:
23
23
  # as the default.
24
24
  TargetRailsVersion: ~
25
25
 
26
+ Lint/NumberConversion:
27
+ # Add Rails' duration methods to the ignore list for `Lint/NumberConversion`
28
+ # so that calling `to_i` on one of these does not register an offense.
29
+ # See: https://github.com/rubocop/rubocop/issues/8950
30
+ IgnoredMethods:
31
+ - ago
32
+ - from_now
33
+ - second
34
+ - seconds
35
+ - minute
36
+ - minutes
37
+ - hour
38
+ - hours
39
+ - day
40
+ - days
41
+ - week
42
+ - weeks
43
+ - fortnight
44
+ - fortnights
45
+ - in_milliseconds
46
+
26
47
  Rails/ActionFilter:
27
48
  Description: 'Enforces consistent use of action filter methods.'
28
49
  Enabled: true
@@ -68,6 +89,16 @@ Rails/ActiveSupportAliases:
68
89
  Enabled: false
69
90
  VersionAdded: '0.48'
70
91
 
92
+ Rails/AddColumnIndex:
93
+ Description: >-
94
+ Rails migrations don't make use of a given `index` key, but also
95
+ doesn't given an error when it's used, so it makes it seem like an
96
+ index might be used.
97
+ Enabled: true
98
+ VersionAdded: '2.11'
99
+ Include:
100
+ - db/migrate/*.rb
101
+
71
102
  Rails/AfterCommitOverride:
72
103
  Description: >-
73
104
  This cop enforces that there is only one call to `after_commit`
@@ -134,8 +165,9 @@ Rails/BelongsTo:
134
165
  Rails/Blank:
135
166
  Description: 'Enforces use of `blank?`.'
136
167
  Enabled: true
168
+ SafeAutoCorrect: false
137
169
  VersionAdded: '0.48'
138
- VersionChanged: '0.67'
170
+ VersionChanged: '2.10'
139
171
  # Convert usages of `nil? || empty?` to `blank?`
140
172
  NilOrEmpty: true
141
173
  # Convert usages of `!present?` to `blank?`
@@ -159,7 +191,7 @@ Rails/ContentTag:
159
191
  Reference:
160
192
  - 'https://github.com/rails/rails/issues/25195'
161
193
  - 'https://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#method-i-content_tag'
162
- Enabled: false # The Github page returned an 500 so I was not able to evaluate this cop
194
+ Enabled: false # We currently use content_tag in many applications. If content_tag should become deprecated in the future we'll have to change it anyway, but until then, we'll keep the content_tag syntax
163
195
  VersionAdded: '2.6'
164
196
 
165
197
  Rails/CreateTableWithTimestamps:
@@ -177,7 +209,7 @@ Rails/Date:
177
209
  such as Date.today, Date.current etc.
178
210
  Enabled: false # It's not that simple. Really.
179
211
  VersionAdded: '0.30'
180
- VersionChanged: '0.33'
212
+ VersionChanged: '2.11'
181
213
  # The value `strict` disallows usage of `Date.today`, `Date.current`,
182
214
  # `Date#to_time` etc.
183
215
  # The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc
@@ -187,6 +219,8 @@ Rails/Date:
187
219
  SupportedStyles:
188
220
  - strict
189
221
  - flexible
222
+ AllowToTime: false # datetime.to_time can handle timezones, but this depends on a setting, which one may not be
223
+ # aware of, see https://api.rubyonrails.org/classes/DateTime.html#method-i-to_time,
190
224
 
191
225
  Rails/DefaultScope:
192
226
  Description: 'Avoid use of `default_scope`.'
@@ -214,7 +248,7 @@ Rails/DynamicFindBy:
214
248
  StyleGuide: 'https://rails.rubystyle.guide#find_by'
215
249
  Enabled: false # We occasionally define custom find_by_* methods (e.g. `find_by_anything`) which don't work like ActiveRecord's methods.
216
250
  VersionAdded: '0.44'
217
- VersionChanged: '2.6'
251
+ VersionChanged: '2.10'
218
252
  # The `Whitelist` has been deprecated, Please use `AllowedMethods` instead.
219
253
  Whitelist:
220
254
  - find_by_sql
@@ -223,6 +257,12 @@ Rails/DynamicFindBy:
223
257
  AllowedReceivers:
224
258
  - Gem::Specification
225
259
 
260
+ Rails/EagerEvaluationLogMessage:
261
+ Description: 'Checks that blocks are used for interpolated strings passed to `Rails.logger.debug`.'
262
+ Reference: 'https://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance'
263
+ Enabled: true
264
+ VersionAdded: '2.11'
265
+
226
266
  Rails/EnumHash:
227
267
  Description: 'Prefer hash syntax over array syntax when defining enums.'
228
268
  StyleGuide: 'https://rails.rubystyle.guide#enums'
@@ -243,6 +283,19 @@ Rails/EnvironmentComparison:
243
283
  Enabled: true
244
284
  VersionAdded: '0.52'
245
285
 
286
+ Rails/EnvironmentVariableAccess:
287
+ Description: 'Do not access `ENV` directly after initialization.'
288
+ Enabled: false
289
+ VersionAdded: '2.10'
290
+ VersionChanged: '2.11'
291
+ Include:
292
+ - app/**/*.rb
293
+ - lib/**/*.rb
294
+ Exclude:
295
+ - lib/**/*.rake
296
+ AllowReads: false
297
+ AllowWrites: false
298
+
246
299
  Rails/Exit:
247
300
  Description: >-
248
301
  Favor `fail`, `break`, `return`, etc. over `exit` in
@@ -257,6 +310,11 @@ Rails/Exit:
257
310
  Exclude:
258
311
  - lib/**/*.rake
259
312
 
313
+ Rails/ExpandedDateRange:
314
+ Description: 'Checks for expanded date range.'
315
+ Enabled: false # We think the range syntax is clearer than using #all_year for example
316
+ VersionAdded: '2.11'
317
+
260
318
  Rails/FilePath:
261
319
  Description: 'Use `Rails.root.join` for file path joining.'
262
320
  Enabled: false
@@ -272,6 +330,8 @@ Rails/FindBy:
272
330
  StyleGuide: 'https://rails.rubystyle.guide#find_by'
273
331
  Enabled: false
274
332
  VersionAdded: '0.30'
333
+ VersionChanged: '2.11'
334
+ IgnoreWhereFirst: true
275
335
  Include:
276
336
  - app/models/**/*.rb
277
337
 
@@ -333,11 +393,20 @@ Rails/HttpStatus:
333
393
  Description: 'Enforces use of symbolic or numeric value to define HTTP status.'
334
394
  Enabled: false
335
395
  VersionAdded: '0.54'
396
+ VersionChanged: '2.11'
336
397
  EnforcedStyle: symbolic
337
398
  SupportedStyles:
338
399
  - numeric
339
400
  - symbolic
340
401
 
402
+ Rails/I18nLocaleAssignment:
403
+ Description: 'Prefer the usage of `I18n.with_locale` instead of manually updating `I18n.locale` value.'
404
+ Enabled: false
405
+ VersionAdded: '2.11'
406
+ Include:
407
+ - spec/**/*.rb
408
+ - test/**/*.rb
409
+
341
410
  Rails/IgnoredSkipActionFilterOption:
342
411
  Description: 'Checks that `if` and `only` (or `except`) are not used together as options of `skip_*` action filter.'
343
412
  Reference: 'https://api.rubyonrails.org/classes/AbstractController/Callbacks/ClassMethods.html#method-i-_normalize_callback_options'
@@ -546,7 +615,9 @@ Rails/RedundantReceiverInWithOptions:
546
615
  Rails/ReflectionClassName:
547
616
  Description: 'Use a string for `class_name` option value in the definition of a reflection.'
548
617
  Enabled: true
618
+ Safe: false
549
619
  VersionAdded: '0.64'
620
+ VersionChanged: '2.10'
550
621
 
551
622
  Rails/RefuteMethods:
552
623
  Description: 'Use `assert_not` methods instead of `refute` methods.'
@@ -589,6 +660,12 @@ Rails/RequestReferer:
589
660
  - referer
590
661
  - referrer
591
662
 
663
+ Rails/RequireDependency:
664
+ Description: 'Do not use `require_dependency` when running in Zeitwerk mode. `require_dependency` is for autoloading in classic mode.'
665
+ Reference: 'https://guides.rubyonrails.org/autoloading_and_reloading_constants.html'
666
+ Enabled: false # We should enable this cop later, when all or most of our applications use zeitwerk
667
+ VersionAdded: '2.10'
668
+
592
669
  Rails/ReversibleMigration:
593
670
  Description: 'Checks whether the change method of the migration file is reversible.'
594
671
  StyleGuide: 'https://rails.rubystyle.guide#reversible-migration'
@@ -598,6 +675,13 @@ Rails/ReversibleMigration:
598
675
  Include:
599
676
  - db/migrate/*.rb
600
677
 
678
+ Rails/ReversibleMigrationMethodDefinition:
679
+ Description: 'Checks whether the migration implements either a `change` method or both an `up` and a `down` method.'
680
+ Enabled: false # If the migration starts with a class definition, no change-, up-, or down-method is recognized, although they exist
681
+ VersionAdded: '2.10'
682
+ Include:
683
+ - db/migrate/*.rb
684
+
601
685
  Rails/SafeNavigation:
602
686
  Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`."
603
687
  Enabled: false
@@ -693,13 +777,24 @@ Rails/TimeZone:
693
777
  Enabled: false
694
778
  Safe: false
695
779
  VersionAdded: '0.30'
696
- VersionChanged: '0.68'
780
+ VersionChanged: '2.10'
697
781
  # The value `strict` means that `Time` should be used with `zone`.
698
782
  # The value `flexible` allows usage of `in_time_zone` instead of `zone`.
699
783
  EnforcedStyle: flexible
700
784
  SupportedStyles:
701
785
  - strict
702
786
  - flexible
787
+ Exclude:
788
+ - '**/*.gemspec'
789
+
790
+ Rails/TimeZoneAssignment:
791
+ Description: 'Prefer the usage of `Time.use_zone` instead of manually updating `Time.zone` value.'
792
+ Reference: 'https://thoughtbot.com/blog/its-about-time-zones'
793
+ Enabled: false
794
+ VersionAdded: '2.10'
795
+ Include:
796
+ - spec/**/*.rb
797
+ - test/**/*.rb
703
798
 
704
799
  Rails/UniqBeforePluck:
705
800
  Description: 'Prefer the use of uniq or distinct before pluck.'
@@ -729,6 +824,13 @@ Rails/UnknownEnv:
729
824
  - test
730
825
  - production
731
826
 
827
+ Rails/UnusedIgnoredColumns:
828
+ Description: 'Remove a column that does not exist from `ignored_columns`.'
829
+ Enabled: true
830
+ VersionAdded: '2.11'
831
+ Include:
832
+ - app/models/**/*.rb
833
+
732
834
  Rails/Validation:
733
835
  Description: 'Use validates :attribute, hash of validations.'
734
836
  Enabled: true
@@ -742,6 +844,7 @@ Rails/WhereEquals:
742
844
  StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions'
743
845
  Enabled: true
744
846
  VersionAdded: '2.9'
847
+ VersionChanged: '2.10'
745
848
 
746
849
  Rails/WhereExists:
747
850
  Description: 'Prefer `exists?(...)` over `where(...).exists?`.'
@@ -751,7 +854,7 @@ Rails/WhereExists:
751
854
  - exists
752
855
  - where
753
856
  VersionAdded: '2.7'
754
- VersionChanged: '2.8'
857
+ VersionChanged: '2.10'
755
858
 
756
859
  Rails/WhereNot:
757
860
  Description: 'Use `where.not(...)` instead of manually constructing negated SQL in `where`.'
data/config/ext/rspec.yml CHANGED
@@ -259,7 +259,9 @@ RSpec/ExampleLength:
259
259
  Description: Checks for long examples.
260
260
  Enabled: false # We do not want to have such limitation
261
261
  Max: 5
262
+ CountAsOne: []
262
263
  VersionAdded: '1.5'
264
+ VersionChanged: '2.3'
263
265
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength
264
266
 
265
267
  RSpec/ExampleWithoutDescription:
@@ -355,6 +357,12 @@ RSpec/HooksBeforeExamples:
355
357
  VersionAdded: '1.29'
356
358
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples
357
359
 
360
+ RSpec/IdenticalEqualityAssertion:
361
+ Description: Checks for equality assertions with identical expressions on both sides.
362
+ Enabled: true
363
+ VersionAdded: '2.4'
364
+ StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IdenticalEqualityAssertion
365
+
358
366
  RSpec/ImplicitBlockExpectation:
359
367
  Description: Check that implicit block expectation syntax is not used.
360
368
  Enabled: true
@@ -757,6 +765,12 @@ RSpec/FactoryBot/FactoryClassName:
757
765
  VersionChanged: '2.0'
758
766
  StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName
759
767
 
768
+ RSpec/Rails/AvoidSetupHook:
769
+ Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
770
+ Enabled: true
771
+ VersionAdded: '2.4'
772
+ StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/AvoidSetupHook
773
+
760
774
  RSpec/Rails/HttpStatus:
761
775
  Description: Enforces use of symbolic or numeric value to describe HTTP status.
762
776
  Enabled: false # This should not be enforced
@@ -1,3 +1,3 @@
1
1
  module MakandraRubocop
2
- VERSION = '6.2.0'.freeze
2
+ VERSION = '7.0.0'.freeze
3
3
  end
@@ -5,7 +5,7 @@ require 'makandra_rubocop/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'makandra-rubocop'
7
7
  spec.version = MakandraRubocop::VERSION
8
- spec.required_ruby_version = '>= 2.3.0'
8
+ spec.required_ruby_version = '>= 2.5.0'
9
9
  spec.authors = ['Arne Hartherz', 'Emanuel Denzel']
10
10
  spec.email = ['arne.hartherz@makandra.de', 'emanuel.denzel@makandra.de']
11
11
 
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r(^exe/)) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.add_dependency 'rubocop', '~> 1.9.1'
27
- spec.add_dependency 'rubocop-rails', '~> 2.9.1'
28
- spec.add_dependency 'rubocop-rspec', '~> 2.2.0'
26
+ spec.add_dependency 'rubocop', '~> 1.18.4'
27
+ spec.add_dependency 'rubocop-rails', '~> 2.11.3'
28
+ spec.add_dependency 'rubocop-rspec', '~> 2.4.0'
29
29
 
30
30
  spec.add_development_dependency 'bundler', '~> 2.0'
31
31
  spec.add_development_dependency 'rake', '~> 12.3'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makandra-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Hartherz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-07-20 00:00:00.000000000 Z
12
+ date: 2021-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -17,42 +17,42 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.9.1
20
+ version: 1.18.4
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 1.9.1
27
+ version: 1.18.4
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rubocop-rails
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 2.9.1
34
+ version: 2.11.3
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 2.9.1
41
+ version: 2.11.3
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rubocop-rspec
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 2.2.0
48
+ version: 2.4.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 2.2.0
55
+ version: 2.4.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: bundler
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -119,14 +119,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="
121
121
  - !ruby/object:Gem::Version
122
- version: 2.3.0
122
+ version: 2.5.0
123
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
125
  - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 3.2.19
129
+ rubygems_version: 3.2.25
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: makandra's default Rubocop configuration