ruboclean 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +14 -18
- data/.rubocop.yml +309 -0
- data/Gemfile +7 -5
- data/Gemfile.lock +29 -22
- data/Rakefile +5 -5
- data/bin/console +3 -3
- data/bin/ruboclean +2 -2
- data/bin/test +4 -4
- data/lib/ruboclean/grouper.rb +2 -2
- data/lib/ruboclean/orderer.rb +1 -1
- data/lib/ruboclean/rubocop_configuration_path.rb +6 -4
- data/lib/ruboclean/version.rb +1 -1
- data/lib/ruboclean.rb +4 -4
- data/ruboclean.gemspec +15 -14
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8356a24c5eef21d90f98b6a9d70e05c39eecca00bdad3cc44cf487f7f13d4d3f
|
4
|
+
data.tar.gz: 547493df65b231feec2b0e110beaca285a4c708726a60f25ce42da25c04297de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a322034ef76aef728838a67c0400b6a869614765367347582b99a6a0e9d76ceb1c04ac7f93217d35702eb18b9c111958b059ee39716a8f5d2535f00a6e05e0b
|
7
|
+
data.tar.gz: 2b9895e2eba1124a33fd0808f2622a22e848cfe87ebede24cda7f17dfc7490e233db040342de84343d69f1dd57d430b8feaf5e9aa87d8961c8c3662624d3e583
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,33 +1,29 @@
|
|
1
1
|
env:
|
2
|
-
RUBY_VERSION: 2.7
|
3
2
|
CC_TEST_REPORTER_BINARY_URL: https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
|
4
3
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
5
4
|
|
6
5
|
name: Continuous Integration
|
7
|
-
on:
|
6
|
+
on:
|
7
|
+
push:
|
8
|
+
branches:
|
9
|
+
- 'main' # Set a branch to deploy
|
10
|
+
pull_request:
|
8
11
|
|
9
12
|
jobs:
|
10
13
|
test:
|
11
|
-
|
12
|
-
|
14
|
+
strategy:
|
15
|
+
fail-fast: false
|
16
|
+
matrix:
|
17
|
+
os: [ubuntu-latest]
|
18
|
+
ruby: ['2.7', '3.0', '3.1', head]
|
19
|
+
runs-on: ${{ matrix.os }}
|
13
20
|
steps:
|
14
|
-
- uses: actions/checkout@
|
21
|
+
- uses: actions/checkout@v3
|
15
22
|
|
16
23
|
- uses: ruby/setup-ruby@v1
|
17
24
|
with:
|
18
|
-
ruby-version: ${{
|
19
|
-
|
20
|
-
# install gems
|
21
|
-
- name: Cache Ruby gems
|
22
|
-
uses: actions/cache@v2
|
23
|
-
with:
|
24
|
-
path: vendor/bundle
|
25
|
-
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
26
|
-
|
27
|
-
- name: Bundle install
|
28
|
-
run: |
|
29
|
-
bundle config path vendor/bundle
|
30
|
-
bundle install --jobs 4 --retry 3
|
25
|
+
ruby-version: ${{ matrix.ruby }}
|
26
|
+
bundler-cache: true
|
31
27
|
|
32
28
|
# prepare CC test reporter
|
33
29
|
- name: Download CC test reporter binary
|
data/.rubocop.yml
CHANGED
@@ -1,107 +1,332 @@
|
|
1
1
|
---
|
2
2
|
|
3
|
+
require:
|
4
|
+
- rubocop-minitest
|
5
|
+
- rubocop-rake
|
6
|
+
|
7
|
+
Style/StringLiterals:
|
8
|
+
Enabled: true
|
9
|
+
EnforcedStyle: double_quotes
|
10
|
+
|
11
|
+
Gemspec/DeprecatedAttributeAssignment:
|
12
|
+
Enabled: true
|
13
|
+
|
14
|
+
Gemspec/RequireMFA:
|
15
|
+
Enabled: true
|
16
|
+
|
3
17
|
Layout/BeginEndAlignment:
|
4
18
|
Enabled: true
|
5
19
|
|
6
20
|
Layout/EmptyLinesAroundAttributeAccessor:
|
7
21
|
Enabled: true
|
8
22
|
|
23
|
+
Layout/LineContinuationLeadingSpace:
|
24
|
+
Enabled: true
|
25
|
+
|
26
|
+
Layout/LineContinuationSpacing:
|
27
|
+
Enabled: true
|
28
|
+
|
29
|
+
Layout/LineEndStringConcatenationIndentation:
|
30
|
+
Enabled: true
|
31
|
+
|
9
32
|
Layout/SpaceAroundMethodCallOperator:
|
10
33
|
Enabled: true
|
11
34
|
|
35
|
+
Layout/SpaceBeforeBrackets:
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Lint/AmbiguousAssignment:
|
39
|
+
Enabled: true
|
40
|
+
|
41
|
+
Lint/AmbiguousOperatorPrecedence:
|
42
|
+
Enabled: true
|
43
|
+
|
44
|
+
Lint/AmbiguousRange:
|
45
|
+
Enabled: true
|
46
|
+
|
12
47
|
Lint/BinaryOperatorWithIdenticalOperands:
|
13
48
|
Enabled: true
|
14
49
|
|
15
50
|
Lint/ConstantDefinitionInBlock:
|
16
51
|
Enabled: true
|
17
52
|
|
53
|
+
Lint/ConstantOverwrittenInRescue:
|
54
|
+
Enabled: true
|
55
|
+
|
56
|
+
Lint/DeprecatedConstants:
|
57
|
+
Enabled: true
|
58
|
+
|
18
59
|
Lint/DeprecatedOpenSSLConstant:
|
19
60
|
Enabled: true
|
20
61
|
|
62
|
+
Lint/DuplicateBranch:
|
63
|
+
Enabled: true
|
64
|
+
|
21
65
|
Lint/DuplicateElsifCondition:
|
22
66
|
Enabled: true
|
23
67
|
|
68
|
+
Lint/DuplicateMagicComment:
|
69
|
+
Enabled: true
|
70
|
+
|
71
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
72
|
+
Enabled: true
|
73
|
+
|
24
74
|
Lint/DuplicateRequire:
|
25
75
|
Enabled: true
|
26
76
|
|
27
77
|
Lint/DuplicateRescueException:
|
28
78
|
Enabled: true
|
29
79
|
|
80
|
+
Lint/EmptyBlock:
|
81
|
+
Enabled: true
|
82
|
+
|
83
|
+
Lint/EmptyClass:
|
84
|
+
Enabled: true
|
85
|
+
|
30
86
|
Lint/EmptyConditionalBody:
|
31
87
|
Enabled: true
|
32
88
|
|
33
89
|
Lint/EmptyFile:
|
34
90
|
Enabled: true
|
35
91
|
|
92
|
+
Lint/EmptyInPattern:
|
93
|
+
Enabled: true
|
94
|
+
|
36
95
|
Lint/FloatComparison:
|
37
96
|
Enabled: true
|
38
97
|
|
39
98
|
Lint/IdentityComparison:
|
40
99
|
Enabled: true
|
41
100
|
|
101
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
102
|
+
Enabled: true
|
103
|
+
|
104
|
+
Lint/LambdaWithoutLiteralBlock:
|
105
|
+
Enabled: true
|
106
|
+
|
42
107
|
Lint/MissingSuper:
|
43
108
|
Enabled: true
|
44
109
|
|
45
110
|
Lint/MixedRegexpCaptureTypes:
|
46
111
|
Enabled: true
|
47
112
|
|
113
|
+
Lint/NoReturnInBeginEndBlocks:
|
114
|
+
Enabled: true
|
115
|
+
|
116
|
+
Lint/NonAtomicFileOperation:
|
117
|
+
Enabled: true
|
118
|
+
|
119
|
+
Lint/NumberedParameterAssignment:
|
120
|
+
Enabled: true
|
121
|
+
|
122
|
+
Lint/OrAssignmentToConstant:
|
123
|
+
Enabled: true
|
124
|
+
|
48
125
|
Lint/OutOfRangeRegexpRef:
|
49
126
|
Enabled: true
|
50
127
|
|
51
128
|
Lint/RaiseException:
|
52
129
|
Enabled: true
|
53
130
|
|
131
|
+
Lint/RedundantDirGlobSort:
|
132
|
+
Enabled: true
|
133
|
+
|
134
|
+
Lint/RefinementImportMethods:
|
135
|
+
Enabled: true
|
136
|
+
|
137
|
+
Lint/RequireRangeParentheses:
|
138
|
+
Enabled: true
|
139
|
+
|
140
|
+
Lint/RequireRelativeSelfPath:
|
141
|
+
Enabled: true
|
142
|
+
|
54
143
|
Lint/SelfAssignment:
|
55
144
|
Enabled: true
|
56
145
|
|
57
146
|
Lint/StructNewOverride:
|
58
147
|
Enabled: true
|
59
148
|
|
149
|
+
Lint/SymbolConversion:
|
150
|
+
Enabled: true
|
151
|
+
|
152
|
+
Lint/ToEnumArguments:
|
153
|
+
Enabled: true
|
154
|
+
|
60
155
|
Lint/TopLevelReturnWithArgument:
|
61
156
|
Enabled: true
|
62
157
|
|
63
158
|
Lint/TrailingCommaInAttributeDeclaration:
|
64
159
|
Enabled: true
|
65
160
|
|
161
|
+
Lint/TripleQuotes:
|
162
|
+
Enabled: true
|
163
|
+
|
164
|
+
Lint/UnexpectedBlockArity:
|
165
|
+
Enabled: true
|
166
|
+
|
167
|
+
Lint/UnmodifiedReduceAccumulator:
|
168
|
+
Enabled: true
|
169
|
+
|
66
170
|
Lint/UnreachableLoop:
|
67
171
|
Enabled: true
|
68
172
|
|
69
173
|
Lint/UselessMethodDefinition:
|
70
174
|
Enabled: true
|
71
175
|
|
176
|
+
Lint/UselessRuby2Keywords:
|
177
|
+
Enabled: true
|
178
|
+
|
72
179
|
Lint/UselessTimes:
|
73
180
|
Enabled: true
|
74
181
|
|
182
|
+
Minitest/AssertInDelta:
|
183
|
+
Enabled: true
|
184
|
+
|
185
|
+
Minitest/AssertKindOf:
|
186
|
+
Enabled: true
|
187
|
+
|
188
|
+
Minitest/AssertOutput:
|
189
|
+
Enabled: true
|
190
|
+
|
191
|
+
Minitest/AssertPathExists:
|
192
|
+
Enabled: true
|
193
|
+
|
194
|
+
Minitest/AssertPredicate:
|
195
|
+
Enabled: true
|
196
|
+
|
197
|
+
Minitest/AssertRaisesCompoundBody:
|
198
|
+
Enabled: true
|
199
|
+
|
200
|
+
Minitest/AssertRaisesWithRegexpArgument:
|
201
|
+
Enabled: true
|
202
|
+
|
203
|
+
Minitest/AssertSilent:
|
204
|
+
Enabled: true
|
205
|
+
|
206
|
+
Minitest/AssertWithExpectedArgument:
|
207
|
+
Enabled: true
|
208
|
+
|
209
|
+
Minitest/AssertionInLifecycleHook:
|
210
|
+
Enabled: true
|
211
|
+
|
212
|
+
Minitest/DuplicateTestRun:
|
213
|
+
Enabled: true
|
214
|
+
|
215
|
+
Minitest/EmptyLineBeforeAssertionMethods:
|
216
|
+
Enabled: true
|
217
|
+
|
218
|
+
Minitest/LiteralAsActualArgument:
|
219
|
+
Enabled: true
|
220
|
+
|
221
|
+
Minitest/MultipleAssertions:
|
222
|
+
Enabled: true
|
223
|
+
Max: 5
|
224
|
+
|
225
|
+
Minitest/RefuteInDelta:
|
226
|
+
Enabled: true
|
227
|
+
|
228
|
+
Minitest/RefuteKindOf:
|
229
|
+
Enabled: true
|
230
|
+
|
231
|
+
Minitest/RefutePathExists:
|
232
|
+
Enabled: true
|
233
|
+
|
234
|
+
Minitest/RefutePredicate:
|
235
|
+
Enabled: true
|
236
|
+
|
237
|
+
Minitest/SkipEnsure:
|
238
|
+
Enabled: true
|
239
|
+
|
240
|
+
Minitest/SkipWithoutReason:
|
241
|
+
Enabled: true
|
242
|
+
|
243
|
+
Minitest/TestMethodName:
|
244
|
+
Enabled: true
|
245
|
+
|
246
|
+
Minitest/UnreachableAssertion:
|
247
|
+
Enabled: true
|
248
|
+
|
249
|
+
Minitest/UnspecifiedException:
|
250
|
+
Enabled: true
|
251
|
+
|
252
|
+
Naming/BlockForwarding:
|
253
|
+
Enabled: true
|
254
|
+
|
255
|
+
Security/CompoundHash:
|
256
|
+
Enabled: true
|
257
|
+
|
258
|
+
Security/IoMethods:
|
259
|
+
Enabled: true
|
260
|
+
|
75
261
|
Style/AccessorGrouping:
|
76
262
|
Enabled: true
|
77
263
|
|
264
|
+
Style/ArgumentsForwarding:
|
265
|
+
Enabled: true
|
266
|
+
|
78
267
|
Style/ArrayCoercion:
|
79
268
|
Enabled: true
|
80
269
|
|
270
|
+
Style/ArrayIntersect:
|
271
|
+
Enabled: true
|
272
|
+
|
81
273
|
Style/BisectedAttrAccessor:
|
82
274
|
Enabled: true
|
83
275
|
|
84
276
|
Style/CaseLikeIf:
|
85
277
|
Enabled: true
|
86
278
|
|
279
|
+
Style/CollectionCompact:
|
280
|
+
Enabled: true
|
281
|
+
|
87
282
|
Style/CombinableLoops:
|
88
283
|
Enabled: true
|
89
284
|
|
285
|
+
Style/ConcatArrayLiterals:
|
286
|
+
Enabled: true
|
287
|
+
|
288
|
+
Style/DocumentDynamicEvalDefinition:
|
289
|
+
Enabled: true
|
290
|
+
|
291
|
+
Style/EmptyHeredoc:
|
292
|
+
Enabled: true
|
293
|
+
|
294
|
+
Style/EndlessMethod:
|
295
|
+
Enabled: true
|
296
|
+
|
297
|
+
Style/EnvHome:
|
298
|
+
Enabled: true
|
299
|
+
|
90
300
|
Style/ExplicitBlockArgument:
|
91
301
|
Enabled: true
|
92
302
|
|
93
303
|
Style/ExponentialNotation:
|
94
304
|
Enabled: true
|
95
305
|
|
306
|
+
Style/FetchEnvVar:
|
307
|
+
Enabled: true
|
308
|
+
|
309
|
+
Style/FileRead:
|
310
|
+
Enabled: true
|
311
|
+
|
312
|
+
Style/FileWrite:
|
313
|
+
Enabled: true
|
314
|
+
|
96
315
|
Style/GlobalStdStream:
|
97
316
|
Enabled: true
|
98
317
|
|
99
318
|
Style/HashAsLastArrayItem:
|
100
319
|
Enabled: true
|
101
320
|
|
321
|
+
Style/HashConversion:
|
322
|
+
Enabled: true
|
323
|
+
|
102
324
|
Style/HashEachMethods:
|
103
325
|
Enabled: true
|
104
326
|
|
327
|
+
Style/HashExcept:
|
328
|
+
Enabled: true
|
329
|
+
|
105
330
|
Style/HashLikeCase:
|
106
331
|
Enabled: true
|
107
332
|
|
@@ -111,21 +336,87 @@ Style/HashTransformKeys:
|
|
111
336
|
Style/HashTransformValues:
|
112
337
|
Enabled: true
|
113
338
|
|
339
|
+
Style/IfWithBooleanLiteralBranches:
|
340
|
+
Enabled: true
|
341
|
+
|
342
|
+
Style/InPatternThen:
|
343
|
+
Enabled: true
|
344
|
+
|
114
345
|
Style/KeywordParametersOrder:
|
115
346
|
Enabled: true
|
116
347
|
|
348
|
+
Style/MagicCommentFormat:
|
349
|
+
Enabled: true
|
350
|
+
|
351
|
+
Style/MapCompactWithConditionalBlock:
|
352
|
+
Enabled: true
|
353
|
+
|
354
|
+
Style/MapToHash:
|
355
|
+
Enabled: true
|
356
|
+
|
357
|
+
Style/MapToSet:
|
358
|
+
Enabled: true
|
359
|
+
|
360
|
+
Style/MinMaxComparison:
|
361
|
+
Enabled: true
|
362
|
+
|
363
|
+
Style/MultilineInPatternThen:
|
364
|
+
Enabled: true
|
365
|
+
|
366
|
+
Style/NegatedIfElseCondition:
|
367
|
+
Enabled: true
|
368
|
+
|
369
|
+
Style/NestedFileDirname:
|
370
|
+
Enabled: true
|
371
|
+
|
372
|
+
Style/NilLambda:
|
373
|
+
Enabled: true
|
374
|
+
|
375
|
+
Style/NumberedParameters:
|
376
|
+
Enabled: true
|
377
|
+
|
378
|
+
Style/NumberedParametersLimit:
|
379
|
+
Enabled: true
|
380
|
+
|
381
|
+
Style/ObjectThen:
|
382
|
+
Enabled: true
|
383
|
+
|
384
|
+
Style/OpenStructUse:
|
385
|
+
Enabled: true
|
386
|
+
|
387
|
+
Style/OperatorMethodCall:
|
388
|
+
Enabled: true
|
389
|
+
|
117
390
|
Style/OptionalBooleanParameter:
|
118
391
|
Enabled: true
|
119
392
|
|
393
|
+
Style/QuotedSymbols:
|
394
|
+
Enabled: true
|
395
|
+
|
396
|
+
Style/RedundantArgument:
|
397
|
+
Enabled: true
|
398
|
+
|
120
399
|
Style/RedundantAssignment:
|
121
400
|
Enabled: true
|
122
401
|
|
402
|
+
Style/RedundantConstantBase:
|
403
|
+
Enabled: true
|
404
|
+
|
405
|
+
Style/RedundantDoubleSplatHashBraces:
|
406
|
+
Enabled: true
|
407
|
+
|
408
|
+
Style/RedundantEach:
|
409
|
+
Enabled: true
|
410
|
+
|
123
411
|
Style/RedundantFetchBlock:
|
124
412
|
Enabled: true
|
125
413
|
|
126
414
|
Style/RedundantFileExtensionInRequire:
|
127
415
|
Enabled: true
|
128
416
|
|
417
|
+
Style/RedundantInitialize:
|
418
|
+
Enabled: true
|
419
|
+
|
129
420
|
Style/RedundantRegexpCharacterClass:
|
130
421
|
Enabled: true
|
131
422
|
|
@@ -135,6 +426,15 @@ Style/RedundantRegexpEscape:
|
|
135
426
|
Style/RedundantSelfAssignment:
|
136
427
|
Enabled: true
|
137
428
|
|
429
|
+
Style/RedundantSelfAssignmentBranch:
|
430
|
+
Enabled: true
|
431
|
+
|
432
|
+
Style/RedundantStringEscape:
|
433
|
+
Enabled: true
|
434
|
+
|
435
|
+
Style/SelectByRegexp:
|
436
|
+
Enabled: true
|
437
|
+
|
138
438
|
Style/SingleArgumentDig:
|
139
439
|
Enabled: true
|
140
440
|
|
@@ -144,5 +444,14 @@ Style/SlicingWithRange:
|
|
144
444
|
Style/SoleNestedConditional:
|
145
445
|
Enabled: true
|
146
446
|
|
447
|
+
Style/StringChars:
|
448
|
+
Enabled: true
|
449
|
+
|
147
450
|
Style/StringConcatenation:
|
148
451
|
Enabled: true
|
452
|
+
|
453
|
+
Style/SwapValues:
|
454
|
+
Enabled: true
|
455
|
+
|
456
|
+
Style/YodaExpression:
|
457
|
+
Enabled: true
|
data/Gemfile
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
source
|
3
|
+
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gemspec
|
6
6
|
|
7
7
|
group :development do
|
8
|
-
gem
|
9
|
-
gem
|
10
|
-
gem
|
11
|
-
gem
|
8
|
+
gem "minitest"
|
9
|
+
gem "rake"
|
10
|
+
gem "rubocop"
|
11
|
+
gem "rubocop-minitest", require: false
|
12
|
+
gem "rubocop-rake", require: false
|
13
|
+
gem "simplecov", "< 0.18"
|
12
14
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,40 +1,45 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruboclean (0.
|
4
|
+
ruboclean (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
10
|
-
docile (1.
|
11
|
-
json (2.3
|
12
|
-
minitest (5.
|
13
|
-
parallel (1.
|
14
|
-
parser (2.
|
9
|
+
ast (2.4.2)
|
10
|
+
docile (1.4.0)
|
11
|
+
json (2.6.3)
|
12
|
+
minitest (5.17.0)
|
13
|
+
parallel (1.22.1)
|
14
|
+
parser (3.2.0.0)
|
15
15
|
ast (~> 2.4.1)
|
16
|
-
rainbow (3.
|
17
|
-
rake (13.0.
|
18
|
-
regexp_parser (
|
19
|
-
rexml (3.2.
|
20
|
-
rubocop (
|
16
|
+
rainbow (3.1.1)
|
17
|
+
rake (13.0.6)
|
18
|
+
regexp_parser (2.6.1)
|
19
|
+
rexml (3.2.5)
|
20
|
+
rubocop (1.42.0)
|
21
|
+
json (~> 2.3)
|
21
22
|
parallel (~> 1.10)
|
22
|
-
parser (>= 2.
|
23
|
+
parser (>= 3.1.2.1)
|
23
24
|
rainbow (>= 2.2.2, < 4.0)
|
24
|
-
regexp_parser (>= 1.
|
25
|
-
rexml
|
26
|
-
rubocop-ast (>=
|
25
|
+
regexp_parser (>= 1.8, < 3.0)
|
26
|
+
rexml (>= 3.2.5, < 4.0)
|
27
|
+
rubocop-ast (>= 1.24.1, < 2.0)
|
27
28
|
ruby-progressbar (~> 1.7)
|
28
|
-
unicode-display_width (>= 1.4.0, <
|
29
|
-
rubocop-ast (
|
30
|
-
parser (>=
|
31
|
-
|
29
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
30
|
+
rubocop-ast (1.24.1)
|
31
|
+
parser (>= 3.1.1.0)
|
32
|
+
rubocop-minitest (0.25.1)
|
33
|
+
rubocop (>= 0.90, < 2.0)
|
34
|
+
rubocop-rake (0.6.0)
|
35
|
+
rubocop (~> 1.0)
|
36
|
+
ruby-progressbar (1.11.0)
|
32
37
|
simplecov (0.17.1)
|
33
38
|
docile (~> 1.1)
|
34
39
|
json (>= 1.8, < 3)
|
35
40
|
simplecov-html (~> 0.10.0)
|
36
41
|
simplecov-html (0.10.2)
|
37
|
-
unicode-display_width (
|
42
|
+
unicode-display_width (2.4.1)
|
38
43
|
|
39
44
|
PLATFORMS
|
40
45
|
ruby
|
@@ -44,7 +49,9 @@ DEPENDENCIES
|
|
44
49
|
rake
|
45
50
|
ruboclean!
|
46
51
|
rubocop
|
52
|
+
rubocop-minitest
|
53
|
+
rubocop-rake
|
47
54
|
simplecov (< 0.18)
|
48
55
|
|
49
56
|
BUNDLED WITH
|
50
|
-
2.
|
57
|
+
2.4.2
|
data/Rakefile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
5
|
|
6
6
|
Rake::TestTask.new(:test) do |t|
|
7
|
-
t.libs <<
|
8
|
-
t.libs <<
|
9
|
-
t.test_files = FileList[
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
10
10
|
end
|
11
11
|
|
12
12
|
task default: :test
|
data/bin/console
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
# frozen_string_literal: true
|
4
4
|
|
5
|
-
require
|
6
|
-
require
|
5
|
+
require "bundler/setup"
|
6
|
+
require "ruboclean"
|
7
7
|
|
8
8
|
# You can add fixtures and/or initialization code here to make experimenting
|
9
9
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -12,5 +12,5 @@ require 'ruboclean'
|
|
12
12
|
# require 'pry'
|
13
13
|
# Pry.start
|
14
14
|
|
15
|
-
require
|
15
|
+
require "irb"
|
16
16
|
IRB.start(__FILE__)
|
data/bin/ruboclean
CHANGED
data/bin/test
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
# frozen_string_literal: true
|
4
4
|
|
5
|
-
require
|
5
|
+
require "fileutils"
|
6
6
|
|
7
7
|
# Runs all tests and linters
|
8
8
|
class BinTest
|
9
9
|
include FileUtils
|
10
10
|
|
11
|
-
APP_ROOT = File.expand_path(
|
11
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
12
12
|
|
13
13
|
def system!(*args)
|
14
14
|
system(*args) || abort("\n== Command #{args} failed ==")
|
@@ -17,10 +17,10 @@ class BinTest
|
|
17
17
|
def run
|
18
18
|
chdir APP_ROOT do
|
19
19
|
puts "\n== Run tests =="
|
20
|
-
system!
|
20
|
+
system! "bundle exec rake test"
|
21
21
|
|
22
22
|
puts "\n== Run rubocop =="
|
23
|
-
system!
|
23
|
+
system! "bundle exec rubocop -p"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/ruboclean/grouper.rb
CHANGED
@@ -14,7 +14,7 @@ module Ruboclean
|
|
14
14
|
@config_hash.each_with_object(empty_groups) do |item, result|
|
15
15
|
key, value = item
|
16
16
|
target_group = find_target_group(key)
|
17
|
-
result[target_group].merge!
|
17
|
+
result[target_group].merge!({ key => value })
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -26,7 +26,7 @@ module Ruboclean
|
|
26
26
|
|
27
27
|
def find_target_group(key)
|
28
28
|
return :base if key.start_with?(/[a-z]/)
|
29
|
-
return :cops if key.include?(
|
29
|
+
return :cops if key.include?("/")
|
30
30
|
|
31
31
|
:namespaces
|
32
32
|
end
|
data/lib/ruboclean/orderer.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "pathname"
|
4
|
+
require "yaml"
|
5
5
|
|
6
6
|
module Ruboclean
|
7
7
|
# Interface for reading and writing the `.rubocop.yml` file
|
8
8
|
class RubocopConfigurationPath
|
9
|
+
PERMITTED_CLASSED = [Regexp].freeze
|
10
|
+
|
9
11
|
# Thrown if given path is invalid
|
10
12
|
class InvalidPathError < StandardError
|
11
13
|
def initialize(path)
|
@@ -17,7 +19,7 @@ module Ruboclean
|
|
17
19
|
input_path = Pathname.new(path)
|
18
20
|
|
19
21
|
@rubocop_configuration_path = if input_path.directory?
|
20
|
-
input_path.join(
|
22
|
+
input_path.join(".rubocop.yml")
|
21
23
|
else
|
22
24
|
input_path
|
23
25
|
end
|
@@ -41,7 +43,7 @@ module Ruboclean
|
|
41
43
|
end
|
42
44
|
|
43
45
|
def load_yaml
|
44
|
-
YAML.safe_load(@rubocop_configuration_path.read)
|
46
|
+
YAML.safe_load(@rubocop_configuration_path.read, permitted_classes: PERMITTED_CLASSED)
|
45
47
|
end
|
46
48
|
end
|
47
49
|
end
|
data/lib/ruboclean/version.rb
CHANGED
data/lib/ruboclean.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
3
|
+
require "ruboclean/version"
|
4
|
+
require "ruboclean/rubocop_configuration"
|
5
|
+
require "ruboclean/rubocop_configuration_path"
|
6
|
+
require "ruboclean/orderer"
|
7
7
|
|
8
8
|
# Ruboclean entry point
|
9
9
|
module Ruboclean
|
data/ruboclean.gemspec
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "lib/ruboclean/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
6
|
+
spec.name = "ruboclean"
|
7
7
|
spec.version = Ruboclean::VERSION
|
8
|
-
spec.authors = [
|
9
|
-
spec.email = [
|
8
|
+
spec.authors = ["lxxxvi"]
|
9
|
+
spec.email = ["lxxxvi@users.noreply.github.com"]
|
10
10
|
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new(
|
11
|
+
spec.summary = "Cleans and orders settings in .rubocop.yml"
|
12
|
+
spec.description = "Cleans and orders settings in .rubocop.yml"
|
13
|
+
spec.homepage = "https://github.com/lxxxvi/ruboclean"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
16
16
|
|
17
|
-
spec.metadata[
|
18
|
-
spec.metadata[
|
19
|
-
spec.metadata[
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://github.com/lxxxvi/ruboclean"
|
19
|
+
spec.metadata["changelog_uri"] = "https://github.com/lxxxvi/ruboclean/blob/master/CHANGELOG.md"
|
20
20
|
|
21
21
|
# Specify which files should be added to the gem when it is released.
|
22
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
25
|
end
|
26
26
|
|
27
|
-
spec.executables <<
|
28
|
-
spec.require_paths = [
|
27
|
+
spec.executables << "ruboclean"
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
29
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboclean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lxxxvi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Cleans and orders settings in .rubocop.yml
|
14
14
|
email:
|
@@ -45,6 +45,7 @@ metadata:
|
|
45
45
|
homepage_uri: https://github.com/lxxxvi/ruboclean
|
46
46
|
source_code_uri: https://github.com/lxxxvi/ruboclean
|
47
47
|
changelog_uri: https://github.com/lxxxvi/ruboclean/blob/master/CHANGELOG.md
|
48
|
+
rubygems_mfa_required: 'true'
|
48
49
|
post_install_message:
|
49
50
|
rdoc_options: []
|
50
51
|
require_paths:
|
@@ -60,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
61
|
- !ruby/object:Gem::Version
|
61
62
|
version: '0'
|
62
63
|
requirements: []
|
63
|
-
rubygems_version: 3.1
|
64
|
+
rubygems_version: 3.4.1
|
64
65
|
signing_key:
|
65
66
|
specification_version: 4
|
66
67
|
summary: Cleans and orders settings in .rubocop.yml
|