simplycop 1.12.23 → 1.13.0

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: fbc8fea3a5b127fa08a9d250016fd102b9a846290fef76953b2bf15b980f69f2
4
- data.tar.gz: ed171ab56435846964f89828447bf366e3a69254b25a85ed973e993e71bda264
3
+ metadata.gz: 7ae29a50f1ec1a006769ef247d908f9517b9c7e94f1d19ff0667b4533a2bf9b8
4
+ data.tar.gz: 2f2beda956c1d3a780b67999a4befd42f03f7adb58f12b7b899ef735e650882c
5
5
  SHA512:
6
- metadata.gz: 43943e46ce61242743dd098df0382c8a19478b85f44bb5508bd6bafe3b9095fbd6479f94c8017f066ea709c657f7aef3031c9ee76e159a5c372df7ee3d3b1e29
7
- data.tar.gz: f64ea04d619da3c8bedb46d2496bc4c086ea7e8be55ff2a47f497ec2a7c4bae8f49bb7425842d1c9464f3c091c5037656b4fc5369cfecfd0a65c6649edd5a52e
6
+ metadata.gz: 3b9e27c39b2d9b260fe973e85dfc683a2fd8ecf892dc741ded7c08e295114bbc7b95e9175a0fa478879a5f2781b06ad3fe281bde679c5b67e2e1ac897b60c3c8
7
+ data.tar.gz: dcf83bc15f5a8db3180df118b58f125a5e6529f3845d3f3f285fb0adc4bbaff68f0ce02a7166e2ed6c3309b5249f085b18f44f585a3b5f26761ba1fea9ca7a95
data/.simplycop.yml CHANGED
@@ -58,7 +58,7 @@ Gemspec/DuplicatedAssignment:
58
58
  Gemspec/OrderedDependencies:
59
59
  Enabled: true
60
60
 
61
- # TODO: Suggest true but 4 fails on Chopin, 3 on Rater
61
+ # TODO: Suggest true but 4 fails on Chopin, 3 on Rater, overridden to false on Chopin
62
62
  # Gemspec/RequireMFA:
63
63
  # Enabled: true
64
64
 
@@ -229,12 +229,15 @@ Layout/LeadingCommentSpace:
229
229
  Layout/LeadingEmptyLines:
230
230
  Enabled: true
231
231
 
232
+ # Overridden to false in Chopin
232
233
  Layout/LineContinuationLeadingSpace:
233
234
  Enabled: true
234
235
 
236
+ # Overridden to false in Chopin
235
237
  Layout/LineContinuationSpacing:
236
238
  Enabled: true
237
239
 
240
+ # Overridden to false in Chopin
238
241
  Layout/LineEndStringConcatenationIndentation:
239
242
  Enabled: true
240
243
 
@@ -390,9 +393,11 @@ Lint/AmbiguousBlockAssociation:
390
393
  Lint/AmbiguousOperator:
391
394
  Enabled: true
392
395
 
396
+ # Overridden to false in Chopin
393
397
  Lint/AmbiguousOperatorPrecedence:
394
398
  Enabled: true
395
399
 
400
+ # Overridden to false in Chopin
396
401
  Lint/AmbiguousRange:
397
402
  Enabled: true
398
403
 
@@ -584,6 +589,7 @@ Lint/NextWithoutAccumulator:
584
589
  Lint/NoReturnInBeginEndBlocks:
585
590
  Enabled: true
586
591
 
592
+ # Overridden to false in Chopin
587
593
  Lint/NonAtomicFileOperation:
588
594
  Enabled: true
589
595
 
@@ -665,6 +671,7 @@ Lint/RequireParentheses:
665
671
  Lint/RequireRangeParentheses:
666
672
  Enabled: true
667
673
 
674
+ # Overridden to false in Chopin
668
675
  Lint/RequireRelativeSelfPath:
669
676
  Enabled: true
670
677
 
@@ -790,55 +797,46 @@ Lint/UselessTimes:
790
797
  Lint/Void:
791
798
  Enabled: true
792
799
 
793
- # To discuss. Suggest enabling with suitable max and progressively lower.
794
- # Chopin currently set at 91. Couldn't be lowered much. 671 fails at default of 17.
795
- # Rater currently set at 83. Looks like it could be lowered to c. 40. 111 fails at default of 17.
796
- # 54 fails in CoCo
797
- # Metrics/AbcSize:
798
- # Max: tbc
800
+ # METRICS COPS
801
+
802
+ # Metrics cops are enabled by default with the expectation that many repos will
803
+ # have to set their own limits or disable. #technical-excellence-community discussion
804
+ # suggested some liked to work from them, and that overriding should be a conscious decision
805
+
806
+ Metrics/AbcSize:
807
+ Enabled: true
799
808
 
800
- # To discuss. Keep current exclusion as below but decide on suitable max. Still currently needs many overrides.
801
- # At default of 25, 269 fails on Chopin, 10584 on Rater, 18 on CoCo.
802
809
  Metrics/BlockLength:
810
+ Enabled: true
803
811
  Exclude:
804
812
  - spec/**/*.rb
805
813
 
806
814
  Metrics/BlockNesting:
807
815
  Enabled: true
808
816
 
809
- # To discuss: set new max? Chopin has one class - rfq - at 554. Exclude and set lower max for elsewhere?
810
- # CoCo 8 fails at > 100. Max 225. Rater OK
811
817
  Metrics/ClassLength:
812
- Max: 512
818
+ Enabled: true
813
819
 
814
820
  Metrics/CollectionLiteralLength:
815
821
  Enabled: true
816
822
 
817
- # Chopin 31 fails at > 7. Max 18.
818
- # Rater 11 at > 7. Max 21
819
- # CoCo 9 at > 7. Max 13
820
- # Set at 21 to prevent further growth. Discuss setting lower.
821
823
  Metrics/CyclomaticComplexity:
822
- Max: 21
824
+ Enabled: true
823
825
 
824
- # To discuss. Chopin 1541 fails at > 10, max 118; Rater 330, max 25 with exclusions; CoCo 87, max 51
825
- # Metrics/MethodLength:
826
- # Max: tbc
826
+ Metrics/MethodLength:
827
+ Enabled: true
828
+ Exclude:
829
+ - spec/**/*.rb
827
830
 
828
- # To discuss. Chopin 22 fails at > 100, max 1521; Rater 31, max 370; CoCo 2, max 160
829
- # Metrics/ModuleLength:
830
- # Max: tbc
831
+ Metrics/ModuleLength:
832
+ Enabled: true
831
833
 
832
834
  Metrics/ParameterLists:
833
835
  CountKeywordArgs: false
834
836
  Enabled: true
835
837
 
836
- # Chopin 15 fails at > 8. Max 19.
837
- # Rater 9 at > 8. Max 21
838
- # CoCo 5 at > 8. Max 13
839
- # Set at 21 to prevent further growth. Discuss setting lower.
840
838
  Metrics/PerceivedComplexity:
841
- Max: 21
839
+ Enabled: true
842
840
 
843
841
  Migration/DepartmentName:
844
842
  Enabled: true
@@ -884,13 +882,15 @@ Naming/InclusiveLanguage:
884
882
  Naming/MethodName:
885
883
  Enabled: true
886
884
 
887
- # To discuss: suggest true with possible allowed exceptions as below (10 fails on Chopin, exceptions would allow 4)
885
+ # To discuss: suggest true with possible allowed exceptions as below (10 fails on Chopin, exceptions would allow 4,
886
+ # as and to are already exceptions in Rater so would remove need to configure there)
888
887
  # Naming/MethodParameterName:
889
888
  # Enabled: true
890
889
  # AllowedNames:
891
- # - e
890
+ # - as
892
891
  # - ex
893
892
  # - n
893
+ # - to
894
894
 
895
895
  # To discuss: suggest true but 52 fails in Chopin, 8 in Coco (consider with Naming/AccessorName)
896
896
  # Naming/PredicateName:
@@ -909,6 +909,7 @@ Naming/VariableName:
909
909
  # Enabled: true
910
910
  # EnforcedStyle: snake_case
911
911
 
912
+ # Overridden to false in Chopin
912
913
  Security/CompoundHash:
913
914
  Enabled: true
914
915
 
@@ -916,6 +917,7 @@ Security/CompoundHash:
916
917
  # Security/Eval:
917
918
  # Enabled: true
918
919
 
920
+ # Overridden to false on Chopin
919
921
  Security/IoMethods:
920
922
  Enabled: true
921
923
 
@@ -951,6 +953,7 @@ Style/ArgumentsForwarding:
951
953
  Style/ArrayCoercion:
952
954
  Enabled: true
953
955
 
956
+ # Overridden to false in Chopin
954
957
  Style/ArrayIntersect:
955
958
  Enabled: true
956
959
 
@@ -959,7 +962,9 @@ Style/ArrayJoin:
959
962
 
960
963
  Style/AsciiComments:
961
964
  Enabled: true
962
- AllowedChars: [£, ©]
965
+ AllowedChars:
966
+ - £
967
+ - ©
963
968
 
964
969
  Style/Attr:
965
970
  Enabled: true
@@ -1037,8 +1042,8 @@ Style/CommentedKeyword:
1037
1042
  Enabled: true
1038
1043
 
1039
1044
  # TODO: Single fail on Rater
1040
- # Style/ComparableClamp:
1041
- # Enabled: true
1045
+ Style/ComparableClamp:
1046
+ Enabled: true
1042
1047
 
1043
1048
  Style/ConcatArrayLiterals:
1044
1049
  Enabled: true
@@ -1133,9 +1138,8 @@ Style/EvalWithLocation:
1133
1138
  Style/EvenOdd:
1134
1139
  Enabled: true
1135
1140
 
1136
- # Added in version 1.51, unable to check v Chopin, CoCo, Rater yet
1137
- # Style/ExactRegexpMatch:
1138
- # Enabled: true
1141
+ Style/ExactRegexpMatch:
1142
+ Enabled: true
1139
1143
 
1140
1144
  Style/ExpandPathArguments:
1141
1145
  Enabled: true
@@ -1146,6 +1150,7 @@ Style/ExplicitBlockArgument:
1146
1150
  Style/ExponentialNotation:
1147
1151
  Enabled: false
1148
1152
 
1153
+ # Overridden to false in Chopin
1149
1154
  Style/FetchEnvVar:
1150
1155
  Enabled: true
1151
1156
 
@@ -1155,6 +1160,7 @@ Style/FileEmpty:
1155
1160
  Style/FileRead: # new in 1.24
1156
1161
  Enabled: true
1157
1162
 
1163
+ # Overridden to false in Chopin
1158
1164
  Style/FileWrite:
1159
1165
  Enabled: true
1160
1166
 
@@ -1197,9 +1203,10 @@ Style/HashExcept:
1197
1203
  Style/HashLikeCase:
1198
1204
  Enabled: false
1199
1205
 
1200
- # For discussion - 11000+ fails on Chopin if true by default
1201
- # Style/HashSyntax:
1202
- # Enabled: false
1206
+ Style/HashSyntax:
1207
+ Enabled: true
1208
+ EnforcedStyle: no_mixed_keys
1209
+ EnforcedShorthandSyntax: consistent
1203
1210
 
1204
1211
  Style/HashTransformKeys:
1205
1212
  Enabled: true
@@ -1269,12 +1276,13 @@ Style/MagicCommentFormat: # new in 1.35
1269
1276
  Style/MapCompactWithConditionalBlock: # new in 1.30
1270
1277
  Enabled: true
1271
1278
 
1279
+ # Overridden to false in Chopin
1272
1280
  Style/MapToHash:
1273
1281
  Enabled: true
1274
1282
 
1275
- # TODO: small number of fixes in Chopin
1276
- # Style/MapToSet:
1277
- # Enabled: true
1283
+ # Overridden to false in Chopin
1284
+ Style/MapToSet:
1285
+ Enabled: true
1278
1286
 
1279
1287
  # For discussion - 1000s of fails, suggest false
1280
1288
  # Style/MethodCallWithArgsParentheses:
@@ -1293,9 +1301,9 @@ Style/MethodDefParentheses:
1293
1301
  Style/MinMax:
1294
1302
  Enabled: true
1295
1303
 
1296
- # For discussion - multiple fails, suggest true
1297
- # Style/MinMaxComparison:
1298
- # Enabled: true
1304
+ # Overridden to false in Chopin
1305
+ Style/MinMaxComparison:
1306
+ Enabled: true
1299
1307
 
1300
1308
  # For discussion - 100s of fails with default true
1301
1309
  # Style/MissingElse:
@@ -1404,15 +1412,15 @@ Style/ObjectThen: # new in 1.28
1404
1412
  Style/OneLineConditional:
1405
1413
  Enabled: true
1406
1414
 
1415
+ # Overridden to false in Chopin
1407
1416
  Style/OpenStructUse:
1408
1417
  Enabled: true
1409
1418
 
1410
1419
  Style/OperatorMethodCall:
1411
1420
  Enabled: true
1412
1421
 
1413
- # For discussion - suggest true, but dozens of fails on Chopin and handful on Coco, Rater
1414
- # Style/OptionHash:
1415
- # Enabled: true
1422
+ Style/OptionHash:
1423
+ Enabled: true
1416
1424
 
1417
1425
  Style/OptionalArguments:
1418
1426
  Enabled: true
@@ -1444,6 +1452,7 @@ Style/PreferredHashMethods:
1444
1452
  Style/Proc:
1445
1453
  Enabled: true
1446
1454
 
1455
+ # Overridden to false in Chopin
1447
1456
  Style/QuotedSymbols:
1448
1457
  Enabled: true
1449
1458
 
@@ -1526,6 +1535,7 @@ Style/RedundantSelf:
1526
1535
  Style/RedundantSelfAssignment:
1527
1536
  Enabled: true
1528
1537
 
1538
+ # Overridden to false in Chopin
1529
1539
  Style/RedundantSelfAssignmentBranch:
1530
1540
  Enabled: true
1531
1541
 
@@ -1535,6 +1545,7 @@ Style/RedundantSort:
1535
1545
  Style/RedundantSortBy:
1536
1546
  Enabled: true
1537
1547
 
1548
+ # Overridden to false in Chopin
1538
1549
  Style/RedundantStringEscape:
1539
1550
  Enabled: true
1540
1551
 
@@ -1562,6 +1573,7 @@ Style/SafeNavigation:
1562
1573
  Style/Sample:
1563
1574
  Enabled: true
1564
1575
 
1576
+ # Overridden to false in Chopin
1565
1577
  Style/SelectByRegexp:
1566
1578
  Enabled: true
1567
1579
 
@@ -1581,9 +1593,10 @@ Style/SignalException:
1581
1593
  Style/SingleArgumentDig:
1582
1594
  Enabled: true
1583
1595
 
1584
- # TODO: Small number of autocorrectables on Chopin and Rater
1585
- # Style/SingleLineBlockParams:
1586
- # Enabled: true
1596
+ # If this is to be set true, desired param names need to be set for reduce and inject
1597
+ # (default is |acc, elem|) and current usage suggests domain relevant names are preferred
1598
+ Style/SingleLineBlockParams:
1599
+ Enabled: false
1587
1600
 
1588
1601
  Style/SingleLineMethods:
1589
1602
  Enabled: true
@@ -1689,9 +1702,8 @@ Style/TrivialAccessors:
1689
1702
  Style/UnlessElse:
1690
1703
  Enabled: true
1691
1704
 
1692
- # Single fail on each of Chopin and Rater
1693
- # Style/UnlessLogicalOperators:
1694
- # Enabled: true
1705
+ Style/UnlessLogicalOperators:
1706
+ Enabled: true
1695
1707
 
1696
1708
  Style/UnpackFirst:
1697
1709
  Enabled: true
@@ -1711,13 +1723,11 @@ Style/WhileUntilModifier:
1711
1723
  Style/WordArray:
1712
1724
  EnforcedStyle: brackets
1713
1725
 
1714
- # For discussion - causes no fails but maybe some may like it?
1715
- # Style/YodaCondition:
1716
- # Enabled: true
1726
+ Style/YodaCondition:
1727
+ Enabled: false
1717
1728
 
1718
- # For discussion with above - causes multiple fails
1719
- # Style/YodaExpression:
1720
- # Enabled: true
1729
+ Style/YodaExpression:
1730
+ Enabled: false
1721
1731
 
1722
1732
  Style/ZeroLengthPredicate:
1723
1733
  Enabled: true
@@ -0,0 +1,62 @@
1
+ require:
2
+ - rubocop-performance
3
+
4
+ Performance/AncestorsInclude:
5
+ Enabled: true
6
+
7
+ Performance/BigDecimalWithNumericArgument:
8
+ Enabled: true
9
+
10
+ Performance/BlockGivenWithExplicitBlock:
11
+ Enabled: true
12
+
13
+ Performance/Casecmp:
14
+ Enabled: true
15
+
16
+ Performance/CollectionLiteralInLoop:
17
+ Enabled: true
18
+
19
+ Performance/ConcurrentMonotonicTime:
20
+ Enabled: true
21
+
22
+ Performance/ConstantRegexp:
23
+ Enabled: true
24
+
25
+ Performance/MapCompact: # Filter_map removes [false]
26
+ Enabled: false
27
+
28
+ Performance/MethodObjectAsBlock:
29
+ Enabled: true
30
+
31
+ Performance/RedundantBlockCall: # Causes conflicting warnings with normal rubocop enabled
32
+ Enabled: false
33
+
34
+ Performance/RedundantEqualityComparisonBlock:
35
+ Enabled: true
36
+
37
+ Performance/RedundantSortBlock:
38
+ Enabled: true
39
+
40
+ Performance/RedundantSplitRegexpArgument:
41
+ Enabled: true
42
+
43
+ Performance/RedundantStringChars:
44
+ Enabled: true
45
+
46
+ Performance/ReverseFirst:
47
+ Enabled: true
48
+
49
+ Performance/SortReverse:
50
+ Enabled: true
51
+
52
+ Performance/Squeeze:
53
+ Enabled: true
54
+
55
+ Performance/StringIdentifierArgument:
56
+ Enabled: true
57
+
58
+ Performance/StringInclude:
59
+ Enabled: true
60
+
61
+ Performance/Sum:
62
+ Enabled: true
data/docs/index.md CHANGED
@@ -26,12 +26,13 @@ AllCops:
26
26
  - 'vendor/**/*'
27
27
  ```
28
28
 
29
- * If you are implementing this in rails project and have rspec , you probably want the standard rails and rspec cops. you can include this by adding:
29
+ * If you are implementing this in rails project and have rspec , you probably want the standard rails, rspec, and performance cops. you can include this by adding:
30
30
 
31
31
  ```yaml
32
32
  inherit_gem:
33
33
  simplycop:
34
34
  - .simplycop.yml
35
+ - .simplycop_performance.yml
35
36
  - .simplycop_rails.yml
36
37
  - .simplycop_rspec.yml
37
38
  ```
@@ -7,5 +7,5 @@
7
7
  #
8
8
 
9
9
  module Simplycop
10
- VERSION = '1.12.23'
10
+ VERSION = '1.13.0'
11
11
  end
data/simplycop.gemspec CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ['lib']
19
19
 
20
20
  spec.add_dependency 'rubocop', '~> 1.42'
21
+ spec.add_dependency 'rubocop-performance', '~> 1.15'
21
22
  spec.add_dependency 'rubocop-rails', '~> 2.17'
22
23
  spec.add_dependency 'rubocop-rspec', '~> 2.16'
23
24
  spec.add_development_dependency 'bundler', '>= 2.2.15'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplycop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.23
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simply Business
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-01 00:00:00.000000000 Z
11
+ date: 2023-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.42'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-performance
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.15'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.15'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rubocop-rails
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -117,6 +131,7 @@ files:
117
131
  - ".ruby-version"
118
132
  - ".simplycop.yml"
119
133
  - ".simplycop_metaprogramming.yml"
134
+ - ".simplycop_performance.yml"
120
135
  - ".simplycop_rails.yml"
121
136
  - ".simplycop_rspec.yml"
122
137
  - ".simplycop_security.yml"