standard 0.4.6 → 0.6.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/test.yml +23 -0
- data/CHANGELOG.md +80 -1
- data/Gemfile.lock +24 -19
- data/README.md +6 -2
- data/config/base.yml +99 -17
- data/config/ruby-2.2.yml +1 -4
- data/config/ruby-2.3.yml +8 -0
- data/docs/RELEASE.md +39 -0
- data/lib/standard/creates_config_store/assigns_rubocop_yaml.rb +2 -0
- data/lib/standard/detects_fixability.rb +1 -5
- data/lib/standard/formatter.rb +14 -8
- data/lib/standard/version.rb +1 -1
- data/standard.gemspec +2 -2
- metadata +13 -11
- data/.circleci/config.yml +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf87b9f78b4f882b486a084515ef13cd503a152d0b5429c961a96f340c520f4e
|
4
|
+
data.tar.gz: 6205ac3fb9abf92a94f63e8875639b20e7cb476df7b212255e8544ecd12258ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a719a8f3674ea28666c1c466b68a9c5a81cbcbc7eaeb3c24e989a92b8a52d2de25a5cfd54715597e80901689d6063b463fa41627de523462f60c588b0149afd
|
7
|
+
data.tar.gz: 21a5507d0d533cac9eed1a243ba10cf946428f00b56e507f10ad6ce91ab6a2fd20658b792a423011fae3e75231d5a1e902a02a2a7cbca2dea2c6471eb259262f
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: 2.7
|
20
|
+
- name: Install dependencies
|
21
|
+
run: bundle
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rake
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,85 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.6.0
|
4
|
+
|
5
|
+
* Update Rubocop from
|
6
|
+
[0.89.1](https://github.com/rubocop-hq/rubocop/releases/tag/v0.89.1)
|
7
|
+
to
|
8
|
+
[0.90](https://github.com/rubocop-hq/rubocop/releases/tag/v0.90.0),
|
9
|
+
enabling:
|
10
|
+
* [`Style/KeywordParametersOrder`](https://github.com/rubocop-hq/rubocop/pull/8563)
|
11
|
+
* [`Lint/DuplicateRequire`](https://github.com/rubocop-hq/rubocop/pull/8474)
|
12
|
+
* [`Lint/TrailingCommaInAttributeDeclaration`](https://github.com/rubocop-hq/rubocop/pull/8549)
|
13
|
+
* Update [`Style/Alias` to prefer `alias_method`](https://github.com/testdouble/standard/pull/196)
|
14
|
+
* Update rubocop-performance from 1.7.1 to 1.8.0:
|
15
|
+
* Plan to enable [`Performance/Sum`](https://github.com/rubocop-hq/rubocop-performance/pull/137) in the future, but there is currently a bug in the implementation
|
16
|
+
* Add `ruby-2.3.yml` to add support for 2.3.
|
17
|
+
|
18
|
+
## 0.5.2
|
19
|
+
|
20
|
+
* Turned off `Lint/MissingSuper`, because it effectively bans a common idiom in
|
21
|
+
Sorbet ([#195](https://github.com/testdouble/standard/issues/195)) and might
|
22
|
+
be a bit too heavy-handed/opinionated for cases where a class is designed
|
23
|
+
intentionally to not run its parent's initializer (like abstract superclasses
|
24
|
+
more generally)
|
25
|
+
|
26
|
+
## 0.5.1
|
27
|
+
|
28
|
+
* Enabled `Style/MultilineWhenThen`
|
29
|
+
|
30
|
+
## 0.5.0
|
31
|
+
|
32
|
+
* Update Rubocop from
|
33
|
+
[0.85.0](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md#0850-2020-06-01)
|
34
|
+
to
|
35
|
+
[0.89.1](https://github.com/rubocop-hq/rubocop/releases/tag/v0.89.1),
|
36
|
+
enabling:
|
37
|
+
* `Lint/BinaryOperatorWithIdenticalOperands`
|
38
|
+
* `Lint/DuplicateElsifCondition`
|
39
|
+
* `Lint/DuplicateRescueException`
|
40
|
+
* `Lint/FloatComparison`
|
41
|
+
* `Lint/MissingSuper`
|
42
|
+
* `Lint/OutOfRangeRegexpRef`
|
43
|
+
* `Lint/RedundantRequireStatement`
|
44
|
+
* `Lint/RedundantSplatExpansion`
|
45
|
+
* `Lint/SafeNavigationWithEmpty`
|
46
|
+
* `Lint/SelfAssignment`
|
47
|
+
* `Lint/TopLevelReturnWithArgument`
|
48
|
+
* `Style/GlobalStdStream`
|
49
|
+
* `Style/RedundantAssignment`
|
50
|
+
* `Style/RedundantFetchBlock`
|
51
|
+
* `Style/RedundantFileExtensionInRequire`
|
52
|
+
* Update rubocop-performance from 1.6.0 to 1.7.1, enabling:
|
53
|
+
* `Performance/BigDecimalWithNumericArgument`
|
54
|
+
* `Performance/RedundantSortBlock`
|
55
|
+
* `Performance/RedundantStringChars`
|
56
|
+
* `Performance/ReverseFirst`
|
57
|
+
* `Performance/SortReverse`
|
58
|
+
* `Performance/Squeeze`
|
59
|
+
|
60
|
+
## 0.4.7
|
61
|
+
|
62
|
+
* Update Rubocop from
|
63
|
+
[0.83.0](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md#0830-2020-05-11)
|
64
|
+
to
|
65
|
+
[0.85.0](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md#0850-2020-06-01), notably:
|
66
|
+
|
67
|
+
* Enable
|
68
|
+
[Lint/MixedRegexpCaptureTypes](https://rubocop.readthedocs.io/en/stable/cops_lint/#lintmixedregexpcapturetypes)
|
69
|
+
* Enable
|
70
|
+
[Lint/DeprecatedOpenSSLConstant](https://rubocop.readthedocs.io/en/stable/cops_lint/#lintdeprecatedopensslconstant)
|
71
|
+
* Enable
|
72
|
+
[Style/RedundantRegexpCharacterClass](https://github.com/rubocop-hq/rubocop/pull/8055)
|
73
|
+
* Enable
|
74
|
+
[Style/RedundantRegexpEscape](https://github.com/rubocop-hq/rubocop/pull/7908)
|
75
|
+
* Update rubocop-performance to
|
76
|
+
[1.6.0](https://github.com/rubocop-hq/rubocop-performance/blob/master/CHANGELOG.md#160-2020-05-22),
|
77
|
+
enabling:
|
78
|
+
* [Performance/BindCall](https://github.com/rubocop-hq/rubocop-performance/issues/77)
|
79
|
+
* [Performance/DeletePrefix](https://github.com/rubocop-hq/rubocop-performance/pull/105)
|
80
|
+
* [Performance/DeleteSuffix](https://github.com/rubocop-hq/rubocop-performance/pull/105)
|
81
|
+
|
82
|
+
|
3
83
|
## 0.4.6
|
4
84
|
|
5
85
|
* Disable `Naming/BinaryOperatorParameterName` because (when non-ascii method
|
@@ -43,4 +123,3 @@
|
|
43
123
|
## 0.3.0
|
44
124
|
|
45
125
|
* Update Standard to track Rubocop 0.82.0 ([commit](https://github.com/testdouble/standard/commit/d663ea62d519c659087ad606bfed031c6303ff20))
|
46
|
-
|
data/Gemfile.lock
CHANGED
@@ -1,42 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
standard (0.
|
5
|
-
rubocop (~> 0.
|
6
|
-
rubocop-performance (~> 1.
|
4
|
+
standard (0.6.0)
|
5
|
+
rubocop (~> 0.90)
|
6
|
+
rubocop-performance (~> 1.8.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
ast (2.4.
|
12
|
-
coderay (1.1.
|
11
|
+
ast (2.4.1)
|
12
|
+
coderay (1.1.3)
|
13
13
|
docile (1.3.2)
|
14
14
|
gimme (0.5.0)
|
15
|
-
method_source (0.
|
16
|
-
minitest (5.14.
|
17
|
-
parallel (1.19.
|
18
|
-
parser (2.7.1.
|
19
|
-
ast (~> 2.4.
|
20
|
-
pry (0.
|
21
|
-
coderay (~> 1.1
|
22
|
-
method_source (~>
|
15
|
+
method_source (1.0.0)
|
16
|
+
minitest (5.14.2)
|
17
|
+
parallel (1.19.2)
|
18
|
+
parser (2.7.1.4)
|
19
|
+
ast (~> 2.4.1)
|
20
|
+
pry (0.13.1)
|
21
|
+
coderay (~> 1.1)
|
22
|
+
method_source (~> 1.0)
|
23
23
|
rainbow (3.0.0)
|
24
24
|
rake (13.0.1)
|
25
|
+
regexp_parser (1.7.1)
|
25
26
|
rexml (3.2.4)
|
26
|
-
rubocop (0.
|
27
|
+
rubocop (0.90.0)
|
27
28
|
parallel (~> 1.10)
|
28
|
-
parser (>= 2.7.
|
29
|
+
parser (>= 2.7.1.1)
|
29
30
|
rainbow (>= 2.2.2, < 4.0)
|
31
|
+
regexp_parser (>= 1.7)
|
30
32
|
rexml
|
33
|
+
rubocop-ast (>= 0.3.0, < 1.0)
|
31
34
|
ruby-progressbar (~> 1.7)
|
32
35
|
unicode-display_width (>= 1.4.0, < 2.0)
|
33
|
-
rubocop-
|
34
|
-
|
36
|
+
rubocop-ast (0.3.0)
|
37
|
+
parser (>= 2.7.1.4)
|
38
|
+
rubocop-performance (1.8.0)
|
39
|
+
rubocop (>= 0.87.0)
|
35
40
|
ruby-progressbar (1.10.1)
|
36
|
-
simplecov (0.
|
41
|
+
simplecov (0.19.0)
|
37
42
|
docile (~> 1.1)
|
38
43
|
simplecov-html (~> 0.11)
|
39
|
-
simplecov-html (0.12.
|
44
|
+
simplecov-html (0.12.2)
|
40
45
|
unicode-display_width (1.7.0)
|
41
46
|
|
42
47
|
PLATFORMS
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## Standard - Ruby style guide, linter, and formatter
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Tests](https://github.com/testdouble/standard/workflows/Tests/badge.svg)](https://github.com/testdouble/standard/actions?query=workflow%3ATests)
|
4
4
|
[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/standard.svg)](https://rubygems.org/gems/standard)
|
6
6
|
|
@@ -166,7 +166,7 @@ Because StandardRB is essentially a wrapper on top of
|
|
166
166
|
vast majority of CLI and ENV arguments to RuboCop.
|
167
167
|
|
168
168
|
You can see a list of
|
169
|
-
[RuboCop](https://docs.rubocop.org/
|
169
|
+
[RuboCop](https://docs.rubocop.org/rubocop/usage/basic_usage.html#command-line-flags)'s
|
170
170
|
CLI flags here.
|
171
171
|
|
172
172
|
## Why should I use Ruby Standard Style?
|
@@ -211,6 +211,10 @@ if you've used StandardJS.)
|
|
211
211
|
* [Level UP Solutions](https://levups.com)
|
212
212
|
* [Honeybadger](https://www.honeybadger.io)
|
213
213
|
* [Amazon Web Services](https://aws.amazon.com/)
|
214
|
+
* [Envoy](https://www.envoy.com)
|
215
|
+
* [myRent](https://www.myrent.co.nz)
|
216
|
+
* [Renuo](https://www.renuo.ch/)
|
217
|
+
* [JetThoughts](https://www.jetthoughts.com/)
|
214
218
|
* And that's about it so far!
|
215
219
|
|
216
220
|
If your team starts using Standard, [send a pull
|
data/config/base.yml
CHANGED
@@ -160,7 +160,6 @@ Layout/FirstHashElementIndentation:
|
|
160
160
|
|
161
161
|
Layout/HeredocIndentation:
|
162
162
|
Enabled: true
|
163
|
-
EnforcedStyle: squiggly
|
164
163
|
|
165
164
|
Layout/IndentationConsistency:
|
166
165
|
Enabled: true
|
@@ -327,6 +326,9 @@ Lint/AssignmentInCondition:
|
|
327
326
|
Lint/BigDecimalNew:
|
328
327
|
Enabled: true
|
329
328
|
|
329
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
330
|
+
Enabled: true
|
331
|
+
|
330
332
|
Lint/BooleanSymbol:
|
331
333
|
Enabled: true
|
332
334
|
|
@@ -339,15 +341,27 @@ Lint/Debugger:
|
|
339
341
|
Lint/DeprecatedClassMethods:
|
340
342
|
Enabled: true
|
341
343
|
|
344
|
+
Lint/DeprecatedOpenSSLConstant:
|
345
|
+
Enabled: true
|
346
|
+
|
342
347
|
Lint/DuplicateCaseCondition:
|
343
348
|
Enabled: true
|
344
349
|
|
345
|
-
Lint/
|
350
|
+
Lint/DuplicateElsifCondition:
|
346
351
|
Enabled: true
|
347
352
|
|
348
353
|
Lint/DuplicateHashKey:
|
349
354
|
Enabled: true
|
350
355
|
|
356
|
+
Lint/DuplicateMethods:
|
357
|
+
Enabled: true
|
358
|
+
|
359
|
+
Lint/DuplicateRequire:
|
360
|
+
Enabled: true
|
361
|
+
|
362
|
+
Lint/DuplicateRescueException:
|
363
|
+
Enabled: true
|
364
|
+
|
351
365
|
Lint/EachWithObjectArgument:
|
352
366
|
Enabled: true
|
353
367
|
|
@@ -377,6 +391,9 @@ Lint/ErbNewArguments:
|
|
377
391
|
Lint/FlipFlop:
|
378
392
|
Enabled: true
|
379
393
|
|
394
|
+
Lint/FloatComparison:
|
395
|
+
Enabled: true
|
396
|
+
|
380
397
|
Lint/FloatOutOfRange:
|
381
398
|
Enabled: true
|
382
399
|
|
@@ -409,6 +426,9 @@ Lint/MissingCopEnableDirective:
|
|
409
426
|
Enabled: true
|
410
427
|
MaximumRangeSize: .inf
|
411
428
|
|
429
|
+
Lint/MixedRegexpCaptureTypes:
|
430
|
+
Enabled: true
|
431
|
+
|
412
432
|
Lint/MultipleComparison:
|
413
433
|
Enabled: true
|
414
434
|
|
@@ -430,6 +450,9 @@ Lint/NonLocalExitFromIterator:
|
|
430
450
|
Lint/OrderedMagicComments:
|
431
451
|
Enabled: true
|
432
452
|
|
453
|
+
Lint/OutOfRangeRegexpRef:
|
454
|
+
Enabled: true
|
455
|
+
|
433
456
|
Lint/ParenthesesAsGroupedExpression:
|
434
457
|
Enabled: true
|
435
458
|
|
@@ -442,6 +465,12 @@ Lint/RaiseException:
|
|
442
465
|
Lint/RandOne:
|
443
466
|
Enabled: true
|
444
467
|
|
468
|
+
Lint/RedundantRequireStatement:
|
469
|
+
Enabled: true
|
470
|
+
|
471
|
+
Lint/RedundantSplatExpansion:
|
472
|
+
Enabled: true
|
473
|
+
|
445
474
|
Lint/RedundantStringCoercion:
|
446
475
|
Enabled: true
|
447
476
|
|
@@ -484,6 +513,12 @@ Lint/SafeNavigationConsistency:
|
|
484
513
|
- try
|
485
514
|
- try!
|
486
515
|
|
516
|
+
Lint/SafeNavigationWithEmpty:
|
517
|
+
Enabled: true
|
518
|
+
|
519
|
+
Lint/SelfAssignment:
|
520
|
+
Enabled: true
|
521
|
+
|
487
522
|
Lint/ShadowedArgument:
|
488
523
|
Enabled: true
|
489
524
|
IgnoreImplicitReferences: false
|
@@ -497,16 +532,16 @@ Layout/SpaceAroundMethodCallOperator:
|
|
497
532
|
Lint/Syntax:
|
498
533
|
Enabled: true
|
499
534
|
|
500
|
-
Lint/
|
535
|
+
Lint/TopLevelReturnWithArgument:
|
501
536
|
Enabled: true
|
502
537
|
|
503
|
-
Lint/
|
538
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
504
539
|
Enabled: true
|
505
540
|
|
506
|
-
Lint/
|
541
|
+
Lint/UnderscorePrefixedVariableName:
|
507
542
|
Enabled: true
|
508
543
|
|
509
|
-
Lint/
|
544
|
+
Lint/UnifiedInteger:
|
510
545
|
Enabled: true
|
511
546
|
|
512
547
|
Lint/UnreachableCode:
|
@@ -521,9 +556,6 @@ Lint/UriRegexp:
|
|
521
556
|
Lint/UselessAssignment:
|
522
557
|
Enabled: true
|
523
558
|
|
524
|
-
Lint/UselessComparison:
|
525
|
-
Enabled: true
|
526
|
-
|
527
559
|
Lint/UselessElseWithoutRescue:
|
528
560
|
Enabled: true
|
529
561
|
|
@@ -558,15 +590,30 @@ Naming/VariableName:
|
|
558
590
|
Enabled: true
|
559
591
|
EnforcedStyle: snake_case
|
560
592
|
|
593
|
+
Performance/BigDecimalWithNumericArgument:
|
594
|
+
Enabled: true
|
595
|
+
|
596
|
+
Performance/BindCall:
|
597
|
+
Enabled: true
|
598
|
+
|
561
599
|
Performance/Caller:
|
562
600
|
Enabled: true
|
563
601
|
|
602
|
+
Performance/CollectionLiteralInLoop:
|
603
|
+
Enabled: false
|
604
|
+
|
564
605
|
Performance/CompareWithBlock:
|
565
606
|
Enabled: true
|
566
607
|
|
567
608
|
Performance/Count:
|
568
609
|
Enabled: true
|
569
610
|
|
611
|
+
Performance/DeletePrefix:
|
612
|
+
Enabled: true
|
613
|
+
|
614
|
+
Performance/DeleteSuffix:
|
615
|
+
Enabled: true
|
616
|
+
|
570
617
|
Performance/Detect:
|
571
618
|
Enabled: true
|
572
619
|
|
@@ -576,8 +623,6 @@ Performance/DoubleStartEndWith:
|
|
576
623
|
|
577
624
|
Performance/EndWith:
|
578
625
|
Enabled: true
|
579
|
-
SafeAutoCorrect: false
|
580
|
-
AutoCorrect: false
|
581
626
|
|
582
627
|
Performance/FixedSize:
|
583
628
|
Enabled: true
|
@@ -601,23 +646,39 @@ Performance/RedundantMerge:
|
|
601
646
|
Enabled: true
|
602
647
|
MaxKeyValuePairs: 2
|
603
648
|
|
649
|
+
Performance/RedundantSortBlock:
|
650
|
+
Enabled: true
|
651
|
+
|
652
|
+
Performance/RedundantStringChars:
|
653
|
+
Enabled: true
|
654
|
+
|
604
655
|
Performance/RegexpMatch:
|
605
656
|
Enabled: true
|
606
657
|
|
607
658
|
Performance/ReverseEach:
|
608
659
|
Enabled: true
|
609
660
|
|
661
|
+
Performance/ReverseFirst:
|
662
|
+
Enabled: true
|
663
|
+
|
610
664
|
Performance/Size:
|
611
665
|
Enabled: true
|
612
666
|
|
667
|
+
Performance/SortReverse:
|
668
|
+
Enabled: true
|
669
|
+
|
670
|
+
Performance/Squeeze:
|
671
|
+
Enabled: true
|
672
|
+
|
613
673
|
Performance/StartWith:
|
614
674
|
Enabled: true
|
615
|
-
SafeAutoCorrect: false
|
616
|
-
AutoCorrect: false
|
617
675
|
|
618
676
|
Performance/StringReplacement:
|
619
677
|
Enabled: true
|
620
678
|
|
679
|
+
Performance/Sum:
|
680
|
+
Enabled: false
|
681
|
+
|
621
682
|
Performance/UnfreezeString:
|
622
683
|
Enabled: true
|
623
684
|
|
@@ -677,7 +738,7 @@ Standard/SemanticBlocks:
|
|
677
738
|
|
678
739
|
Style/Alias:
|
679
740
|
Enabled: true
|
680
|
-
EnforcedStyle:
|
741
|
+
EnforcedStyle: prefer_alias_method
|
681
742
|
|
682
743
|
Style/AndOr:
|
683
744
|
Enabled: true
|
@@ -775,6 +836,9 @@ Style/For:
|
|
775
836
|
Enabled: true
|
776
837
|
EnforcedStyle: each
|
777
838
|
|
839
|
+
Style/GlobalStdStream:
|
840
|
+
Enabled: true
|
841
|
+
|
778
842
|
Style/GlobalVars:
|
779
843
|
Enabled: true
|
780
844
|
AllowedVariables: []
|
@@ -799,6 +863,9 @@ Style/InfiniteLoop:
|
|
799
863
|
Enabled: true
|
800
864
|
SafeAutoCorrect: true
|
801
865
|
|
866
|
+
Style/KeywordParametersOrder:
|
867
|
+
Enabled: true
|
868
|
+
|
802
869
|
Style/LambdaCall:
|
803
870
|
Enabled: true
|
804
871
|
EnforcedStyle: call
|
@@ -811,9 +878,6 @@ Style/MethodCallWithoutArgsParentheses:
|
|
811
878
|
Enabled: true
|
812
879
|
IgnoredMethods: []
|
813
880
|
|
814
|
-
Style/MethodMissingSuper:
|
815
|
-
Enabled: true
|
816
|
-
|
817
881
|
Style/MissingRespondToMissing:
|
818
882
|
Enabled: true
|
819
883
|
|
@@ -834,6 +898,9 @@ Style/MultilineMemoization:
|
|
834
898
|
Enabled: true
|
835
899
|
EnforcedStyle: keyword
|
836
900
|
|
901
|
+
Style/MultilineWhenThen:
|
902
|
+
Enabled: true
|
903
|
+
|
837
904
|
Style/NegatedIf:
|
838
905
|
Enabled: true
|
839
906
|
EnforcedStyle: both
|
@@ -913,6 +980,9 @@ Style/Proc:
|
|
913
980
|
Style/RandomWithOffset:
|
914
981
|
Enabled: true
|
915
982
|
|
983
|
+
Style/RedundantAssignment:
|
984
|
+
Enabled: true
|
985
|
+
|
916
986
|
Style/RedundantBegin:
|
917
987
|
Enabled: true
|
918
988
|
|
@@ -922,12 +992,24 @@ Style/RedundantConditional:
|
|
922
992
|
Style/RedundantException:
|
923
993
|
Enabled: true
|
924
994
|
|
995
|
+
Style/RedundantFetchBlock:
|
996
|
+
Enabled: true
|
997
|
+
|
998
|
+
Style/RedundantFileExtensionInRequire:
|
999
|
+
Enabled: true
|
1000
|
+
|
925
1001
|
Style/RedundantFreeze:
|
926
1002
|
Enabled: true
|
927
1003
|
|
928
1004
|
Style/RedundantParentheses:
|
929
1005
|
Enabled: true
|
930
1006
|
|
1007
|
+
Style/RedundantRegexpCharacterClass:
|
1008
|
+
Enabled: true
|
1009
|
+
|
1010
|
+
Style/RedundantRegexpEscape:
|
1011
|
+
Enabled: true
|
1012
|
+
|
931
1013
|
Style/RedundantReturn:
|
932
1014
|
Enabled: true
|
933
1015
|
AllowMultipleReturnValues: false
|
data/config/ruby-2.2.yml
CHANGED
data/config/ruby-2.3.yml
ADDED
data/docs/RELEASE.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# How to release Standard Ruby
|
2
|
+
|
3
|
+
Because this gem was generated with the [bundler `gem`
|
4
|
+
command](https://bundler.io/man/bundle-gem.1.html), [our Rakefile](/Rakefile)
|
5
|
+
loads `bundler/gem_tasks`, which provides a lot of the commands one needs
|
6
|
+
to manage a gem's release lifecycle:
|
7
|
+
|
8
|
+
```
|
9
|
+
$ rake -T
|
10
|
+
rake build # Build standard-x.x.x.gem into the pkg directory
|
11
|
+
rake clean # Remove any temporary products
|
12
|
+
rake clobber # Remove any generated files
|
13
|
+
rake install # Build and install standard-x.x.x.gem into system gems
|
14
|
+
rake install:local # Build and install standard-x.x.x.gem into system gems without network access
|
15
|
+
rake release[remote] # Create tag vx.x.x and build and push standard-0.5.2.gem to rubygems.org
|
16
|
+
```
|
17
|
+
|
18
|
+
Most of these commands are depended on (read: run by) `rake release`, which is
|
19
|
+
really the only one we'll need for releasing the gem to
|
20
|
+
[Rubygems.org](https://rubygems.org/gems/standard).
|
21
|
+
|
22
|
+
## Release steps
|
23
|
+
|
24
|
+
1. Make sure git is up to date and `bundle exec rake` exits cleanly
|
25
|
+
2. Bump the appropriate version segment in `lib/standard/version.rb` (basic
|
26
|
+
semantic versioning rules apply; if the release updates Rubocop, follow its
|
27
|
+
version bump at a minimum—if rubocop saw minor bump, we'll also bump the
|
28
|
+
minor version)
|
29
|
+
3. Run `bundle` so that Bundler writes this version to `Gemfile.lock`
|
30
|
+
4. Update `CHANGELOG.md` as exhaustively as you are able and set the top header
|
31
|
+
to that of the new version
|
32
|
+
5. Commit `lib/standard/version.rb`, `Gemfile.lock`, and `CHANGELOG.md` together
|
33
|
+
with the message equal to the new version (e.g. "0.42.1")
|
34
|
+
6. Finally, run `bundle exec rake release`, which will hopefully succeed
|
35
|
+
7. Provide your multi-factor-auth token when prompted to finish publishing the
|
36
|
+
gem
|
37
|
+
8. [Tweet](https://twitter.com) about your awesome new release! (Shameless
|
38
|
+
self-promotion is the most important part of open source software)
|
39
|
+
|
@@ -3,7 +3,7 @@ module Standard
|
|
3
3
|
def call(offenses)
|
4
4
|
offenses.any? { |offense|
|
5
5
|
cop = cop_instance(offense.cop_name)
|
6
|
-
cop.
|
6
|
+
cop.correctable? && cop.safe_autocorrect?
|
7
7
|
}
|
8
8
|
end
|
9
9
|
|
@@ -12,9 +12,5 @@ module Standard
|
|
12
12
|
def cop_instance(cop_name)
|
13
13
|
RuboCop::Cop.const_get(cop_name.gsub("/", "::")).new
|
14
14
|
end
|
15
|
-
|
16
|
-
def safe?(cop)
|
17
|
-
cop.cop_config.fetch("SafeAutoCorrect", true)
|
18
|
-
end
|
19
15
|
end
|
20
16
|
end
|
data/lib/standard/formatter.rb
CHANGED
@@ -4,10 +4,20 @@ require_relative "detects_fixability"
|
|
4
4
|
|
5
5
|
module Standard
|
6
6
|
class Formatter < RuboCop::Formatter::BaseFormatter
|
7
|
-
|
7
|
+
STANDARD_GREETING = <<-MSG.gsub(/^ {6}/, "")
|
8
|
+
standard: Use Ruby Standard Style (https://github.com/testdouble/standard)
|
9
|
+
MSG
|
10
|
+
|
11
|
+
CALL_TO_ACTION_MESSAGE = <<-MSG.gsub(/^ {6}/, "")
|
8
12
|
Notice: Disagree with these rules? While StandardRB is pre-1.0.0, feel free to submit suggestions to:
|
9
13
|
https://github.com/testdouble/standard/issues/new
|
10
|
-
|
14
|
+
MSG
|
15
|
+
|
16
|
+
def self.fixable_error_message(command)
|
17
|
+
<<-MSG.gsub(/^ {8}/, "")
|
18
|
+
standard: Run `#{command}` to automatically fix some problems.
|
19
|
+
MSG
|
20
|
+
end
|
11
21
|
|
12
22
|
def initialize(*args)
|
13
23
|
super
|
@@ -42,9 +52,7 @@ module Standard
|
|
42
52
|
def print_header_once
|
43
53
|
return if @header_printed_already
|
44
54
|
|
45
|
-
output.print
|
46
|
-
standard: Use Ruby Standard Style (https://github.com/testdouble/standard)
|
47
|
-
HEADER
|
55
|
+
output.print STANDARD_GREETING
|
48
56
|
|
49
57
|
@header_printed_already = true
|
50
58
|
end
|
@@ -57,9 +65,7 @@ module Standard
|
|
57
65
|
"standardrb --fix"
|
58
66
|
end
|
59
67
|
|
60
|
-
output.print
|
61
|
-
standard: Run `#{command}` to automatically fix some problems.
|
62
|
-
HEADER
|
68
|
+
output.print self.class.fixable_error_message(command)
|
63
69
|
@fix_suggestion_printed_already = true
|
64
70
|
end
|
65
71
|
end
|
data/lib/standard/version.rb
CHANGED
data/standard.gemspec
CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "rubocop", "~> 0.
|
23
|
-
spec.add_dependency "rubocop-performance", "~> 1.
|
22
|
+
spec.add_dependency "rubocop", "~> 0.90"
|
23
|
+
spec.add_dependency "rubocop-performance", "~> 1.8.0"
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler"
|
26
26
|
spec.add_development_dependency "minitest", "~> 5.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Searls
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.90'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: '0.90'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rubocop-performance
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.8.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.8.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
-
description:
|
125
|
+
description:
|
126
126
|
email:
|
127
127
|
- searls@gmail.com
|
128
128
|
executables:
|
@@ -130,7 +130,7 @@ executables:
|
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
|
-
- ".
|
133
|
+
- ".github/workflows/test.yml"
|
134
134
|
- ".gitignore"
|
135
135
|
- ".standard.yml"
|
136
136
|
- CHANGELOG.md
|
@@ -145,6 +145,8 @@ files:
|
|
145
145
|
- config/ruby-1.8.yml
|
146
146
|
- config/ruby-1.9.yml
|
147
147
|
- config/ruby-2.2.yml
|
148
|
+
- config/ruby-2.3.yml
|
149
|
+
- docs/RELEASE.md
|
148
150
|
- exe/standardrb
|
149
151
|
- lib/standard.rb
|
150
152
|
- lib/standard/builds_config.rb
|
@@ -173,7 +175,7 @@ files:
|
|
173
175
|
homepage: https://github.com/testdouble/standard
|
174
176
|
licenses: []
|
175
177
|
metadata: {}
|
176
|
-
post_install_message:
|
178
|
+
post_install_message:
|
177
179
|
rdoc_options: []
|
178
180
|
require_paths:
|
179
181
|
- lib
|
@@ -189,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
191
|
version: '0'
|
190
192
|
requirements: []
|
191
193
|
rubygems_version: 3.1.2
|
192
|
-
signing_key:
|
194
|
+
signing_key:
|
193
195
|
specification_version: 4
|
194
196
|
summary: Ruby Style Guide, with linter & automatic code fixer
|
195
197
|
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
# Ruby CircleCI 2.0 configuration file
|
2
|
-
#
|
3
|
-
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
-
#
|
5
|
-
version: 2
|
6
|
-
jobs:
|
7
|
-
build:
|
8
|
-
docker:
|
9
|
-
- image: circleci/ruby:2.7.0-node-browsers
|
10
|
-
working_directory: ~/repo
|
11
|
-
|
12
|
-
steps:
|
13
|
-
- checkout
|
14
|
-
- restore_cache:
|
15
|
-
keys:
|
16
|
-
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
17
|
-
- v1-dependencies-
|
18
|
-
|
19
|
-
- run:
|
20
|
-
name: install dependencies
|
21
|
-
command: |
|
22
|
-
bundle update --bundler
|
23
|
-
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
24
|
-
|
25
|
-
- save_cache:
|
26
|
-
paths:
|
27
|
-
- ./vendor/bundle
|
28
|
-
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
29
|
-
|
30
|
-
- run:
|
31
|
-
name: test
|
32
|
-
command: bundle exec rake test
|
33
|
-
|
34
|
-
- run:
|
35
|
-
name: lint
|
36
|
-
command: bundle exec rake standard:fix
|