makandra-rubocop 7.2.0 → 8.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +11 -11
- data/README.md +39 -21
- data/Rakefile +1 -1
- data/config/default.yml +198 -25
- data/lib/makandra_rubocop/version.rb +1 -1
- data/makandra-rubocop.gemspec +2 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28161b56e8af9d29a442ce0c1f7829ed92e59f787caeec6e0a5e32460c359c4b
|
4
|
+
data.tar.gz: 33bc2c6f17befe461f55c31c7a0388612b48c265fa975e2f2c1f544620c92848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0747ea7979874775af93ab0e2f00f6489293268974cff820b5abbd7b00732250e0451150fa1a402450418dd666660f22884988a0a4504447aae47e10c1b8d12
|
7
|
+
data.tar.gz: 9e86aa89d4c3168d7a5f5e1f50a5a705f418d75547ec2715b77e9a188caa47e15ff110954b4e6563204f9ff3175616ea998fb53c2185597b44e84f85c5ee5676
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,12 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
9
9
|
### Compatible changes
|
10
10
|
|
11
11
|
|
12
|
+
## 8.0.0 - 2022-01-25
|
13
|
+
|
14
|
+
## Breaking changes
|
15
|
+
- Upgrade rubocop from version `1.18.4` to `1.25.1` (adds support for Ruby 3.1).
|
16
|
+
|
17
|
+
|
12
18
|
## 7.2.0 - 2021-12-07
|
13
19
|
|
14
20
|
### Compatible changes
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
makandra-rubocop (
|
5
|
-
rubocop (~> 1.
|
4
|
+
makandra-rubocop (8.0.0)
|
5
|
+
rubocop (~> 1.25.0)
|
6
6
|
rubocop-rails (~> 2.11.3)
|
7
7
|
rubocop-rspec (~> 2.4.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (6.1.4.
|
12
|
+
activesupport (6.1.4.4)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
@@ -19,25 +19,25 @@ GEM
|
|
19
19
|
concurrent-ruby (1.1.9)
|
20
20
|
i18n (1.8.11)
|
21
21
|
concurrent-ruby (~> 1.0)
|
22
|
-
minitest (5.
|
22
|
+
minitest (5.15.0)
|
23
23
|
parallel (1.21.0)
|
24
|
-
parser (3.0.
|
24
|
+
parser (3.1.0.0)
|
25
25
|
ast (~> 2.4.1)
|
26
26
|
rack (2.2.3)
|
27
|
-
rainbow (3.
|
27
|
+
rainbow (3.1.1)
|
28
28
|
rake (12.3.2)
|
29
29
|
regexp_parser (2.2.0)
|
30
30
|
rexml (3.2.5)
|
31
|
-
rubocop (1.
|
31
|
+
rubocop (1.25.0)
|
32
32
|
parallel (~> 1.10)
|
33
|
-
parser (>= 3.
|
33
|
+
parser (>= 3.1.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.
|
37
|
+
rubocop-ast (>= 1.15.1, < 2.0)
|
38
38
|
ruby-progressbar (~> 1.7)
|
39
39
|
unicode-display_width (>= 1.4.0, < 3.0)
|
40
|
-
rubocop-ast (1.
|
40
|
+
rubocop-ast (1.15.1)
|
41
41
|
parser (>= 3.0.1.1)
|
42
42
|
rubocop-rails (2.11.3)
|
43
43
|
activesupport (>= 4.2.0)
|
@@ -50,7 +50,7 @@ GEM
|
|
50
50
|
tzinfo (2.0.4)
|
51
51
|
concurrent-ruby (~> 1.0)
|
52
52
|
unicode-display_width (2.1.0)
|
53
|
-
zeitwerk (2.5.
|
53
|
+
zeitwerk (2.5.3)
|
54
54
|
|
55
55
|
PLATFORMS
|
56
56
|
ruby
|
data/README.md
CHANGED
@@ -116,6 +116,13 @@ Note that disabling cops should be an exception for extremely rare cases where y
|
|
116
116
|
If our defaults don't match your opinion, you should discuss with the team.
|
117
117
|
|
118
118
|
|
119
|
+
## Contributing
|
120
|
+
|
121
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/makandra/makandra-rubocop.
|
122
|
+
|
123
|
+
If you make any changes to this gem's Ruby code, make sure to run `rubocop`.
|
124
|
+
|
125
|
+
|
119
126
|
## Development
|
120
127
|
|
121
128
|
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.
|
@@ -123,29 +130,40 @@ After checking out the repo, run `bin/setup` to install dependencies. You can al
|
|
123
130
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
124
131
|
|
125
132
|
When you're making changes, update the version number in `version.rb`:
|
126
|
-
- Increase the major version when you're upgrading
|
133
|
+
- Increase the major version when you're upgrading a Rubocop dependency (see below)
|
127
134
|
- Increase the minor version e.g. when disabling a cop
|
128
135
|
|
129
|
-
For release run `bundle exec rake release`, which will create a git tag for the
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
136
|
+
For release run `bundle exec rake release`, which will create a git tag for the
|
137
|
+
version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
138
|
+
|
139
|
+
### Upgrading Rubocop dependencies
|
140
|
+
The following procedure works for either `rubocop`, `rubocop-rails` or
|
141
|
+
`rubocopo-rspec`. (Replace `rubocop` with the respective dependency name.)
|
142
|
+
|
143
|
+
1. Change the `rubocop` dependency in the Gemspec to the version you want to
|
144
|
+
upgrade to.
|
145
|
+
2. `bundle update rubocop`
|
146
|
+
|
147
|
+
Next, we need to update our config file to match their updated config. If
|
148
|
+
you have not added the Rubocop remote yet (check with `git remote -v`), do a
|
149
|
+
`git remote add rubocop https://github.com/rubocop-hq/rubocop.git`. Then:
|
150
|
+
|
151
|
+
1. Update the local copy of the Rubocop repository: `git fetch rubocop --no-tags`
|
152
|
+
(we can't import their tags or they would clash with ours)
|
153
|
+
2. Find the commit SHA of the previous and of the new Rubocop version in our
|
154
|
+
Gemspec. The easiest way is to look them up on their [releases page](https://github.com/rubocop/rubocop/releases).
|
155
|
+
3. Diff their config/default.yml between the previously used and the new Rubocop
|
156
|
+
version, and write it to a file: `git diff $OLDER_SHA $NEWER_SHA config/default.yml > config_diff`
|
157
|
+
4. If you are updating `rubocop-rails` or `rubocop-rspec`, edit the config_diff
|
158
|
+
file now and replace `config/default.yml` with `config/ext/{rails,rspec}.yml`
|
159
|
+
(respectively).
|
160
|
+
5. Apply the diff with `git apply ./config_diff --3way`
|
161
|
+
6. Resolve merge conflicts carefully and review all changes. We do not want to
|
162
|
+
loose changes in [our config files](https://github.com/makandra/makandra-rubocop/tree/master/config).
|
163
|
+
7. Delete the patch file
|
164
|
+
8. Increase the major version (see above)
|
165
|
+
9. Update the CHANGELOG
|
166
|
+
10. Commit
|
149
167
|
|
150
168
|
|
151
169
|
## License
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
-
#task default: :spec
|
2
|
+
# task default: :spec
|
data/config/default.yml
CHANGED
@@ -82,6 +82,8 @@ AllCops:
|
|
82
82
|
# When specifying style guide URLs, any paths and/or fragments will be
|
83
83
|
# evaluated relative to the base URL.
|
84
84
|
StyleGuideBaseURL: https://rubystyle.guide
|
85
|
+
# Documentation URLs will be constructed using the base URL.
|
86
|
+
DocumentationBaseURL: https://docs.rubocop.org/rubocop
|
85
87
|
# Extra details are not displayed in offense messages by default. Change
|
86
88
|
# behavior by overriding ExtraDetails, or by giving the
|
87
89
|
# `-E/--extra-details` option.
|
@@ -134,7 +136,7 @@ AllCops:
|
|
134
136
|
# What MRI version of the Ruby interpreter is the inspected code intended to
|
135
137
|
# run on? (If there is more than one, set this to the lowest version.)
|
136
138
|
# If a value is specified for TargetRubyVersion then it is used. Acceptable
|
137
|
-
# values are
|
139
|
+
# values are specified as a float (i.e. 3.0); the teeny version of Ruby
|
138
140
|
# should not be included. If the project specifies a Ruby version in the
|
139
141
|
# .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
|
140
142
|
# try to determine the desired version of Ruby by inspecting the
|
@@ -154,6 +156,7 @@ AllCops:
|
|
154
156
|
rubocop-minitest: [minitest]
|
155
157
|
rubocop-sequel: [sequel]
|
156
158
|
rubocop-rake: [rake]
|
159
|
+
rubocop-graphql: [graphql]
|
157
160
|
|
158
161
|
#################### Bundler ###############################
|
159
162
|
|
@@ -178,6 +181,20 @@ Bundler/GemComment:
|
|
178
181
|
IgnoredGems: []
|
179
182
|
OnlyFor: []
|
180
183
|
|
184
|
+
Bundler/GemFilename:
|
185
|
+
Description: 'Enforces the filename for managing gems.'
|
186
|
+
Enabled: true
|
187
|
+
VersionAdded: '1.20'
|
188
|
+
EnforcedStyle: 'Gemfile'
|
189
|
+
SupportedStyles:
|
190
|
+
- 'Gemfile'
|
191
|
+
- 'gems.rb'
|
192
|
+
Include:
|
193
|
+
- '**/Gemfile'
|
194
|
+
- '**/gems.rb'
|
195
|
+
- '**/Gemfile.lock'
|
196
|
+
- '**/gems.locked'
|
197
|
+
|
181
198
|
Bundler/GemVersion:
|
182
199
|
Description: 'Requires or forbids specifying gem versions.'
|
183
200
|
Enabled: false
|
@@ -199,6 +216,7 @@ Bundler/InsecureProtocolSource:
|
|
199
216
|
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
|
200
217
|
Enabled: true
|
201
218
|
VersionAdded: '0.50'
|
219
|
+
AllowHttpProtocol: true
|
202
220
|
Include:
|
203
221
|
- '**/*.gemfile'
|
204
222
|
- '**/Gemfile'
|
@@ -247,11 +265,20 @@ Gemspec/OrderedDependencies:
|
|
247
265
|
Include:
|
248
266
|
- '**/*.gemspec'
|
249
267
|
|
268
|
+
Gemspec/RequireMFA:
|
269
|
+
Description: 'Checks that the gemspec has metadata to require MFA from RubyGems.'
|
270
|
+
Enabled: pending
|
271
|
+
VersionAdded: '1.23'
|
272
|
+
Reference:
|
273
|
+
- https://guides.rubygems.org/mfa-requirement-opt-in/
|
274
|
+
Include:
|
275
|
+
- '**/*.gemspec'
|
276
|
+
|
250
277
|
Gemspec/RequiredRubyVersion:
|
251
278
|
Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
|
252
279
|
Enabled: true
|
253
280
|
VersionAdded: '0.52'
|
254
|
-
VersionChanged: '
|
281
|
+
VersionChanged: '1.22'
|
255
282
|
Include:
|
256
283
|
- '**/*.gemspec'
|
257
284
|
|
@@ -428,7 +455,11 @@ Layout/ClosingParenthesisIndentation:
|
|
428
455
|
Layout/CommentIndentation:
|
429
456
|
Description: 'Indentation of comments.'
|
430
457
|
Enabled: true
|
458
|
+
# When true, allows comments to have extra indentation if that aligns them
|
459
|
+
# with a comment on the preceding line.
|
460
|
+
AllowForAlignment: false
|
431
461
|
VersionAdded: '0.49'
|
462
|
+
VersionChanged: '1.24'
|
432
463
|
|
433
464
|
Layout/ConditionPosition:
|
434
465
|
Description: >-
|
@@ -500,13 +531,13 @@ Layout/EmptyLineBetweenDefs:
|
|
500
531
|
StyleGuide: '#empty-lines-between-methods'
|
501
532
|
Enabled: true
|
502
533
|
VersionAdded: '0.49'
|
503
|
-
VersionChanged: '1.
|
534
|
+
VersionChanged: '1.23'
|
504
535
|
EmptyLineBetweenMethodDefs: true
|
505
536
|
EmptyLineBetweenClassDefs: true
|
506
537
|
EmptyLineBetweenModuleDefs: true
|
507
|
-
#
|
508
|
-
# need an empty line between them.
|
509
|
-
AllowAdjacentOneLineDefs:
|
538
|
+
# `AllowAdjacentOneLineDefs` means that single line method definitions don't
|
539
|
+
# need an empty line between them. `true` by default.
|
540
|
+
AllowAdjacentOneLineDefs: true
|
510
541
|
# Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
|
511
542
|
NumberOfEmptyLines: 1
|
512
543
|
|
@@ -947,7 +978,6 @@ Layout/LineLength:
|
|
947
978
|
Enabled: false
|
948
979
|
VersionAdded: '0.25'
|
949
980
|
VersionChanged: '1.4'
|
950
|
-
AutoCorrect: true
|
951
981
|
Max: 120
|
952
982
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
953
983
|
# containing a URI to be longer than Max.
|
@@ -1351,10 +1381,11 @@ Layout/SpaceInsideParens:
|
|
1351
1381
|
StyleGuide: '#spaces-braces'
|
1352
1382
|
Enabled: true
|
1353
1383
|
VersionAdded: '0.49'
|
1354
|
-
VersionChanged: '
|
1384
|
+
VersionChanged: '1.22'
|
1355
1385
|
EnforcedStyle: no_space
|
1356
1386
|
SupportedStyles:
|
1357
1387
|
- space
|
1388
|
+
- compact
|
1358
1389
|
- no_space
|
1359
1390
|
|
1360
1391
|
Layout/SpaceInsidePercentLiteralDelimiters:
|
@@ -1438,6 +1469,20 @@ Lint/AmbiguousOperator:
|
|
1438
1469
|
VersionAdded: '0.17'
|
1439
1470
|
VersionChanged: '0.83'
|
1440
1471
|
|
1472
|
+
Lint/AmbiguousOperatorPrecedence:
|
1473
|
+
Description: >-
|
1474
|
+
Checks for expressions containing multiple binary operations with
|
1475
|
+
ambiguous precedence.
|
1476
|
+
Enabled: pending
|
1477
|
+
VersionAdded: '1.21'
|
1478
|
+
|
1479
|
+
Lint/AmbiguousRange:
|
1480
|
+
Description: Checks for ranges with ambiguous boundaries.
|
1481
|
+
Enabled: pending
|
1482
|
+
VersionAdded: '1.19'
|
1483
|
+
SafeAutoCorrect: false
|
1484
|
+
RequireParenthesesForMethodChains: false
|
1485
|
+
|
1441
1486
|
Lint/AmbiguousRegexpLiteral:
|
1442
1487
|
Description: >-
|
1443
1488
|
Checks for ambiguous regexp literals in the first argument of
|
@@ -1468,9 +1513,9 @@ Lint/BinaryOperatorWithIdenticalOperands:
|
|
1468
1513
|
Lint/BooleanSymbol:
|
1469
1514
|
Description: 'Check for `:true` and `:false` symbols.'
|
1470
1515
|
Enabled: true
|
1471
|
-
|
1516
|
+
SafeAutoCorrect: false
|
1472
1517
|
VersionAdded: '0.50'
|
1473
|
-
VersionChanged: '
|
1518
|
+
VersionChanged: '1.22'
|
1474
1519
|
|
1475
1520
|
Lint/CircularArgumentReference:
|
1476
1521
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
@@ -1518,6 +1563,11 @@ Lint/Debugger:
|
|
1518
1563
|
Capybara:
|
1519
1564
|
- save_and_open_page
|
1520
1565
|
- save_and_open_screenshot
|
1566
|
+
debug.rb:
|
1567
|
+
- binding.b
|
1568
|
+
- binding.break
|
1569
|
+
- Kernel.binding.b
|
1570
|
+
- Kernel.binding.break
|
1521
1571
|
Pry:
|
1522
1572
|
- binding.pry
|
1523
1573
|
- binding.remote_pry
|
@@ -1526,6 +1576,8 @@ Lint/Debugger:
|
|
1526
1576
|
Rails:
|
1527
1577
|
- debugger
|
1528
1578
|
- Kernel.debugger
|
1579
|
+
RubyJard:
|
1580
|
+
- jard
|
1529
1581
|
WebConsole:
|
1530
1582
|
- binding.console
|
1531
1583
|
|
@@ -1538,6 +1590,7 @@ Lint/DeprecatedConstants:
|
|
1538
1590
|
Description: 'Checks for deprecated constants.'
|
1539
1591
|
Enabled: true
|
1540
1592
|
VersionAdded: '1.8'
|
1593
|
+
VersionChanged: '1.22'
|
1541
1594
|
# You can configure deprecated constants.
|
1542
1595
|
# If there is an alternative method, you can set alternative value as `Alternative`.
|
1543
1596
|
# And you can set the deprecated version as `DeprecatedVersion`.
|
@@ -1558,6 +1611,9 @@ Lint/DeprecatedConstants:
|
|
1558
1611
|
'FALSE':
|
1559
1612
|
Alternative: 'false'
|
1560
1613
|
DeprecatedVersion: '2.4'
|
1614
|
+
'Net::HTTPServerException':
|
1615
|
+
Alternative: 'Net::HTTPClientException'
|
1616
|
+
DeprecatedVersion: '2.6'
|
1561
1617
|
'Random::DEFAULT':
|
1562
1618
|
Alternative: 'Random.new'
|
1563
1619
|
DeprecatedVersion: '3.0'
|
@@ -1749,6 +1805,13 @@ Lint/ImplicitStringConcatenation:
|
|
1749
1805
|
Enabled: true
|
1750
1806
|
VersionAdded: '0.36'
|
1751
1807
|
|
1808
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
1809
|
+
Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
|
1810
|
+
Enabled: pending
|
1811
|
+
SafeAutoCorrect: false
|
1812
|
+
VersionAdded: '1.21'
|
1813
|
+
VersionChanged: '1.24'
|
1814
|
+
|
1752
1815
|
Lint/IneffectiveAccessModifier:
|
1753
1816
|
Description: >-
|
1754
1817
|
Checks for attempts to use `private` or `protected` to set
|
@@ -1830,7 +1893,6 @@ Lint/MultipleComparison:
|
|
1830
1893
|
Enabled: true
|
1831
1894
|
VersionAdded: '0.47'
|
1832
1895
|
VersionChanged: '1.1'
|
1833
|
-
AllowMethodComparison: true
|
1834
1896
|
|
1835
1897
|
Lint/NestedMethodDefinition:
|
1836
1898
|
Description: 'Do not use nested method definitions.'
|
@@ -2013,6 +2075,11 @@ Lint/RequireParentheses:
|
|
2013
2075
|
Enabled: true
|
2014
2076
|
VersionAdded: '0.18'
|
2015
2077
|
|
2078
|
+
Lint/RequireRelativeSelfPath:
|
2079
|
+
Description: 'Checks for uses a file requiring itself with `require_relative`.'
|
2080
|
+
Enabled: pending
|
2081
|
+
VersionAdded: '1.22'
|
2082
|
+
|
2016
2083
|
Lint/RescueException:
|
2017
2084
|
Description: 'Avoid rescuing the Exception class.'
|
2018
2085
|
StyleGuide: '#no-blind-rescues'
|
@@ -2265,6 +2332,11 @@ Lint/UselessMethodDefinition:
|
|
2265
2332
|
Safe: false
|
2266
2333
|
AllowComments: true
|
2267
2334
|
|
2335
|
+
Lint/UselessRuby2Keywords:
|
2336
|
+
Description: 'Finds unnecessary uses of `ruby2_keywords`.'
|
2337
|
+
Enabled: pending
|
2338
|
+
VersionAdded: '1.23'
|
2339
|
+
|
2268
2340
|
Lint/UselessSetterCall:
|
2269
2341
|
Description: 'Checks for useless setter call to a local variable.'
|
2270
2342
|
Enabled: true
|
@@ -2419,6 +2491,17 @@ Naming/BinaryOperatorParameterName:
|
|
2419
2491
|
VersionAdded: '0.50'
|
2420
2492
|
VersionChanged: '1.2'
|
2421
2493
|
|
2494
|
+
Naming/BlockForwarding:
|
2495
|
+
Description: 'Use anonymous block forwarding.'
|
2496
|
+
StyleGuide: '#block-forwarding'
|
2497
|
+
Enabled: pending
|
2498
|
+
VersionAdded: '1.24'
|
2499
|
+
EnforcedStyle: anonymous
|
2500
|
+
SupportedStyles:
|
2501
|
+
- anonymous
|
2502
|
+
- explicit
|
2503
|
+
BlockForwardingName: block
|
2504
|
+
|
2422
2505
|
Naming/BlockParameterName:
|
2423
2506
|
Description: >-
|
2424
2507
|
Checks for block parameter names that contain capital letters,
|
@@ -2456,6 +2539,7 @@ Naming/FileName:
|
|
2456
2539
|
StyleGuide: '#snake-case-files'
|
2457
2540
|
Enabled: true
|
2458
2541
|
VersionAdded: '0.50'
|
2542
|
+
VersionChanged: '1.23'
|
2459
2543
|
# Camel case file names listed in `AllCops:Include` and all file names listed
|
2460
2544
|
# in `AllCops:Exclude` are excluded by default. Add extra excludes here.
|
2461
2545
|
Exclude: []
|
@@ -2468,6 +2552,13 @@ Naming/FileName:
|
|
2468
2552
|
# whether each source file's class or module name matches the file name --
|
2469
2553
|
# not whether the nested module hierarchy matches the subdirectory path.
|
2470
2554
|
CheckDefinitionPathHierarchy: true
|
2555
|
+
# paths that are considered root directories, for example "lib" in most ruby projects
|
2556
|
+
# or "app/models" in rails projects
|
2557
|
+
CheckDefinitionPathHierarchyRoots:
|
2558
|
+
- lib
|
2559
|
+
- spec
|
2560
|
+
- test
|
2561
|
+
- src
|
2471
2562
|
# If non-`nil`, expect all source file names to match the following regex.
|
2472
2563
|
# Only the file name itself is matched, not the entire file path.
|
2473
2564
|
# Use anchors as necessary if you want to match the entire name rather than
|
@@ -2542,6 +2633,7 @@ Naming/InclusiveLanguage:
|
|
2542
2633
|
Description: 'Recommend the use of inclusive language instead of problematic terms.'
|
2543
2634
|
Enabled: true
|
2544
2635
|
VersionAdded: '1.18'
|
2636
|
+
VersionChanged: '1.21'
|
2545
2637
|
CheckIdentifiers: true
|
2546
2638
|
CheckConstants: true
|
2547
2639
|
CheckVariables: true
|
@@ -2561,6 +2653,7 @@ Naming/InclusiveLanguage:
|
|
2561
2653
|
- denylist
|
2562
2654
|
- block
|
2563
2655
|
slave:
|
2656
|
+
WholeWord: true
|
2564
2657
|
Suggestions: ['replica', 'secondary', 'follower']
|
2565
2658
|
|
2566
2659
|
Naming/MemoizedInstanceVariableName:
|
@@ -2702,6 +2795,14 @@ Security/Eval:
|
|
2702
2795
|
Enabled: false # We all know not to eval. If we need to, there will be a reason.
|
2703
2796
|
VersionAdded: '0.47'
|
2704
2797
|
|
2798
|
+
Security/IoMethods:
|
2799
|
+
Description: >-
|
2800
|
+
Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`,
|
2801
|
+
`IO.foreach`, and `IO.readlines`.
|
2802
|
+
Enabled: pending
|
2803
|
+
Safe: false
|
2804
|
+
VersionAdded: '1.22'
|
2805
|
+
|
2705
2806
|
Security/JSONLoad:
|
2706
2807
|
Description: >-
|
2707
2808
|
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
@@ -2709,10 +2810,9 @@ Security/JSONLoad:
|
|
2709
2810
|
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
2710
2811
|
Enabled: true
|
2711
2812
|
VersionAdded: '0.43'
|
2712
|
-
VersionChanged: '
|
2813
|
+
VersionChanged: '1.22'
|
2713
2814
|
# Autocorrect here will change to a method that may cause crashes depending
|
2714
2815
|
# on the value of the argument.
|
2715
|
-
AutoCorrect: false
|
2716
2816
|
SafeAutoCorrect: false
|
2717
2817
|
|
2718
2818
|
Security/MarshalLoad:
|
@@ -2778,8 +2878,9 @@ Style/AndOr:
|
|
2778
2878
|
Description: 'Use &&/|| instead of and/or.'
|
2779
2879
|
StyleGuide: '#no-and-or-or'
|
2780
2880
|
Enabled: true
|
2881
|
+
SafeAutoCorrect: false
|
2781
2882
|
VersionAdded: '0.9'
|
2782
|
-
VersionChanged: '
|
2883
|
+
VersionChanged: '1.21'
|
2783
2884
|
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
2784
2885
|
# or completely (always).
|
2785
2886
|
EnforcedStyle: always
|
@@ -2815,7 +2916,7 @@ Style/AsciiComments:
|
|
2815
2916
|
StyleGuide: '#english-comments'
|
2816
2917
|
Enabled: false
|
2817
2918
|
VersionAdded: '0.9'
|
2818
|
-
VersionChanged: '
|
2919
|
+
VersionChanged: '1.21'
|
2819
2920
|
AllowedChars:
|
2820
2921
|
- ©
|
2821
2922
|
|
@@ -2977,7 +3078,7 @@ Style/CaseEquality:
|
|
2977
3078
|
Enabled: true
|
2978
3079
|
VersionAdded: '0.9'
|
2979
3080
|
VersionChanged: '0.89'
|
2980
|
-
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
|
3081
|
+
# If `AllowOnConstant` option is enabled, the cop will ignore violations when the receiver of
|
2981
3082
|
# the case equality operator is a constant.
|
2982
3083
|
#
|
2983
3084
|
# # bad
|
@@ -3152,7 +3253,7 @@ Style/CommentAnnotation:
|
|
3152
3253
|
StyleGuide: '#annotate-keywords'
|
3153
3254
|
Enabled: true
|
3154
3255
|
VersionAdded: '0.10'
|
3155
|
-
VersionChanged: '1.
|
3256
|
+
VersionChanged: '1.20'
|
3156
3257
|
Keywords:
|
3157
3258
|
- TODO
|
3158
3259
|
- FIXME
|
@@ -3165,8 +3266,9 @@ Style/CommentAnnotation:
|
|
3165
3266
|
Style/CommentedKeyword:
|
3166
3267
|
Description: 'Do not place comments on the same line as certain keywords.'
|
3167
3268
|
Enabled: false
|
3269
|
+
SafeAutoCorrect: false
|
3168
3270
|
VersionAdded: '0.51'
|
3169
|
-
VersionChanged: '1.
|
3271
|
+
VersionChanged: '1.19'
|
3170
3272
|
|
3171
3273
|
Style/ConditionalAssignment:
|
3172
3274
|
Description: >-
|
@@ -3419,6 +3521,18 @@ Style/ExponentialNotation:
|
|
3419
3521
|
- engineering
|
3420
3522
|
- integral
|
3421
3523
|
|
3524
|
+
Style/FileRead:
|
3525
|
+
Description: 'Favor `File.(bin)read` convenience methods.'
|
3526
|
+
StyleGuide: '#file-read'
|
3527
|
+
Enabled: pending
|
3528
|
+
VersionAdded: '1.24'
|
3529
|
+
|
3530
|
+
Style/FileWrite:
|
3531
|
+
Description: 'Favor `File.(bin)write` convenience methods.'
|
3532
|
+
StyleGuide: '#file-write'
|
3533
|
+
Enabled: pending
|
3534
|
+
VersionAdded: '1.24'
|
3535
|
+
|
3422
3536
|
Style/FloatDivision:
|
3423
3537
|
Description: 'For performing float division, coerce one side only.'
|
3424
3538
|
StyleGuide: '#float-division'
|
@@ -3577,7 +3691,7 @@ Style/HashSyntax:
|
|
3577
3691
|
StyleGuide: '#hash-literals'
|
3578
3692
|
Enabled: true
|
3579
3693
|
VersionAdded: '0.9'
|
3580
|
-
VersionChanged: '
|
3694
|
+
VersionChanged: '1.24'
|
3581
3695
|
EnforcedStyle: ruby19
|
3582
3696
|
SupportedStyles:
|
3583
3697
|
# checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
|
@@ -3588,6 +3702,15 @@ Style/HashSyntax:
|
|
3588
3702
|
- no_mixed_keys
|
3589
3703
|
# enforces both ruby19 and no_mixed_keys styles
|
3590
3704
|
- ruby19_no_mixed_keys
|
3705
|
+
# Force hashes that have a hash value omission
|
3706
|
+
EnforcedShorthandSyntax: always
|
3707
|
+
SupportedShorthandSyntax:
|
3708
|
+
# forces use of the 3.1 syntax (e.g. {foo:}) when the hash key and value are the same.
|
3709
|
+
- always
|
3710
|
+
# forces use of explicit hash literal value.
|
3711
|
+
- never
|
3712
|
+
# accepts both shorthand and explicit use of hash literal value.
|
3713
|
+
- either
|
3591
3714
|
# Force hashes that have a symbol value to use hash rockets
|
3592
3715
|
UseHashRocketsWithSymbolValues: false
|
3593
3716
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
@@ -3613,8 +3736,9 @@ Style/IdenticalConditionalBranches:
|
|
3613
3736
|
line at the end of each branch, which can validly be moved
|
3614
3737
|
out of the conditional.
|
3615
3738
|
Enabled: true
|
3739
|
+
SafeAutoCorrect: false
|
3616
3740
|
VersionAdded: '0.36'
|
3617
|
-
VersionChanged: '1.
|
3741
|
+
VersionChanged: '1.19'
|
3618
3742
|
|
3619
3743
|
Style/IfInsideElse:
|
3620
3744
|
Description: 'Finds if nodes inside else, which can be converted to elsif.'
|
@@ -3670,7 +3794,7 @@ Style/InPatternThen:
|
|
3670
3794
|
Style/InfiniteLoop:
|
3671
3795
|
Description: >-
|
3672
3796
|
Use Kernel#loop for infinite loops.
|
3673
|
-
This cop is unsafe
|
3797
|
+
This cop is unsafe if the body may raise a `StopIteration` exception.
|
3674
3798
|
Safe: false
|
3675
3799
|
StyleGuide: '#infinite-loop'
|
3676
3800
|
Enabled: true
|
@@ -3763,6 +3887,12 @@ Style/LineEndConcatenation:
|
|
3763
3887
|
VersionAdded: '0.18'
|
3764
3888
|
VersionChanged: '0.64'
|
3765
3889
|
|
3890
|
+
Style/MapToHash:
|
3891
|
+
Description: 'Prefer `to_h` with a block over `map.to_h`.'
|
3892
|
+
Enabled: pending
|
3893
|
+
VersionAdded: '1.24'
|
3894
|
+
Safe: false
|
3895
|
+
|
3766
3896
|
Style/MethodCallWithArgsParentheses:
|
3767
3897
|
Description: 'Use parentheses for method calls with arguments.'
|
3768
3898
|
StyleGuide: '#method-invocation-parens'
|
@@ -3941,6 +4071,7 @@ Style/MultipleComparison:
|
|
3941
4071
|
Enabled: true
|
3942
4072
|
VersionAdded: '0.49'
|
3943
4073
|
VersionChanged: '1.1'
|
4074
|
+
AllowMethodComparison: true
|
3944
4075
|
|
3945
4076
|
Style/MutableConstant:
|
3946
4077
|
Description: 'Do not assign mutable objects to constants.'
|
@@ -4097,6 +4228,21 @@ Style/Not:
|
|
4097
4228
|
VersionAdded: '0.9'
|
4098
4229
|
VersionChanged: '0.20'
|
4099
4230
|
|
4231
|
+
Style/NumberedParameters:
|
4232
|
+
Description: 'Restrict the usage of numbered parameters.'
|
4233
|
+
Enabled: pending
|
4234
|
+
VersionAdded: '1.22'
|
4235
|
+
EnforcedStyle: allow_single_line
|
4236
|
+
SupportedStyles:
|
4237
|
+
- allow_single_line
|
4238
|
+
- disallow
|
4239
|
+
|
4240
|
+
Style/NumberedParametersLimit:
|
4241
|
+
Description: 'Avoid excessive numbered params in a single block.'
|
4242
|
+
Enabled: pending
|
4243
|
+
VersionAdded: '1.22'
|
4244
|
+
Max: 1
|
4245
|
+
|
4100
4246
|
Style/NumericLiteralPrefix:
|
4101
4247
|
Description: 'Use smallcase prefixes for numeric literals.'
|
4102
4248
|
StyleGuide: '#numeric-literal-prefixes'
|
@@ -4107,7 +4253,6 @@ Style/NumericLiteralPrefix:
|
|
4107
4253
|
- zero_with_o
|
4108
4254
|
- zero_only
|
4109
4255
|
|
4110
|
-
|
4111
4256
|
Style/NumericLiterals:
|
4112
4257
|
Description: >-
|
4113
4258
|
Add underscores to large numeric literals to improve their
|
@@ -4118,6 +4263,8 @@ Style/NumericLiterals:
|
|
4118
4263
|
VersionChanged: '0.48'
|
4119
4264
|
MinDigits: 5
|
4120
4265
|
Strict: false
|
4266
|
+
# You can specify allowed numbers. (e.g. port number 3000, 8080, and etc)
|
4267
|
+
AllowedNumbers: []
|
4121
4268
|
|
4122
4269
|
Style/NumericPredicate:
|
4123
4270
|
Description: >-
|
@@ -4152,6 +4299,16 @@ Style/OneLineConditional:
|
|
4152
4299
|
VersionAdded: '0.9'
|
4153
4300
|
VersionChanged: '0.90'
|
4154
4301
|
|
4302
|
+
Style/OpenStructUse:
|
4303
|
+
Description: >-
|
4304
|
+
Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance,
|
4305
|
+
version compatibility, and potential security issues.
|
4306
|
+
Reference:
|
4307
|
+
- https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats
|
4308
|
+
|
4309
|
+
Enabled: pending
|
4310
|
+
VersionAdded: '1.23'
|
4311
|
+
|
4155
4312
|
Style/OptionHash:
|
4156
4313
|
Description: "Don't use option hashes when you can use keyword arguments."
|
4157
4314
|
Enabled: false
|
@@ -4164,6 +4321,7 @@ Style/OptionHash:
|
|
4164
4321
|
- args
|
4165
4322
|
- params
|
4166
4323
|
- parameters
|
4324
|
+
Allowlist: []
|
4167
4325
|
|
4168
4326
|
Style/OptionalArguments:
|
4169
4327
|
Description: >-
|
@@ -4416,12 +4574,19 @@ Style/RedundantSelfAssignment:
|
|
4416
4574
|
Safe: false
|
4417
4575
|
VersionAdded: '0.90'
|
4418
4576
|
|
4577
|
+
Style/RedundantSelfAssignmentBranch:
|
4578
|
+
Description: 'Checks for places where conditional branch makes redundant self-assignment.'
|
4579
|
+
Enabled: pending
|
4580
|
+
VersionAdded: '1.19'
|
4581
|
+
|
4419
4582
|
Style/RedundantSort:
|
4420
4583
|
Description: >-
|
4421
4584
|
Use `min` instead of `sort.first`,
|
4422
4585
|
`max_by` instead of `sort_by...last`, etc.
|
4423
4586
|
Enabled: true
|
4424
4587
|
VersionAdded: '0.76'
|
4588
|
+
VersionChanged: '1.22'
|
4589
|
+
Safe: false
|
4425
4590
|
|
4426
4591
|
Style/RedundantSortBy:
|
4427
4592
|
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
|
@@ -4502,6 +4667,12 @@ Style/Sample:
|
|
4502
4667
|
Enabled: true
|
4503
4668
|
VersionAdded: '0.30'
|
4504
4669
|
|
4670
|
+
Style/SelectByRegexp:
|
4671
|
+
Description: 'Prefer grep/grep_v to select/reject with a regexp match.'
|
4672
|
+
Enabled: pending
|
4673
|
+
SafeAutoCorrect: false
|
4674
|
+
VersionAdded: '1.22'
|
4675
|
+
|
4505
4676
|
Style/SelfAssignment:
|
4506
4677
|
Description: >-
|
4507
4678
|
Checks for places where self-assignment shorthand should have
|
@@ -4587,6 +4758,7 @@ Style/SpecialGlobalVars:
|
|
4587
4758
|
VersionAdded: '0.13'
|
4588
4759
|
VersionChanged: '0.36'
|
4589
4760
|
SafeAutoCorrect: false
|
4761
|
+
RequireEnglish: true
|
4590
4762
|
EnforcedStyle: use_english_names
|
4591
4763
|
SupportedStyles:
|
4592
4764
|
- use_perl_names
|
@@ -4687,8 +4859,9 @@ Style/StructInheritance:
|
|
4687
4859
|
Description: 'Checks for inheritance from Struct.new.'
|
4688
4860
|
StyleGuide: '#no-extend-struct-new'
|
4689
4861
|
Enabled: false
|
4862
|
+
SafeAutoCorrect: false
|
4690
4863
|
VersionAdded: '0.29'
|
4691
|
-
VersionChanged: '
|
4864
|
+
VersionChanged: '1.20'
|
4692
4865
|
|
4693
4866
|
Style/SwapValues:
|
4694
4867
|
Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
|
@@ -4907,7 +5080,7 @@ Style/VariableInterpolation:
|
|
4907
5080
|
|
4908
5081
|
Style/WhenThen:
|
4909
5082
|
Description: 'Use when x then ... for one-line cases.'
|
4910
|
-
StyleGuide: '#
|
5083
|
+
StyleGuide: '#no-when-semicolons'
|
4911
5084
|
Enabled: true
|
4912
5085
|
VersionAdded: '0.9'
|
4913
5086
|
|
@@ -4931,7 +5104,7 @@ Style/WordArray:
|
|
4931
5104
|
StyleGuide: '#percent-w'
|
4932
5105
|
Enabled: false
|
4933
5106
|
VersionAdded: '0.9'
|
4934
|
-
VersionChanged: '
|
5107
|
+
VersionChanged: '1.19'
|
4935
5108
|
EnforcedStyle: percent
|
4936
5109
|
SupportedStyles:
|
4937
5110
|
# percent style: %w(word1 word2)
|
data/makandra-rubocop.gemspec
CHANGED
@@ -23,10 +23,11 @@ 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.
|
26
|
+
spec.add_dependency 'rubocop', '~> 1.25.0'
|
27
27
|
spec.add_dependency 'rubocop-rails', '~> 2.11.3'
|
28
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'
|
32
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
32
33
|
end
|
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:
|
4
|
+
version: 8.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: 2022-01-
|
12
|
+
date: 2022-01-26 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.
|
20
|
+
version: 1.25.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.
|
27
|
+
version: 1.25.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rubocop-rails
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +110,8 @@ files:
|
|
110
110
|
homepage: https://github.com/makandra/makandra-rubocop
|
111
111
|
licenses:
|
112
112
|
- MIT
|
113
|
-
metadata:
|
113
|
+
metadata:
|
114
|
+
rubygems_mfa_required: 'true'
|
114
115
|
post_install_message:
|
115
116
|
rdoc_options: []
|
116
117
|
require_paths:
|
@@ -126,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
127
|
- !ruby/object:Gem::Version
|
127
128
|
version: '0'
|
128
129
|
requirements: []
|
129
|
-
rubygems_version: 3.
|
130
|
+
rubygems_version: 3.0.3
|
130
131
|
signing_key:
|
131
132
|
specification_version: 4
|
132
133
|
summary: makandra's default Rubocop configuration
|