standard 0.7 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14026854b2cf5526ea4da24fe417dbe375ce35b8be9d372719685adb2962e3a7
4
- data.tar.gz: 2ca105c020fcf869476e9791214ba47385e6cf3c4c86f4882a06ed8944a42ac3
3
+ metadata.gz: a2a3abdd7be25bbafbbb44f6f6920d077da4a1762190a0c2454b3acf9a3b5e74
4
+ data.tar.gz: 36bc5ad4555253f3b5890b388598b501212176cb861697c4849de575f32faf89
5
5
  SHA512:
6
- metadata.gz: 6c669d9ad8fe1add7fcefa8c27d8cac76a256d42cd116323d9fd4c5c96180d233e2b68e56588e44d0e879d1af628f50270766755c232342e89566989dea9193b
7
- data.tar.gz: bf99598e81dc303d00bd3a8a3bafc8bcabb7fdb67e5bc3836b6b43f2760910435f725ea60afa0a67a10558765102fbd1d8cb08833e530947cae5a59eb6496526
6
+ metadata.gz: 066fdef60be889c43532fb6d94fc9e5b468455d0bbabe51752009d448e3bd4ea51dbe47cf1e651d3487d48df5985f0c4db1073c9d658f5b28761f2499f805446
7
+ data.tar.gz: b58f7b5be9f3df9121a79bf98372a64184ab91a2540d6cf68275a8141fc31734b3bcc527ad86aac45a68079846b1112309fd3cf48194d61932b187b4395a6d7a
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.1
4
+
5
+ * remove [`Performance/ArraySemiInfiniteRangeSlice`](https://github.com/testdouble/standard/pull/225#discussion_r532678908)
6
+
7
+ ## 0.10.0
8
+
9
+ * Update rubocop-performance from 1.8.1 to [1.9.1](https://github.com/rubocop-hq/rubocop-performance/releases/tag/v1.9.1) enabling:
10
+ * [`Performance/BlockGivenWithExplicitBlock`](https://github.com/rubocop-hq/rubocop-performance/pull/173)
11
+ * [`Performance/ConstantRegexp`](https://github.com/rubocop-hq/rubocop-performance/pull/174)
12
+ * [`Performance/ArraySemiInfiniteRangeSlice`](https://github.com/rubocop-hq/rubocop-performance/pull/175)
13
+ * Update rubocop from 1.2.0 to [1.4.2](https://github.com/rubocop-hq/rubocop/releases/tag/v1.4.2) enabling:
14
+ * [`Style/NilLambda`](https://github.com/rubocop-hq/rubocop/pull/9020)
15
+ * [`Lint/DuplicateBranch`](https://github.com/rubocop-hq/rubocop/pull/8404)
16
+
17
+ ## 0.9.0
18
+
19
+ * Update rubocop from 1.0.0 to [1.2.0](https://github.com/rubocop-hq/rubocop/releases/tag/v1.2.0) enabling:
20
+ * [`Lint/DuplicateRegexpCharacterClassElement`](https://github.com/rubocop-hq/rubocop/pull/8896)
21
+ * [`Style/ArgumentsForwarding`](https://github.com/rubocop-hq/rubocop/pull/7646)
22
+ * Don't find offense in `Style/SemanticBlocks` when a top-level `rescue` is used
23
+ in a `do`/`end` functional block, fixing
24
+ [#205](https://github.com/testdouble/standard/issues/205)
25
+
26
+ ## 0.8.1
27
+
28
+ * Make it match semver
29
+
30
+ ## 0.8
31
+
32
+ * Update rubocop from 0.93.1 to [1.0.0](https://github.com/rubocop-hq/rubocop/releases/tag/v1.0.0)
33
+ * Update rubocop from 0.92 to
34
+ [0.93](https://github.com/rubocop-hq/rubocop/releases/tag/v0.93) to
35
+ [0.93.1](https://github.com/rubocop-hq/rubocop/releases/tag/v0.93.1) enabling:
36
+ * [`Style/ClassEqualityComparison`](https://github.com/rubocop-hq/rubocop/pull/8833)
37
+ * Disable `Performance/Sum` because #208 and the lack of actual auto-correcting is also causing more trouble
38
+
3
39
  ## 0.7
4
40
 
5
41
  * Update rubocop from 0.91.1 to
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard (0.7)
5
- rubocop (= 0.92)
6
- rubocop-performance (= 1.8.1)
4
+ standard (0.10.1)
5
+ rubocop (= 1.4.2)
6
+ rubocop-performance (= 1.9.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -14,29 +14,29 @@ GEM
14
14
  gimme (0.5.0)
15
15
  method_source (1.0.0)
16
16
  minitest (5.14.2)
17
- parallel (1.19.2)
18
- parser (2.7.1.5)
17
+ parallel (1.20.1)
18
+ parser (2.7.2.0)
19
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.8.0)
25
+ regexp_parser (2.0.0)
26
26
  rexml (3.2.4)
27
- rubocop (0.92.0)
27
+ rubocop (1.4.2)
28
28
  parallel (~> 1.10)
29
29
  parser (>= 2.7.1.5)
30
30
  rainbow (>= 2.2.2, < 4.0)
31
- regexp_parser (>= 1.7)
31
+ regexp_parser (>= 1.8)
32
32
  rexml
33
- rubocop-ast (>= 0.5.0)
33
+ rubocop-ast (>= 1.1.1)
34
34
  ruby-progressbar (~> 1.7)
35
35
  unicode-display_width (>= 1.4.0, < 2.0)
36
- rubocop-ast (0.5.0)
36
+ rubocop-ast (1.2.0)
37
37
  parser (>= 2.7.1.5)
38
- rubocop-performance (1.8.1)
39
- rubocop (>= 0.87.0)
38
+ rubocop-performance (1.9.1)
39
+ rubocop (>= 0.90.0, < 2.0)
40
40
  rubocop-ast (>= 0.4.0)
41
41
  ruby-progressbar (1.10.1)
42
42
  simplecov (0.19.0)
data/README.md CHANGED
@@ -384,6 +384,7 @@ Maybe! Start by searching the repository to see if there's an existing issue ope
384
384
  the tool you're interested in. That aside, here are other known integrations aside
385
385
  from editor plugins:
386
386
 
387
+ * [Code Climate](https://github.com/testdouble/standard/wiki/CI:-Code-Climate)
387
388
  * [Pronto](https://github.com/julianrubisch/pronto-standardrb)
388
389
  * [Spring](https://github.com/lakim/spring-commands-standard)
389
390
  * [Guard](https://github.com/JodyVanden/guard-standardrb)
@@ -56,10 +56,10 @@ Layout/BlockAlignment:
56
56
  Layout/BlockEndNewline:
57
57
  Enabled: true
58
58
 
59
- # Disabled because IndentOneStep can't be configured for one-liner cases. See:
60
- # https://github.com/rubocop-hq/rubocop/issues/6447
61
- # Layout/CaseIndentation:
62
- # Enabled: true
59
+ Layout/CaseIndentation:
60
+ # Disabled because IndentOneStep can't be configured for one-liner cases. See:
61
+ # https://github.com/rubocop-hq/rubocop/issues/6447
62
+ Enabled: false
63
63
 
64
64
  Layout/ClosingHeredocIndentation:
65
65
  Enabled: true
@@ -173,6 +173,10 @@ Layout/IndentationConsistency:
173
173
  Enabled: true
174
174
  EnforcedStyle: normal
175
175
 
176
+ Layout/IndentationStyle:
177
+ Enabled: true
178
+ IndentationWidth: ~
179
+
176
180
  Layout/IndentationWidth:
177
181
  Enabled: true
178
182
  Width: 2
@@ -181,10 +185,10 @@ Layout/IndentationWidth:
181
185
  Layout/InitialIndentation:
182
186
  Enabled: true
183
187
 
184
- Layout/LeadingEmptyLines:
188
+ Layout/LeadingCommentSpace:
185
189
  Enabled: true
186
190
 
187
- Layout/LeadingCommentSpace:
191
+ Layout/LeadingEmptyLines:
188
192
  Enabled: true
189
193
 
190
194
  Layout/MultilineArrayBraceLayout:
@@ -250,6 +254,9 @@ Layout/SpaceAroundEqualsInParameterDefault:
250
254
  Layout/SpaceAroundKeyword:
251
255
  Enabled: true
252
256
 
257
+ Layout/SpaceAroundMethodCallOperator:
258
+ Enabled: true
259
+
253
260
  Layout/SpaceAroundOperators:
254
261
  Enabled: true
255
262
  AllowForAlignment: true
@@ -314,10 +321,6 @@ Layout/SpaceInsideStringInterpolation:
314
321
  Enabled: true
315
322
  EnforcedStyle: no_space
316
323
 
317
- Layout/IndentationStyle:
318
- Enabled: true
319
- IndentationWidth: ~
320
-
321
324
  Layout/TrailingEmptyLines:
322
325
  Enabled: true
323
326
  EnforcedStyle: final_newline
@@ -360,6 +363,9 @@ Lint/DeprecatedClassMethods:
360
363
  Lint/DeprecatedOpenSSLConstant:
361
364
  Enabled: true
362
365
 
366
+ Lint/DuplicateBranch:
367
+ Enabled: true
368
+
363
369
  Lint/DuplicateCaseCondition:
364
370
  Enabled: true
365
371
 
@@ -372,6 +378,9 @@ Lint/DuplicateHashKey:
372
378
  Lint/DuplicateMethods:
373
379
  Enabled: true
374
380
 
381
+ Lint/DuplicateRegexpCharacterClassElement:
382
+ Enabled: true
383
+
375
384
  Lint/DuplicateRequire:
376
385
  Enabled: true
377
386
 
@@ -545,9 +554,6 @@ Lint/ShadowedArgument:
545
554
  Lint/ShadowedException:
546
555
  Enabled: true
547
556
 
548
- Layout/SpaceAroundMethodCallOperator:
549
- Enabled: true
550
-
551
557
  Lint/Syntax:
552
558
  Enabled: true
553
559
 
@@ -594,6 +600,13 @@ Migration/DepartmentName:
594
600
  Naming/BinaryOperatorParameterName:
595
601
  Enabled: true
596
602
 
603
+ Naming/BlockParameterName:
604
+ Enabled: true
605
+ MinNameLength: 1
606
+ AllowNamesEndingInNumbers: true
607
+ AllowedNames: []
608
+ ForbiddenNames: []
609
+
597
610
  Naming/ClassAndModuleCamelCase:
598
611
  Enabled: true
599
612
 
@@ -604,13 +617,6 @@ Naming/HeredocDelimiterCase:
604
617
  Enabled: true
605
618
  EnforcedStyle: uppercase
606
619
 
607
- Naming/BlockParameterName:
608
- Enabled: true
609
- MinNameLength: 1
610
- AllowNamesEndingInNumbers: true
611
- AllowedNames: []
612
- ForbiddenNames: []
613
-
614
620
  Naming/VariableName:
615
621
  Enabled: true
616
622
  EnforcedStyle: snake_case
@@ -621,6 +627,9 @@ Performance/BigDecimalWithNumericArgument:
621
627
  Performance/BindCall:
622
628
  Enabled: true
623
629
 
630
+ Performance/BlockGivenWithExplicitBlock:
631
+ Enabled: true
632
+
624
633
  Performance/Caller:
625
634
  Enabled: true
626
635
 
@@ -630,6 +639,9 @@ Performance/CollectionLiteralInLoop:
630
639
  Performance/CompareWithBlock:
631
640
  Enabled: true
632
641
 
642
+ Performance/ConstantRegexp:
643
+ Enabled: true
644
+
633
645
  Performance/Count:
634
646
  Enabled: true
635
647
 
@@ -701,10 +713,6 @@ Performance/StartWith:
701
713
  Performance/StringReplacement:
702
714
  Enabled: true
703
715
 
704
- Performance/Sum:
705
- Enabled: true
706
- AutoCorrect: true
707
-
708
716
  Performance/UnfreezeString:
709
717
  Enabled: true
710
718
 
@@ -727,7 +735,6 @@ Security/YAMLLoad:
727
735
  Enabled: true
728
736
  SafeAutoCorrect: false
729
737
 
730
-
731
738
  Standard/SemanticBlocks:
732
739
  ProceduralMethods:
733
740
  - benchmark
@@ -770,6 +777,10 @@ Style/AndOr:
770
777
  Enabled: true
771
778
  EnforcedStyle: always
772
779
 
780
+ Style/ArgumentsForwarding:
781
+ Enabled: true
782
+ AllowOnlyRestArgument: true
783
+
773
784
  Style/ArrayJoin:
774
785
  Enabled: true
775
786
 
@@ -793,6 +804,9 @@ Style/ClassCheck:
793
804
  Enabled: true
794
805
  EnforcedStyle: is_a?
795
806
 
807
+ Style/ClassEqualityComparison:
808
+ Enabled: true
809
+
796
810
  Style/ClassMethods:
797
811
  Enabled: true
798
812
 
@@ -887,7 +901,6 @@ Style/IfWithSemicolon:
887
901
 
888
902
  Style/InfiniteLoop:
889
903
  Enabled: true
890
- SafeAutoCorrect: true
891
904
 
892
905
  Style/KeywordParametersOrder:
893
906
  Enabled: true
@@ -965,6 +978,9 @@ Style/NilComparison:
965
978
  Enabled: true
966
979
  EnforcedStyle: predicate
967
980
 
981
+ Style/NilLambda:
982
+ Enabled: true
983
+
968
984
  Style/NonNilCheck:
969
985
  Enabled: true
970
986
  IncludeSemanticChanges: false
@@ -1012,6 +1028,9 @@ Style/RedundantAssignment:
1012
1028
  Style/RedundantBegin:
1013
1029
  Enabled: true
1014
1030
 
1031
+ Style/RedundantCondition:
1032
+ Enabled: true
1033
+
1015
1034
  Style/RedundantConditional:
1016
1035
  Enabled: true
1017
1036
 
@@ -1027,9 +1046,15 @@ Style/RedundantFileExtensionInRequire:
1027
1046
  Style/RedundantFreeze:
1028
1047
  Enabled: true
1029
1048
 
1049
+ Style/RedundantInterpolation:
1050
+ Enabled: true
1051
+
1030
1052
  Style/RedundantParentheses:
1031
1053
  Enabled: true
1032
1054
 
1055
+ Style/RedundantPercentQ:
1056
+ Enabled: true
1057
+
1033
1058
  Style/RedundantRegexpCharacterClass:
1034
1059
  Enabled: true
1035
1060
 
@@ -1043,6 +1068,9 @@ Style/RedundantReturn:
1043
1068
  Style/RedundantSelf:
1044
1069
  Enabled: true
1045
1070
 
1071
+ Style/RedundantSort:
1072
+ Enabled: true
1073
+
1046
1074
  Style/RedundantSortBy:
1047
1075
  Enabled: true
1048
1076
 
@@ -1159,18 +1187,6 @@ Style/TrivialAccessors:
1159
1187
  Style/UnlessElse:
1160
1188
  Enabled: true
1161
1189
 
1162
- Style/RedundantCondition:
1163
- Enabled: true
1164
-
1165
- Style/RedundantInterpolation:
1166
- Enabled: true
1167
-
1168
- Style/RedundantPercentQ:
1169
- Enabled: true
1170
-
1171
- Style/RedundantSort:
1172
- Enabled: true
1173
-
1174
1190
  Style/UnpackFirst:
1175
1191
  Enabled: true
1176
1192
 
@@ -1,8 +1,7 @@
1
1
  inherit_from: ./ruby-1.9.yml
2
2
 
3
- Style/Lambda:
4
- Enabled: false
5
-
6
3
  Style/HashSyntax:
7
4
  EnforcedStyle: hash_rockets
8
5
 
6
+ Style/Lambda:
7
+ Enabled: false
@@ -2,7 +2,3 @@ inherit_from: ./base.yml
2
2
 
3
3
  AllCops:
4
4
  TargetRubyVersion: 2.4 # The oldest supported
5
-
6
- Performance:
7
- Sum:
8
- Enabled: false
@@ -18,7 +18,9 @@ module RuboCop::Cop
18
18
  end
19
19
 
20
20
  def on_block(node)
21
- return if ignored_node?(node) || proper_block_style?(node)
21
+ return if ignored_node?(node) ||
22
+ proper_block_style?(node) ||
23
+ (!node.braces? && rescue_child_block?(node))
22
24
 
23
25
  add_offense(node, location: :begin)
24
26
  end
@@ -26,9 +28,7 @@ module RuboCop::Cop
26
28
  def autocorrect(node)
27
29
  return if correction_would_break_code?(node)
28
30
 
29
- if node.single_line?
30
- replace_do_end_with_braces(node.loc)
31
- elsif node.braces?
31
+ if node.braces?
32
32
  replace_braces_with_do_end(node.loc)
33
33
  else
34
34
  replace_do_end_with_braces(node.loc)
@@ -118,7 +118,7 @@ module RuboCop::Cop
118
118
  end
119
119
 
120
120
  def rescue_child_block?(node)
121
- node.children.any?(&:rescue_type?)
121
+ node.children.any? { |node| node.rescue_type? || node.ensure_type? }
122
122
  end
123
123
 
124
124
  def non_parenthesized_keyword_args?(node)
@@ -1,3 +1,3 @@
1
1
  module Standard
2
- VERSION = Gem::Version.new("0.7")
2
+ VERSION = Gem::Version.new("0.10.1")
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.92"
23
- spec.add_dependency "rubocop-performance", "1.8.1"
22
+ spec.add_dependency "rubocop", "1.4.2"
23
+ spec.add_dependency "rubocop-performance", "1.9.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.7'
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-25 00:00:00.000000000 Z
11
+ date: 2020-11-30 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.92'
19
+ version: 1.4.2
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.92'
26
+ version: 1.4.2
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.8.1
33
+ version: 1.9.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.8.1
40
+ version: 1.9.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.1.2
193
+ rubygems_version: 3.1.4
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: Ruby Style Guide, with linter & automatic code fixer