standard 0.4.7 → 0.5.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: a6d1ad0141d8e1460bb6001a586107ab181d96c61894c0ba199b4b902904679b
4
- data.tar.gz: f499489648c8a61ca1d64ae66a3f4dee1e82f64395ad5721bcab12a591348867
3
+ metadata.gz: 59c4fae3fd70f49e1adf75b0d405296751ba18c8a41df7fa538b6efa77214b5c
4
+ data.tar.gz: 73b864e4973762b2662880e4a0aa4f3c839794b1392a6160466947dd34f55529
5
5
  SHA512:
6
- metadata.gz: 05f1b00d3505eed59e18908cabc6ce19b9fc3e9ec2123bbf803d08695f66d74f9583d5fedd1b0bdad9161fc33956238613269ef86d4d271c6a75668e0d8a9087
7
- data.tar.gz: a8306c8a9b88354dbee59896e2b93c1db3c3cc7c1262e7c61157c884f4c69696b7447c083903f874d947d0c860d29b762a0c811b0a966d496916ae1b8f63d715
6
+ metadata.gz: facf91b5c424f7f6d6871131315fa705a7f8bf43a8c34d1b9d2e8de50ebc0ab5cd68eed98a20a22326e4de33eb41f41b42f82bda3905245214d343137e956cfd
7
+ data.tar.gz: 92d9eb12a61ffa3acd0a425e3ba11421699d513cab44b4e453cb6c2f1140d2e88efc42d8f9c06518e540510425af8a5f09dd7f540356e068e22f7cec62590724
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0
4
+
5
+ * Update Rubocop from
6
+ [0.85.0](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md#0850-2020-06-01)
7
+ to
8
+ [0.89.1](https://github.com/rubocop-hq/rubocop/releases/tag/v0.89.1),
9
+ enabling:
10
+ * `Lint/BinaryOperatorWithIdenticalOperands`
11
+ * `Lint/DuplicateElsifCondition`
12
+ * `Lint/DuplicateRescueException`
13
+ * `Lint/FloatComparison`
14
+ * `Lint/MissingSuper`
15
+ * `Lint/OutOfRangeRegexpRef`
16
+ * `Lint/RedundantRequireStatement`
17
+ * `Lint/RedundantSplatExpansion`
18
+ * `Lint/SafeNavigationWithEmpty`
19
+ * `Lint/SelfAssignment`
20
+ * `Lint/TopLevelReturnWithArgument`
21
+ * `Style/GlobalStdStream`
22
+ * `Style/RedundantAssignment`
23
+ * `Style/RedundantFetchBlock`
24
+ * `Style/RedundantFileExtensionInRequire`
25
+ * Update rubocop-performance from 1.6.0 to 1.7.1, enabling:
26
+ * `Performance/BigDecimalWithNumericArgument`
27
+ * `Performance/RedundantSortBlock`
28
+ * `Performance/RedundantStringChars`
29
+ * `Performance/ReverseFirst`
30
+ * `Performance/SortReverse`
31
+ * `Performance/Squeeze`
32
+
3
33
  ## 0.4.7
4
34
 
5
35
  * Update Rubocop from
@@ -1,42 +1,42 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard (0.4.7)
5
- rubocop (~> 0.85.0)
6
- rubocop-performance (~> 1.6.0)
4
+ standard (0.5.0)
5
+ rubocop (~> 0.89.1)
6
+ rubocop-performance (~> 1.7.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- ast (2.4.0)
11
+ ast (2.4.1)
12
12
  coderay (1.1.3)
13
13
  docile (1.3.2)
14
14
  gimme (0.5.0)
15
15
  method_source (1.0.0)
16
16
  minitest (5.14.1)
17
- parallel (1.19.1)
18
- parser (2.7.1.3)
19
- ast (~> 2.4.0)
17
+ parallel (1.19.2)
18
+ parser (2.7.1.4)
19
+ ast (~> 2.4.1)
20
20
  pry (0.13.1)
21
21
  coderay (~> 1.1)
22
22
  method_source (~> 1.0)
23
23
  rainbow (3.0.0)
24
24
  rake (13.0.1)
25
- regexp_parser (1.7.0)
25
+ regexp_parser (1.7.1)
26
26
  rexml (3.2.4)
27
- rubocop (0.85.0)
27
+ rubocop (0.89.1)
28
28
  parallel (~> 1.10)
29
- parser (>= 2.7.0.1)
29
+ parser (>= 2.7.1.1)
30
30
  rainbow (>= 2.2.2, < 4.0)
31
31
  regexp_parser (>= 1.7)
32
32
  rexml
33
- rubocop-ast (>= 0.0.3)
33
+ rubocop-ast (>= 0.3.0, < 1.0)
34
34
  ruby-progressbar (~> 1.7)
35
35
  unicode-display_width (>= 1.4.0, < 2.0)
36
- rubocop-ast (0.0.3)
37
- parser (>= 2.7.0.1)
38
- rubocop-performance (1.6.0)
39
- rubocop (>= 0.71.0)
36
+ rubocop-ast (0.3.0)
37
+ parser (>= 2.7.1.4)
38
+ rubocop-performance (1.7.1)
39
+ rubocop (>= 0.82.0)
40
40
  ruby-progressbar (1.10.1)
41
41
  simplecov (0.18.5)
42
42
  docile (~> 1.1)
data/README.md CHANGED
@@ -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/en/latest/basic_usage/#other-useful-command-line-flags)'s
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?
@@ -212,6 +212,9 @@ if you've used StandardJS.)
212
212
  * [Honeybadger](https://www.honeybadger.io)
213
213
  * [Amazon Web Services](https://aws.amazon.com/)
214
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/)
215
218
  * And that's about it so far!
216
219
 
217
220
  If your team starts using Standard, [send a pull
@@ -326,6 +326,9 @@ Lint/AssignmentInCondition:
326
326
  Lint/BigDecimalNew:
327
327
  Enabled: true
328
328
 
329
+ Lint/BinaryOperatorWithIdenticalOperands:
330
+ Enabled: true
331
+
329
332
  Lint/BooleanSymbol:
330
333
  Enabled: true
331
334
 
@@ -344,12 +347,18 @@ Lint/DeprecatedOpenSSLConstant:
344
347
  Lint/DuplicateCaseCondition:
345
348
  Enabled: true
346
349
 
350
+ Lint/DuplicateElsifCondition:
351
+ Enabled: true
352
+
347
353
  Lint/DuplicateMethods:
348
354
  Enabled: true
349
355
 
350
356
  Lint/DuplicateHashKey:
351
357
  Enabled: true
352
358
 
359
+ Lint/DuplicateRescueException:
360
+ Enabled: true
361
+
353
362
  Lint/EachWithObjectArgument:
354
363
  Enabled: true
355
364
 
@@ -379,6 +388,9 @@ Lint/ErbNewArguments:
379
388
  Lint/FlipFlop:
380
389
  Enabled: true
381
390
 
391
+ Lint/FloatComparison:
392
+ Enabled: true
393
+
382
394
  Lint/FloatOutOfRange:
383
395
  Enabled: true
384
396
 
@@ -411,6 +423,9 @@ Lint/MissingCopEnableDirective:
411
423
  Enabled: true
412
424
  MaximumRangeSize: .inf
413
425
 
426
+ Lint/MissingSuper:
427
+ Enabled: true
428
+
414
429
  Lint/MixedRegexpCaptureTypes:
415
430
  Enabled: true
416
431
 
@@ -435,6 +450,9 @@ Lint/NonLocalExitFromIterator:
435
450
  Lint/OrderedMagicComments:
436
451
  Enabled: true
437
452
 
453
+ Lint/OutOfRangeRegexpRef:
454
+ Enabled: true
455
+
438
456
  Lint/ParenthesesAsGroupedExpression:
439
457
  Enabled: true
440
458
 
@@ -447,6 +465,12 @@ Lint/RaiseException:
447
465
  Lint/RandOne:
448
466
  Enabled: true
449
467
 
468
+ Lint/RedundantRequireStatement:
469
+ Enabled: true
470
+
471
+ Lint/RedundantSplatExpansion:
472
+ Enabled: true
473
+
450
474
  Lint/RedundantStringCoercion:
451
475
  Enabled: true
452
476
 
@@ -489,6 +513,12 @@ Lint/SafeNavigationConsistency:
489
513
  - try
490
514
  - try!
491
515
 
516
+ Lint/SafeNavigationWithEmpty:
517
+ Enabled: true
518
+
519
+ Lint/SelfAssignment:
520
+ Enabled: true
521
+
492
522
  Lint/ShadowedArgument:
493
523
  Enabled: true
494
524
  IgnoreImplicitReferences: false
@@ -502,16 +532,13 @@ Layout/SpaceAroundMethodCallOperator:
502
532
  Lint/Syntax:
503
533
  Enabled: true
504
534
 
505
- Lint/UnderscorePrefixedVariableName:
506
- Enabled: true
507
-
508
- Lint/UnifiedInteger:
535
+ Lint/TopLevelReturnWithArgument:
509
536
  Enabled: true
510
537
 
511
- Lint/RedundantRequireStatement:
538
+ Lint/UnderscorePrefixedVariableName:
512
539
  Enabled: true
513
540
 
514
- Lint/RedundantSplatExpansion:
541
+ Lint/UnifiedInteger:
515
542
  Enabled: true
516
543
 
517
544
  Lint/UnreachableCode:
@@ -526,9 +553,6 @@ Lint/UriRegexp:
526
553
  Lint/UselessAssignment:
527
554
  Enabled: true
528
555
 
529
- Lint/UselessComparison:
530
- Enabled: true
531
-
532
556
  Lint/UselessElseWithoutRescue:
533
557
  Enabled: true
534
558
 
@@ -563,6 +587,9 @@ Naming/VariableName:
563
587
  Enabled: true
564
588
  EnforcedStyle: snake_case
565
589
 
590
+ Performance/BigDecimalWithNumericArgument:
591
+ Enabled: true
592
+
566
593
  Performance/BindCall:
567
594
  Enabled: true
568
595
 
@@ -613,15 +640,30 @@ Performance/RedundantMerge:
613
640
  Enabled: true
614
641
  MaxKeyValuePairs: 2
615
642
 
643
+ Performance/RedundantSortBlock:
644
+ Enabled: true
645
+
646
+ Performance/RedundantStringChars:
647
+ Enabled: true
648
+
616
649
  Performance/RegexpMatch:
617
650
  Enabled: true
618
651
 
619
652
  Performance/ReverseEach:
620
653
  Enabled: true
621
654
 
655
+ Performance/ReverseFirst:
656
+ Enabled: true
657
+
622
658
  Performance/Size:
623
659
  Enabled: true
624
660
 
661
+ Performance/SortReverse:
662
+ Enabled: true
663
+
664
+ Performance/Squeeze:
665
+ Enabled: true
666
+
625
667
  Performance/StartWith:
626
668
  Enabled: true
627
669
 
@@ -785,6 +827,9 @@ Style/For:
785
827
  Enabled: true
786
828
  EnforcedStyle: each
787
829
 
830
+ Style/GlobalStdStream:
831
+ Enabled: true
832
+
788
833
  Style/GlobalVars:
789
834
  Enabled: true
790
835
  AllowedVariables: []
@@ -821,9 +866,6 @@ Style/MethodCallWithoutArgsParentheses:
821
866
  Enabled: true
822
867
  IgnoredMethods: []
823
868
 
824
- Style/MethodMissingSuper:
825
- Enabled: true
826
-
827
869
  Style/MissingRespondToMissing:
828
870
  Enabled: true
829
871
 
@@ -923,6 +965,9 @@ Style/Proc:
923
965
  Style/RandomWithOffset:
924
966
  Enabled: true
925
967
 
968
+ Style/RedundantAssignment:
969
+ Enabled: true
970
+
926
971
  Style/RedundantBegin:
927
972
  Enabled: true
928
973
 
@@ -932,6 +977,12 @@ Style/RedundantConditional:
932
977
  Style/RedundantException:
933
978
  Enabled: true
934
979
 
980
+ Style/RedundantFetchBlock:
981
+ Enabled: true
982
+
983
+ Style/RedundantFileExtensionInRequire:
984
+ Enabled: true
985
+
935
986
  Style/RedundantFreeze:
936
987
  Enabled: true
937
988
 
@@ -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.support_autocorrect? && safe?(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
@@ -4,10 +4,20 @@ require_relative "detects_fixability"
4
4
 
5
5
  module Standard
6
6
  class Formatter < RuboCop::Formatter::BaseFormatter
7
- CALL_TO_ACTION_MESSAGE = <<-CALL_TO_ACTION.gsub(/^ {6}/, "")
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
- CALL_TO_ACTION
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 <<-HEADER.gsub(/^ {8}/, "")
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 <<-HEADER.gsub(/^ {10}/, "")
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
@@ -1,3 +1,3 @@
1
1
  module Standard
2
- VERSION = Gem::Version.new("0.4.7")
2
+ VERSION = Gem::Version.new("0.5.0")
3
3
  end
@@ -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.85.0"
23
- spec.add_dependency "rubocop-performance", "~> 1.6.0"
22
+ spec.add_dependency "rubocop", "~> 0.89.1"
23
+ spec.add_dependency "rubocop-performance", "~> 1.7.1"
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.7
4
+ version: 0.5.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-06-05 00:00:00.000000000 Z
11
+ date: 2020-08-22 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.85.0
19
+ version: 0.89.1
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.85.0
26
+ version: 0.89.1
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.6.0
33
+ version: 1.7.1
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.6.0
40
+ version: 1.7.1
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:
@@ -173,7 +173,7 @@ files:
173
173
  homepage: https://github.com/testdouble/standard
174
174
  licenses: []
175
175
  metadata: {}
176
- post_install_message:
176
+ post_install_message:
177
177
  rdoc_options: []
178
178
  require_paths:
179
179
  - lib
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  version: '0'
190
190
  requirements: []
191
191
  rubygems_version: 3.1.2
192
- signing_key:
192
+ signing_key:
193
193
  specification_version: 4
194
194
  summary: Ruby Style Guide, with linter & automatic code fixer
195
195
  test_files: []