makandra-rubocop 14.0.1 → 15.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34d5cae879df8374b50727852721b74b0e7db44bb7299b0c0109a72b8042631f
4
- data.tar.gz: 96a5149d24fc53ebcc5de71c6d88d9e927a3dfcfb5cbea30ed76b50e89a5400c
3
+ metadata.gz: 34535fe8dfc9dd0f66e720528d4aa99a0279f1993e9bda42185993f9f97c317a
4
+ data.tar.gz: 502767f40493112d780a7e594f650c35f2eacbd06b2819f8dea588aabae00634
5
5
  SHA512:
6
- metadata.gz: 632e1018edbe54368e478080681eeaf97ad6ad6f0a287b75cc656f570c85b513d27fd074e88f1f2c2d374069b72a321c7fb4b304b4daa00baf4944a09f28514d
7
- data.tar.gz: 6ea7d58c11f20e7e0513efb737b84ff444c0ac036ab54d978dc2769bfc01e310b09a15a5a140628de1439dd76c5f90b32f78a6980e43a7a9a791c8cd6ef9aec5
6
+ metadata.gz: 820985cbfb4a1c2c9149e72fca95f5ce288c8149df75fd4483a23642e0e7098d08c2aa8d0a28e008be5e4185c9bbcb84cc223ce6c6154a6d79e3bb72378fb6bc
7
+ data.tar.gz: 1cfcb8fbea9581c7d2e9ecbdd63db9e7711e53599f22a53c7730c2fe401734104888faf1f274baafc38e8424654fc724e5c93f9c0bb01d38b4fb080b1d582081
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: Cop discussion
3
+ about: Starting a discussion about a cop
4
+ title: 'Discussion: '
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ Cop: [todo](https://docs.rubocop.org/rubocop/cops_style.html)
11
+
12
+ ---
13
+ 👍 Enable cop
14
+ 👎 Disable cop
data/CHANGELOG.md CHANGED
@@ -5,9 +5,19 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
5
5
  ## Unreleased
6
6
 
7
7
  ### Breaking changes
8
+ -
8
9
 
9
10
  ### Compatible changes
11
+ -
10
12
 
13
+ ## 15.0.0 - 2025-01-20
14
+
15
+ ### Breaking changes
16
+ - Upgrade to `rubocop` 1.70 (was 1.61)
17
+ - Disable new cop `Style/CombinableDefined`
18
+
19
+ ### Compatible changes
20
+ - Add Support for Ruby 3.4
11
21
 
12
22
  ## 14.0.1 - 2024-09-12
13
23
 
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- makandra-rubocop (14.0.1)
5
- rubocop (~> 1.61.0)
4
+ makandra-rubocop (15.0.0)
5
+ rubocop (~> 1.70.0)
6
6
  rubocop-capybara (~> 2.20.0)
7
7
  rubocop-factory_bot (~> 2.25.1)
8
8
  rubocop-rails (~> 2.23.1)
@@ -11,52 +11,53 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (7.1.3)
14
+ activesupport (7.1.5.1)
15
15
  base64
16
+ benchmark (>= 0.3)
16
17
  bigdecimal
17
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
19
  connection_pool (>= 2.2.5)
19
20
  drb
20
21
  i18n (>= 1.6, < 2)
22
+ logger (>= 1.4.2)
21
23
  minitest (>= 5.1)
22
24
  mutex_m
25
+ securerandom (>= 0.3)
23
26
  tzinfo (~> 2.0)
24
27
  ast (2.4.2)
25
28
  base64 (0.2.0)
26
- bigdecimal (3.1.6)
27
- concurrent-ruby (1.2.3)
28
- connection_pool (2.4.1)
29
- drb (2.2.0)
30
- ruby2_keywords
31
- i18n (1.14.1)
29
+ benchmark (0.4.0)
30
+ bigdecimal (3.1.9)
31
+ concurrent-ruby (1.3.4)
32
+ connection_pool (2.5.0)
33
+ drb (2.2.1)
34
+ i18n (1.14.6)
32
35
  concurrent-ruby (~> 1.0)
33
- json (2.7.2)
36
+ json (2.9.1)
34
37
  language_server-protocol (3.17.0.3)
35
- minitest (5.21.2)
36
- mutex_m (0.2.0)
37
- parallel (1.25.1)
38
- parser (3.3.4.0)
38
+ logger (1.6.5)
39
+ minitest (5.25.4)
40
+ mutex_m (0.3.0)
41
+ parallel (1.26.3)
42
+ parser (3.3.6.0)
39
43
  ast (~> 2.4.1)
40
44
  racc
41
- racc (1.8.0)
42
- rack (3.0.9)
45
+ racc (1.8.1)
46
+ rack (3.1.8)
43
47
  rainbow (3.1.1)
44
48
  rake (12.3.2)
45
- regexp_parser (2.9.2)
46
- rexml (3.3.2)
47
- strscan
48
- rubocop (1.61.0)
49
+ regexp_parser (2.10.0)
50
+ rubocop (1.70.0)
49
51
  json (~> 2.3)
50
52
  language_server-protocol (>= 3.17.0)
51
53
  parallel (~> 1.10)
52
54
  parser (>= 3.3.0.2)
53
55
  rainbow (>= 2.2.2, < 4.0)
54
- regexp_parser (>= 1.8, < 3.0)
55
- rexml (>= 3.2.5, < 4.0)
56
- rubocop-ast (>= 1.30.0, < 2.0)
56
+ regexp_parser (>= 2.9.3, < 3.0)
57
+ rubocop-ast (>= 1.36.2, < 2.0)
57
58
  ruby-progressbar (~> 1.7)
58
- unicode-display_width (>= 2.4.0, < 3.0)
59
- rubocop-ast (1.31.3)
59
+ unicode-display_width (>= 2.4.0, < 4.0)
60
+ rubocop-ast (1.37.0)
60
61
  parser (>= 3.3.1.0)
61
62
  rubocop-capybara (2.20.0)
62
63
  rubocop (~> 1.41)
@@ -67,14 +68,15 @@ GEM
67
68
  rack (>= 1.1)
68
69
  rubocop (>= 1.33.0, < 2.0)
69
70
  rubocop-ast (>= 1.30.0, < 2.0)
70
- rubocop-rspec (3.0.3)
71
+ rubocop-rspec (3.0.5)
71
72
  rubocop (~> 1.61)
72
73
  ruby-progressbar (1.13.0)
73
- ruby2_keywords (0.0.5)
74
- strscan (3.1.0)
74
+ securerandom (0.3.2)
75
75
  tzinfo (2.0.6)
76
76
  concurrent-ruby (~> 1.0)
77
- unicode-display_width (2.5.0)
77
+ unicode-display_width (3.1.4)
78
+ unicode-emoji (~> 4.0, >= 4.0.4)
79
+ unicode-emoji (4.0.4)
78
80
 
79
81
  PLATFORMS
80
82
  ruby
data/config/default.yml CHANGED
@@ -86,6 +86,8 @@ AllCops:
86
86
  StyleGuideBaseURL: https://rubystyle.guide
87
87
  # Documentation URLs will be constructed using the base URL.
88
88
  DocumentationBaseURL: https://docs.rubocop.org/rubocop
89
+ # Documentation URLs will end with this extension.
90
+ DocumentationExtension: .html
89
91
  # Extra details are not displayed in offense messages by default. Change
90
92
  # behavior by overriding ExtraDetails, or by giving the
91
93
  # `-E/--extra-details` option.
@@ -148,6 +150,12 @@ AllCops:
148
150
  # Ruby version is still unresolved, RuboCop will use the oldest officially
149
151
  # supported Ruby version (currently Ruby 2.7).
150
152
  TargetRubyVersion: ~
153
+ # You can specify the parser engine. There are two options available:
154
+ # - `parser_whitequark` ... https://github.com/whitequark/parser
155
+ # - `parser_prism` ... https://github.com/ruby/prism (`Prism::Translation::Parser`)
156
+ # By default, `parser` is used. For the `TargetRubyVersion` value, `parser` can be specified for versions `2.0` and above.
157
+ # `parser_prism` can be specified for versions `3.3` and above. `parser_prism` is faster but still considered experimental.
158
+ ParserEngine: parser_whitequark
151
159
  # Determines if a notification for extension libraries should be shown when
152
160
  # rubocop is run. Keys are the name of the extension, and values are an array
153
161
  # of gems in the Gemfile that the extension is suggested for, if not already
@@ -161,8 +169,14 @@ AllCops:
161
169
  rubocop-graphql: [graphql]
162
170
  rubocop-capybara: [capybara]
163
171
  rubocop-factory_bot: [factory_bot, factory_bot_rails]
172
+ rubocop-rspec_rails: [rspec-rails]
164
173
  # Enable/Disable checking the methods extended by Active Support.
165
174
  ActiveSupportExtensionsEnabled: false
175
+ # Future version of Ruby will freeze string literals by default.
176
+ # This allows to opt in early, for example when enabled through RUBYOPT.
177
+ # For now this will behave as if set to false but in future ruby versions
178
+ # (likely 4.0) it will be true by default.
179
+ StringLiteralsFrozenByDefault: ~
166
180
 
167
181
  #################### Bundler ###############################
168
182
 
@@ -259,6 +273,15 @@ Bundler/OrderedGems:
259
273
 
260
274
  #################### Gemspec ###############################
261
275
 
276
+ Gemspec/AddRuntimeDependency:
277
+ Description: 'Prefer `add_dependency` over `add_runtime_dependency`.'
278
+ StyleGuide: '#add_dependency_vs_add_runtime_dependency'
279
+ Reference: https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316
280
+ Enabled: pending
281
+ VersionAdded: '1.65'
282
+ Include:
283
+ - '**/*.gemspec'
284
+
262
285
  Gemspec/DependencyVersion:
263
286
  Description: 'Requires or forbids specifying gem dependency versions.'
264
287
  Enabled: false
@@ -560,7 +583,9 @@ Layout/ElseAlignment:
560
583
  Layout/EmptyComment:
561
584
  Description: 'Checks empty comment.'
562
585
  Enabled: true
586
+ AutoCorrect: contextual
563
587
  VersionAdded: '0.53'
588
+ VersionChanged: '1.61'
564
589
  AllowBorderComment: true
565
590
  AllowMarginComment: true
566
591
 
@@ -840,6 +865,7 @@ Layout/FirstMethodArgumentLineBreak:
840
865
  Enabled: false
841
866
  VersionAdded: '0.49'
842
867
  AllowMultilineFinalElement: false
868
+ AllowedMethods: []
843
869
 
844
870
  Layout/FirstMethodParameterLineBreak:
845
871
  Description: >-
@@ -1015,6 +1041,8 @@ Layout/LeadingCommentSpace:
1015
1041
  VersionChanged: '0.73'
1016
1042
  AllowDoxygenCommentStyle: false
1017
1043
  AllowGemfileRubyComment: false
1044
+ AllowRBSInlineAnnotation: false
1045
+ AllowSteepAnnotation: false
1018
1046
 
1019
1047
  Layout/LeadingEmptyLines:
1020
1048
  Description: Check for unnecessary blank lines at the beginning of a file.
@@ -1062,11 +1090,11 @@ Layout/LineLength:
1062
1090
  StyleGuide: '#max-line-length'
1063
1091
  Enabled: false
1064
1092
  VersionAdded: '0.25'
1065
- VersionChanged: '1.4'
1093
+ VersionChanged: '1.69'
1066
1094
  Max: 120
1095
+ AllowHeredoc: true
1067
1096
  # To make it possible to copy or click on URIs in the code, we allow lines
1068
1097
  # containing a URI to be longer than Max.
1069
- AllowHeredoc: true
1070
1098
  AllowURI: true
1071
1099
  URISchemes:
1072
1100
  - http
@@ -1078,6 +1106,8 @@ Layout/LineLength:
1078
1106
  # elements. Strings will be converted to Regexp objects. A line that matches
1079
1107
  # any regular expression listed in this option will be ignored by LineLength.
1080
1108
  AllowedPatterns: []
1109
+ # If SplitStrings is true, long strings will be split using continuations
1110
+ SplitStrings: false
1081
1111
 
1082
1112
  Layout/MultilineArrayBraceLayout:
1083
1113
  Description: >-
@@ -1475,7 +1505,6 @@ Layout/SpaceInsideHashLiteralBraces:
1475
1505
  - space
1476
1506
  - no_space
1477
1507
 
1478
-
1479
1508
  Layout/SpaceInsideParens:
1480
1509
  Description: 'No spaces after ( or before ).'
1481
1510
  StyleGuide: '#spaces-braces'
@@ -1610,7 +1639,7 @@ Lint/BinaryOperatorWithIdenticalOperands:
1610
1639
  Enabled: true
1611
1640
  Safe: false
1612
1641
  VersionAdded: '0.89'
1613
- VersionChanged: '1.7'
1642
+ VersionChanged: '1.69'
1614
1643
 
1615
1644
  Lint/BooleanSymbol:
1616
1645
  Description: 'Check for `:true` and `:false` symbols.'
@@ -1643,6 +1672,11 @@ Lint/ConstantOverwrittenInRescue:
1643
1672
  Enabled: true
1644
1673
  VersionAdded: '1.31'
1645
1674
 
1675
+ Lint/ConstantReassignment:
1676
+ Description: 'Checks for constant reassignments.'
1677
+ Enabled: true
1678
+ VersionAdded: '1.70'
1679
+
1646
1680
  Lint/ConstantResolution:
1647
1681
  Description: 'Check that constants are fully qualified with `::`.'
1648
1682
  Enabled: false
@@ -1656,7 +1690,7 @@ Lint/Debugger:
1656
1690
  Description: 'Check for debugger calls.'
1657
1691
  Enabled: true # Voted for this in https://github.com/makandra/makandra-rubocop/issues/42
1658
1692
  VersionAdded: '0.14'
1659
- VersionChanged: '1.46'
1693
+ VersionChanged: '1.63'
1660
1694
  DebuggerMethods:
1661
1695
  # Groups are available so that a specific group can be disabled in
1662
1696
  # a user's configuration, but are otherwise not significant.
@@ -1668,8 +1702,14 @@ Lint/Debugger:
1668
1702
  - Kernel.byebug
1669
1703
  - Kernel.remote_byebug
1670
1704
  Capybara:
1705
+ - page.save_and_open_page
1706
+ - page.save_and_open_screenshot
1707
+ - page.save_page
1708
+ - page.save_screenshot
1671
1709
  - save_and_open_page
1672
1710
  - save_and_open_screenshot
1711
+ - save_page
1712
+ - save_screenshot
1673
1713
  debug.rb:
1674
1714
  - binding.b
1675
1715
  - binding.break
@@ -1688,6 +1728,10 @@ Lint/Debugger:
1688
1728
  - jard
1689
1729
  WebConsole:
1690
1730
  - binding.console
1731
+ DebuggerRequires:
1732
+ debug.rb:
1733
+ - debug/open
1734
+ - debug/start
1691
1735
 
1692
1736
  Lint/DeprecatedClassMethods:
1693
1737
  Description: 'Check for deprecated class method calls.'
@@ -1751,6 +1795,7 @@ Lint/DuplicateBranch:
1751
1795
  VersionChanged: '1.7'
1752
1796
  IgnoreLiteralBranches: false
1753
1797
  IgnoreConstantBranches: false
1798
+ IgnoreDuplicateElseBranch: false
1754
1799
 
1755
1800
  Lint/DuplicateCaseCondition:
1756
1801
  Description: 'Do not repeat values in case conditionals.'
@@ -1800,6 +1845,11 @@ Lint/DuplicateRescueException:
1800
1845
  Enabled: true
1801
1846
  VersionAdded: '0.89'
1802
1847
 
1848
+ Lint/DuplicateSetElement:
1849
+ Description: 'Checks for duplicate elements in Set.'
1850
+ Enabled: true
1851
+ VersionAdded: '1.67'
1852
+
1803
1853
  Lint/EachWithObjectArgument:
1804
1854
  Description: 'Check for immutable argument given to each_with_object.'
1805
1855
  Enabled: true
@@ -1912,6 +1962,11 @@ Lint/HashCompareByIdentity:
1912
1962
  Safe: false
1913
1963
  VersionAdded: '0.93'
1914
1964
 
1965
+ Lint/HashNewWithKeywordArgumentsAsDefault:
1966
+ Description: 'Checks for the deprecated use of keyword arguments for hash default in `Hash.new`.'
1967
+ Enabled: true
1968
+ VersionAdded: '1.69'
1969
+
1915
1970
  Lint/HeredocMethodCallPosition:
1916
1971
  Description: >-
1917
1972
  Checks for the ordering of a method call where
@@ -2102,6 +2157,11 @@ Lint/NumberedParameterAssignment:
2102
2157
  Enabled: true # Makes it easier to upgrade to Ruby 3
2103
2158
  VersionAdded: '1.9'
2104
2159
 
2160
+ Lint/NumericOperationWithConstantResult:
2161
+ Description: 'Checks for numeric operations with constant results.'
2162
+ Enabled: true
2163
+ VersionAdded: '1.69'
2164
+
2105
2165
  Lint/OrAssignmentToConstant:
2106
2166
  Description: 'Checks unintended or-assignment to constant.'
2107
2167
  Enabled: true
@@ -2292,9 +2352,9 @@ Lint/SafeNavigationChain:
2292
2352
 
2293
2353
  Lint/SafeNavigationConsistency:
2294
2354
  Description: >-
2295
- Check to make sure that if safe navigation is used for a method
2296
- call in an `&&` or `||` condition that safe navigation is used
2297
- for all method calls on that same object.
2355
+ Check to make sure that if safe navigation is used in an `&&` or `||` condition,
2356
+ consistent and appropriate safe navigation, without excess or deficiency,
2357
+ is used for all method calls on the same object.
2298
2358
  Enabled: true
2299
2359
  VersionAdded: '0.55'
2300
2360
  VersionChanged: '0.77'
@@ -2333,7 +2393,6 @@ Lint/ShadowedArgument:
2333
2393
  VersionAdded: '0.52'
2334
2394
  IgnoreImplicitReferences: false
2335
2395
 
2336
-
2337
2396
  Lint/ShadowedException:
2338
2397
  Description: >-
2339
2398
  Avoid rescuing a higher level exception
@@ -2348,6 +2407,12 @@ Lint/ShadowingOuterLocalVariable:
2348
2407
  Enabled: true
2349
2408
  VersionAdded: '0.9'
2350
2409
 
2410
+ Lint/SharedMutableDefault:
2411
+ Description: 'Checks for mutable literals used as default arguments during Hash initialization.'
2412
+ StyleGuide: '#no-mutable-defaults'
2413
+ Enabled: true
2414
+ VersionAdded: '1.70'
2415
+
2351
2416
  Lint/StructNewOverride:
2352
2417
  Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
2353
2418
  Enabled: true
@@ -2411,6 +2476,11 @@ Lint/UnderscorePrefixedVariableName:
2411
2476
  VersionAdded: '0.21'
2412
2477
  AllowKeywordBlockArguments: false
2413
2478
 
2479
+ Lint/UnescapedBracketInRegexp:
2480
+ Description: 'Checks for unescaped literal `]` in Regexp.'
2481
+ Enabled: true
2482
+ VersionAdded: '1.68'
2483
+
2414
2484
  Lint/UnexpectedBlockArity:
2415
2485
  Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
2416
2486
  Enabled: true
@@ -2468,10 +2538,12 @@ Lint/UnusedMethodArgument:
2468
2538
  StyleGuide: '#underscore-unused-vars'
2469
2539
  Enabled: true
2470
2540
  VersionAdded: '0.21'
2471
- VersionChanged: '0.81'
2541
+ VersionChanged: '1.69'
2472
2542
  AllowUnusedKeywordArguments: false
2473
2543
  IgnoreEmptyMethods: true
2474
2544
  IgnoreNotImplementedMethods: true
2545
+ NotImplementedExceptions:
2546
+ - NotImplementedError
2475
2547
 
2476
2548
  Lint/UriEscapeUnescape:
2477
2549
  Description: >-
@@ -2500,10 +2572,15 @@ Lint/UselessAccessModifier:
2500
2572
  Lint/UselessAssignment:
2501
2573
  Description: 'Checks for useless assignment to a local variable.'
2502
2574
  StyleGuide: '#underscore-unused-vars'
2503
- Enabled: false # There are cases where it is easier to read if the the same body is used for different branches
2575
+ Enabled: false # There are cases where it is easier to read if the same body is used for different branches
2504
2576
  VersionAdded: '0.11'
2505
- VersionChanged: '1.51'
2506
- SafeAutoCorrect: false
2577
+ VersionChanged: '1.66'
2578
+ AutoCorrect: contextual
2579
+
2580
+ Lint/UselessDefined:
2581
+ Description: 'Checks for calls to `defined?` with strings and symbols. The result of such a call will always be truthy.'
2582
+ Enabled: true
2583
+ VersionAdded: '1.69'
2507
2584
 
2508
2585
  Lint/UselessElseWithoutRescue:
2509
2586
  Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
@@ -2518,6 +2595,11 @@ Lint/UselessMethodDefinition:
2518
2595
  VersionChanged: '0.91'
2519
2596
  Safe: false
2520
2597
 
2598
+ Lint/UselessNumericOperation:
2599
+ Description: 'Checks for useless numeric operations.'
2600
+ Enabled: true
2601
+ VersionAdded: '1.66'
2602
+
2521
2603
  Lint/UselessRescue:
2522
2604
  Description: 'Checks for useless `rescue`s.'
2523
2605
  Enabled: pending
@@ -2587,8 +2669,9 @@ Metrics/BlockNesting:
2587
2669
  StyleGuide: '#three-is-the-number-thou-shalt-count'
2588
2670
  Enabled: false
2589
2671
  VersionAdded: '0.25'
2590
- VersionChanged: '0.47'
2672
+ VersionChanged: '1.65'
2591
2673
  CountBlocks: false
2674
+ CountModifierForms: false
2592
2675
  Max: 3
2593
2676
 
2594
2677
  Metrics/ClassLength:
@@ -2743,7 +2826,8 @@ Naming/FileName:
2743
2826
  VersionChanged: '1.23'
2744
2827
  # Camel case file names listed in `AllCops:Include` and all file names listed
2745
2828
  # in `AllCops:Exclude` are excluded by default. Add extra excludes here.
2746
- Exclude: []
2829
+ Exclude:
2830
+ - Rakefile.rb
2747
2831
  # When `true`, requires that each source file should define a class or module
2748
2832
  # with a name which matches the file name (converted to ... case).
2749
2833
  # It further expects it to be nested inside modules which match the names
@@ -3058,12 +3142,14 @@ Style/AccessModifierDeclarations:
3058
3142
  Description: 'Checks style of how access modifiers are used.'
3059
3143
  Enabled: true
3060
3144
  VersionAdded: '0.57'
3061
- VersionChanged: '0.81'
3145
+ VersionChanged: '1.70'
3062
3146
  EnforcedStyle: group
3063
3147
  SupportedStyles:
3064
3148
  - inline
3065
3149
  - group
3066
3150
  AllowModifiersOnSymbols: true
3151
+ AllowModifiersOnAttrs: true
3152
+ AllowModifiersOnAliasMethod: true
3067
3153
  SafeAutoCorrect: false
3068
3154
 
3069
3155
  Style/AccessorGrouping:
@@ -3088,6 +3174,12 @@ Style/Alias:
3088
3174
  - prefer_alias
3089
3175
  - prefer_alias_method
3090
3176
 
3177
+ Style/AmbiguousEndlessMethodDefinition:
3178
+ Description: 'Checks for endless methods inside operators of lower precedence.'
3179
+ StyleGuide: '#ambiguous-endless-method-defintions'
3180
+ Enabled: true
3181
+ VersionAdded: '1.68'
3182
+
3091
3183
  Style/AndOr:
3092
3184
  Description: 'Use &&/|| instead of and/or.'
3093
3185
  StyleGuide: '#no-and-or-or'
@@ -3195,6 +3287,13 @@ Style/BisectedAttrAccessor:
3195
3287
  Enabled: true
3196
3288
  VersionAdded: '0.87'
3197
3289
 
3290
+ Style/BitwisePredicate:
3291
+ Description: 'Prefer bitwise predicate methods over direct comparison operations.'
3292
+ StyleGuide: '#bitwise-predicate-methods'
3293
+ Enabled: true
3294
+ Safe: false
3295
+ VersionAdded: '1.68'
3296
+
3198
3297
  Style/BlockComments:
3199
3298
  Description: 'Do not use block comments.'
3200
3299
  StyleGuide: '#no-block-comments'
@@ -3478,6 +3577,11 @@ Style/ColonMethodDefinition:
3478
3577
  Enabled: true
3479
3578
  VersionAdded: '0.52'
3480
3579
 
3580
+ Style/CombinableDefined:
3581
+ Description: 'Checks successive `defined?` calls that can be combined into a single call.'
3582
+ Enabled: false # See https://github.com/makandra/makandra-rubocop/pull/53#discussion_r1914759268
3583
+ VersionAdded: '1.68'
3584
+
3481
3585
  Style/CombinableLoops:
3482
3586
  Description: >-
3483
3587
  Checks for places where multiple consecutive loops over the same data
@@ -3618,6 +3722,12 @@ Style/DefWithParentheses:
3618
3722
  VersionAdded: '0.9'
3619
3723
  VersionChanged: '0.12'
3620
3724
 
3725
+ Style/DigChain:
3726
+ Description: 'Use `dig` with multiple parameters instead of chaining multiple calls.'
3727
+ Enabled: true
3728
+ Safe: false
3729
+ VersionAdded: '1.69'
3730
+
3621
3731
  Style/Dir:
3622
3732
  Description: >-
3623
3733
  Use the `__dir__` method to retrieve the canonicalized
@@ -3661,6 +3771,7 @@ Style/DocumentationMethod:
3661
3771
  Description: 'Checks for missing documentation comment for public methods.'
3662
3772
  Enabled: false
3663
3773
  VersionAdded: '0.43'
3774
+ AllowedMethods: []
3664
3775
  Exclude:
3665
3776
  - 'spec/**/*'
3666
3777
  - 'test/**/*'
@@ -3837,12 +3948,24 @@ Style/FileEmpty:
3837
3948
  Safe: false
3838
3949
  VersionAdded: '1.48'
3839
3950
 
3951
+ Style/FileNull:
3952
+ Description: 'Use `File::NULL` instead of hardcoding "dev/null".'
3953
+ Enabled: true
3954
+ SafeAutoCorrect: false
3955
+ VersionAdded: '1.69'
3956
+
3840
3957
  Style/FileRead:
3841
3958
  Description: 'Favor `File.(bin)read` convenience methods.'
3842
3959
  StyleGuide: '#file-read'
3843
3960
  Enabled: true
3844
3961
  VersionAdded: '1.24'
3845
3962
 
3963
+ Style/FileTouch:
3964
+ Description: 'Favor `FileUtils.touch` for touching files.'
3965
+ Enabled: true
3966
+ VersionAdded: '1.69'
3967
+ SafeAutoCorrect: false
3968
+
3846
3969
  Style/FileWrite:
3847
3970
  Description: 'Favor `File.(bin)write` convenience methods.'
3848
3971
  StyleGuide: '#file-write'
@@ -4014,7 +4137,7 @@ Style/HashSyntax:
4014
4137
  StyleGuide: '#hash-literals'
4015
4138
  Enabled: true
4016
4139
  VersionAdded: '0.9'
4017
- VersionChanged: '1.24'
4140
+ VersionChanged: '1.67'
4018
4141
  EnforcedStyle: ruby19
4019
4142
  SupportedStyles:
4020
4143
  # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
@@ -4026,7 +4149,7 @@ Style/HashSyntax:
4026
4149
  # enforces both ruby19 and no_mixed_keys styles
4027
4150
  - ruby19_no_mixed_keys
4028
4151
  # Force hashes that have a hash value omission
4029
- EnforcedShorthandSyntax: either # Voted in this issue https://github.com/makandra/makandra-rubocop/issues/36, but open for re-evaluation at a later point in time.
4152
+ EnforcedShorthandSyntax: either # Voted in this issue https://github.com/makandra/makandra-rubocop/issues/36, but open for re-evaluation at a later point in time. Now also the rubocop default.
4030
4153
  SupportedShorthandSyntax:
4031
4154
  # forces use of the 3.1 syntax (e.g. {foo:}) when the hash key and value are the same.
4032
4155
  - always
@@ -4036,6 +4159,8 @@ Style/HashSyntax:
4036
4159
  - either
4037
4160
  # forces use of the 3.1 syntax only if all values can be omitted in the hash.
4038
4161
  - consistent
4162
+ # allow either (implicit or explicit) syntax but enforce consistency within a single hash
4163
+ - either_consistent
4039
4164
  # Force hashes that have a symbol value to use hash rockets
4040
4165
  UseHashRocketsWithSymbolValues: false
4041
4166
  # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
@@ -4196,6 +4321,19 @@ Style/IpAddresses:
4196
4321
  - '**/gems.rb'
4197
4322
  - '**/*.gemspec'
4198
4323
 
4324
+ Style/ItAssignment:
4325
+ Description: 'Checks for assignment to `it` inside a block.'
4326
+ Enabled: true
4327
+ VersionAdded: '1.70'
4328
+
4329
+ Style/KeywordArgumentsMerging:
4330
+ Description: >-
4331
+ When passing an existing hash as keyword arguments, provide additional arguments
4332
+ directly rather than using `merge`.
4333
+ StyleGuide: '#merging-keyword-arguments'
4334
+ Enabled: true
4335
+ VersionAdded: '1.68'
4336
+
4199
4337
  Style/KeywordParametersOrder:
4200
4338
  Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
4201
4339
  StyleGuide: '#keyword-parameters-order'
@@ -4260,6 +4398,14 @@ Style/MapCompactWithConditionalBlock:
4260
4398
  Enabled: true
4261
4399
  VersionAdded: '1.30'
4262
4400
 
4401
+ Style/MapIntoArray:
4402
+ Description: 'Checks for usages of `each` with `<<`, `push`, or `append` which can be replaced by `map`.'
4403
+ StyleGuide: '#functional-code'
4404
+ Enabled: true
4405
+ VersionAdded: '1.63'
4406
+ VersionChanged: '1.67'
4407
+ Safe: false
4408
+
4263
4409
  Style/MapToHash:
4264
4410
  Description: 'Prefer `to_h` with a block over `map.to_h`.'
4265
4411
  Enabled: false # Requires at least Ruby 2.6, but we officially still support Ruby 2.5 (https://makandracards.com/makandra/493762-technologie-radar-entwicklung#section-deprecated).
@@ -4924,7 +5070,7 @@ Style/RedundantConstantBase:
4924
5070
  VersionAdded: '1.40'
4925
5071
 
4926
5072
  Style/RedundantCurrentDirectoryInPath:
4927
- Description: 'Checks for uses a redundant current directory in path.'
5073
+ Description: 'Checks for a redundant current directory in a path given to `require_relative`.'
4928
5074
  Enabled: pending
4929
5075
  VersionAdded: '1.53'
4930
5076
 
@@ -5002,6 +5148,11 @@ Style/RedundantInterpolation:
5002
5148
  VersionAdded: '0.76'
5003
5149
  VersionChanged: '1.30'
5004
5150
 
5151
+ Style/RedundantInterpolationUnfreeze:
5152
+ Description: 'Checks for redundant unfreezing of interpolated strings.'
5153
+ Enabled: true
5154
+ VersionAdded: '1.66'
5155
+
5005
5156
  Style/RedundantLineContinuation:
5006
5157
  Description: 'Check for redundant line continuation.'
5007
5158
  Enabled: pending
@@ -5143,6 +5294,7 @@ Style/ReturnNilInPredicateMethodDefinition:
5143
5294
  AllowedMethods: []
5144
5295
  AllowedPatterns: []
5145
5296
  VersionAdded: '1.53'
5297
+ VersionChanged: '1.67'
5146
5298
 
5147
5299
  Style/SafeNavigation:
5148
5300
  Description: >-
@@ -5153,7 +5305,7 @@ Style/SafeNavigation:
5153
5305
  be `nil` or truthy, but never `false`.
5154
5306
  Enabled: true
5155
5307
  VersionAdded: '0.43'
5156
- VersionChanged: '1.27'
5308
+ VersionChanged: '1.67'
5157
5309
  # Safe navigation may cause a statement to start returning `nil` in addition
5158
5310
  # to whatever it used to return.
5159
5311
  ConvertCodeThatCanStartToReturnNil: false
@@ -5167,6 +5319,13 @@ Style/SafeNavigation:
5167
5319
  # Maximum length of method chains for register an offense.
5168
5320
  MaxChainLength: 2
5169
5321
 
5322
+ Style/SafeNavigationChainLength:
5323
+ Description: 'Enforces safe navigation chains length to not exceed the configured maximum.'
5324
+ StyleGuide: '#safe-navigation'
5325
+ Enabled: true # see https://github.com/makandra/makandra-rubocop/pull/53#discussion_r1914769359
5326
+ VersionAdded: '1.68'
5327
+ Max: 2
5328
+
5170
5329
  Style/Sample:
5171
5330
  Description: >-
5172
5331
  Use `sample` instead of `shuffle.first`,
@@ -5205,6 +5364,13 @@ Style/Send:
5205
5364
  Enabled: false
5206
5365
  VersionAdded: '0.33'
5207
5366
 
5367
+ Style/SendWithLiteralMethodName:
5368
+ Description: 'Detects the use of the `public_send` method with a static method name argument.'
5369
+ Enabled: true
5370
+ Safe: false
5371
+ AllowSend: true
5372
+ VersionAdded: '1.64'
5373
+
5208
5374
  Style/SignalException:
5209
5375
  Description: 'Checks for proper usage of fail and raise.'
5210
5376
  StyleGuide: '#prefer-raise-over-fail'
@@ -5379,6 +5545,11 @@ Style/StructInheritance:
5379
5545
  VersionAdded: '0.29'
5380
5546
  VersionChanged: '1.20'
5381
5547
 
5548
+ Style/SuperArguments:
5549
+ Description: 'Call `super` without arguments and parentheses when the signature is identical.'
5550
+ Enabled: true
5551
+ VersionAdded: '1.64'
5552
+
5382
5553
  Style/SuperWithArgsParentheses:
5383
5554
  Description: 'Use parentheses for `super` with arguments.'
5384
5555
  StyleGuide: '#super-with-args'
@@ -5414,7 +5585,7 @@ Style/SymbolProc:
5414
5585
  Enabled: false # We can't enforce this because of "Can't create Binding from C level Proc" errors, and because it messes up arity checks.
5415
5586
  Safe: false
5416
5587
  VersionAdded: '0.26'
5417
- VersionChanged: '1.40'
5588
+ VersionChanged: '1.64'
5418
5589
  AllowMethodsWithArguments: false
5419
5590
  # A list of method names to be always allowed by the check.
5420
5591
  # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
@@ -1,3 +1,3 @@
1
1
  module MakandraRubocop
2
- VERSION = '14.0.1'.freeze
2
+ VERSION = '15.0.0'.freeze
3
3
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.executables = spec.files.grep(%r(^exe/)) { |f| File.basename(f) }
25
25
  spec.require_paths = ['lib']
26
26
 
27
- spec.add_dependency 'rubocop', '~> 1.61.0'
27
+ spec.add_dependency 'rubocop', '~> 1.70.0'
28
28
  spec.add_dependency 'rubocop-rails', '~> 2.23.1'
29
29
  spec.add_dependency 'rubocop-rspec', '~> 3.0.3'
30
30
  spec.add_dependency 'rubocop-capybara', '~> 2.20.0'
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: 14.0.1
4
+ version: 15.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: 2024-09-12 00:00:00.000000000 Z
12
+ date: 2025-01-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.61.0
20
+ version: 1.70.0
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.61.0
27
+ version: 1.70.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rubocop-rails
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -117,6 +117,7 @@ executables: []
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
+ - ".github/ISSUE_TEMPLATE/cop-discussion.md"
120
121
  - ".gitignore"
121
122
  - ".rubocop.yml"
122
123
  - ".ruby-version"