rubocop-shopify 3.0.2 → 3.1.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: '0885f64f2574e1f3db7bb466fb9dcdbc1c0f1fbaf29336c209e666b10fc9104b'
4
- data.tar.gz: b0a2e7bbef8f68e98c15348689d1c20433ea2da70c7727146b095028ae22992d
3
+ metadata.gz: f94416de0fd49d1bac517f3d0e252ec142e57ddd4dd1e54ca7ca9bfff450c225
4
+ data.tar.gz: c3df65a2baf8b2ea61d4a654cb87f79059f0c0bb6b228094745c869037ad2263
5
5
  SHA512:
6
- metadata.gz: e352f773f31c7846508a1033019a098a7d45f72220a4ca55c81f5be24e1b74e1d5f53f61bbbff03311d62f5c495e7236aa9d8502ad0eb1bac0d4cafceb6fed45
7
- data.tar.gz: 5c6ca00c17a0a0c465bb2093368fd37fc473a807f6b7db21eaddd57d1aa1aaab4a149304a92f256b2b3abf6500eebf481abaed6d406b5ea464ebd4b085f7a43f
6
+ metadata.gz: 7bdf223592a04d7258d54952d716099729eb89f84c85c91ce4d3dfaf98edb5d59cce9e508278b81a8ef5cc0d15f5414a08e4ab6a3ad5826a61c261c47810d29c
7
+ data.tar.gz: 6b3574852de0cccc719e9cbf89090fd4c6184fdfe5c19059ed9c3b7004d6de8b8fcffec29b3a04604ab092b32f1eabda2fbc85a81e3d45a8d5a9faf434c6e8b0
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Shopify
5
- VERSION = "3.0.2"
5
+ VERSION = "3.1.0"
6
6
  end
7
7
  end
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "rubocop"
3
4
  require "rubocop/shopify/version"
4
5
  require "rubocop/shopify/plugin"
5
6
 
6
- require "rubocop/cop/lint/no_return_in_memoization"
7
- require "rubocop/cop/style/proc_case_when"
7
+ RuboCop::Cop::Lint.register_cop :NoReturnInMemoization, "#{__dir__}/rubocop/cop/lint/no_return_in_memoization"
8
+ RuboCop::Cop::Style.register_cop :ProcCaseWhen, "#{__dir__}/rubocop/cop/style/proc_case_when"
@@ -8,6 +8,16 @@ namespace :config do
8
8
  file = "rubocop.yml"
9
9
  target = args.fetch(:target, "test/fixtures/full_config.yml")
10
10
 
11
+ # Reset the default configuration and loaded plugins so that plugins loaded
12
+ # as side effects of running tests (e.g. rubocop-minitest's
13
+ # AssertOffense#integrate_plugins!) do not leak into the dump. Without this,
14
+ # integrate_plugins! injects all installed lint_roller plugins into the
15
+ # global default_configuration, and a prior load_file("rubocop.yml") marks
16
+ # rubocop-shopify as already loaded so resolve_plugins skips re-injecting it
17
+ # after the reset. Both are lazily rebuilt on the next access.
18
+ RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, nil)
19
+ RuboCop::ConfigLoader.loaded_plugins.clear
20
+
11
21
  file_config = RuboCop::ConfigLoader.load_file(file)
12
22
  config = RuboCop::ConfigLoader.merge_with_default(file_config, file)
13
23
  output = config.to_h.to_yaml.gsub(config.base_dir_for_path_parameters, "")
data/rubocop.yml CHANGED
@@ -23,10 +23,8 @@ Bundler/OrderedGems:
23
23
  Gemspec/AddRuntimeDependency:
24
24
  Enabled: false
25
25
 
26
- <% if rubocop_version >= '1.77' %>
27
26
  Gemspec/AttributeAssignment:
28
27
  Enabled: true
29
- <% end %>
30
28
 
31
29
  Gemspec/DeprecatedAttributeAssignment:
32
30
  Enabled: true
@@ -79,10 +77,8 @@ Layout/EmptyLineAfterGuardClause:
79
77
  Layout/EmptyLines:
80
78
  Enabled: false
81
79
 
82
- <% if rubocop_version >= '1.79' %>
83
80
  Layout/EmptyLinesAfterModuleInclusion:
84
81
  Enabled: false
85
- <% end %>
86
82
 
87
83
  Layout/EndAlignment:
88
84
  Enabled: false
@@ -189,6 +185,11 @@ Lint/AmbiguousRange:
189
185
  Lint/AmbiguousRegexpLiteral:
190
186
  Enabled: false
191
187
 
188
+ <% if rubocop_version >= "1.91.0" %>
189
+ Lint/ArgumentMismatch:
190
+ Enabled: false
191
+ <% end %>
192
+
192
193
  Lint/ArrayLiteralInRegexp:
193
194
  Enabled: false
194
195
 
@@ -207,17 +208,15 @@ Lint/ConstantOverwrittenInRescue:
207
208
  Lint/ConstantReassignment:
208
209
  Enabled: true
209
210
 
210
- Lint/CopDirectiveSyntax:
211
- Enabled: true
212
-
213
- <% if rubocop_version >= "1.85" %>
214
211
  Lint/DataDefineOverride:
215
212
  Enabled: true
216
- <% end %>
217
213
 
218
214
  Lint/DeprecatedConstants:
219
215
  Enabled: false
220
216
 
217
+ Lint/DeprecatedReference:
218
+ Enabled: false
219
+
221
220
  Lint/DuplicateBranch:
222
221
  Enabled: false
223
222
 
@@ -293,6 +292,11 @@ Lint/LiteralAssignmentInCondition:
293
292
  Lint/Loop:
294
293
  Enabled: false
295
294
 
295
+ <% if rubocop_version >= "1.91.0" %>
296
+ Lint/MisplacedMagicComment:
297
+ Enabled: false
298
+ <% end %>
299
+
296
300
  Lint/MissingSuper:
297
301
  Enabled: false
298
302
 
@@ -302,6 +306,9 @@ Lint/MixedCaseRange:
302
306
  Lint/MixedRegexpCaptureTypes:
303
307
  Enabled: false
304
308
 
309
+ Lint/NameTypo:
310
+ Enabled: false
311
+
305
312
  Lint/NoReturnInBeginEndBlocks:
306
313
  Enabled: false
307
314
 
@@ -392,17 +399,17 @@ Lint/ShadowedArgument:
392
399
  Lint/ShadowedException:
393
400
  Enabled: false
394
401
 
395
- <% if rubocop_version < "1.76" %>
396
- Lint/ShadowingOuterLocalVariable:
397
- Enabled: false
398
- <% end %>
399
-
400
402
  Lint/SharedMutableDefault:
401
403
  Enabled: false
402
404
 
403
405
  Lint/StructNewOverride:
404
406
  Enabled: false
405
407
 
408
+ <% if rubocop_version >= "1.91.0" %>
409
+ Lint/SuperArgumentMismatch:
410
+ Enabled: false
411
+ <% end %>
412
+
406
413
  Lint/SuppressedException:
407
414
  Enabled: false
408
415
 
@@ -445,10 +452,8 @@ Lint/UnreachableCode:
445
452
  Lint/UnreachableLoop:
446
453
  Enabled: false
447
454
 
448
- <% if rubocop_version >= "1.85" %>
449
455
  Lint/UnreachablePatternBranch:
450
456
  Enabled: true
451
- <% end %>
452
457
 
453
458
  Lint/UnusedBlockArgument:
454
459
  Enabled: false
@@ -471,10 +476,8 @@ Lint/UselessAssignment:
471
476
  Lint/UselessConstantScoping:
472
477
  Enabled: false
473
478
 
474
- <% if rubocop_version >= "1.76" %>
475
479
  Lint/UselessDefaultValueArgument:
476
480
  Enabled: true
477
- <% end %>
478
481
 
479
482
  Lint/UselessDefined:
480
483
  Enabled: false
@@ -488,10 +491,8 @@ Lint/UselessMethodDefinition:
488
491
  Lint/UselessNumericOperation:
489
492
  Enabled: false
490
493
 
491
- <% if rubocop_version >= "1.76" %>
492
494
  Lint/UselessOr:
493
495
  Enabled: true
494
- <% end %>
495
496
 
496
497
  Lint/UselessRescue:
497
498
  Enabled: false
@@ -563,16 +564,10 @@ Naming/MemoizedInstanceVariableName:
563
564
  Naming/MethodParameterName:
564
565
  MinNameLength: 1
565
566
 
566
- <% if rubocop_version >= "1.76" %>
567
567
  Naming/PredicateMethod:
568
568
  Enabled: false
569
- <% end %>
570
569
 
571
- <% if rubocop_version >= "1.76" %>
572
570
  Naming/PredicatePrefix:
573
- <% else %>
574
- Naming/PredicateName:
575
- <% end %>
576
571
  Enabled: false
577
572
  NamePrefix:
578
573
  - is_
@@ -632,10 +627,8 @@ Style/ArrayCoercion:
632
627
  Style/ArrayIntersect:
633
628
  Enabled: false
634
629
 
635
- <% if rubocop_version >= '1.81' %>
636
630
  Style/ArrayIntersectWithSingleElement:
637
631
  Enabled: false
638
- <% end %>
639
632
 
640
633
  Style/ArrayJoin:
641
634
  Enabled: false
@@ -679,10 +672,8 @@ Style/ClassMethodsDefinitions:
679
672
  Style/CollectionCompact:
680
673
  Enabled: false
681
674
 
682
- <% if rubocop_version >= '1.77' %>
683
675
  Style/CollectionQuerying:
684
676
  Enabled: false
685
- <% end %>
686
677
 
687
678
  Style/CombinableDefined:
688
679
  Enabled: true
@@ -700,10 +691,8 @@ Style/CommentAnnotation:
700
691
  Style/CommentedKeyword:
701
692
  Enabled: false
702
693
 
703
- <% if rubocop_version >= "1.74" %>
704
694
  Style/ComparableBetween:
705
695
  Enabled: false
706
- <% end %>
707
696
 
708
697
  Style/ComparableClamp:
709
698
  Enabled: false
@@ -726,14 +715,21 @@ Style/Dir:
726
715
  Style/DirEmpty:
727
716
  Enabled: false
728
717
 
718
+ <% if rubocop_version >= "1.91.0" %>
719
+ Style/DirectiveScope:
720
+ Enabled: false
721
+ <% end %>
722
+
729
723
  Style/DocumentDynamicEvalDefinition:
730
724
  Enabled: false
731
725
 
732
726
  Style/Documentation:
733
727
  Enabled: false
734
728
 
729
+ <% if rubocop_version < "1.91.0" %>
735
730
  Style/DoubleCopDisableDirective:
736
731
  Enabled: false
732
+ <% end %>
737
733
 
738
734
  Style/DoubleNegation:
739
735
  Enabled: false
@@ -750,10 +746,8 @@ Style/EmptyBlockParameter:
750
746
  Style/EmptyCaseCondition:
751
747
  Enabled: false
752
748
 
753
- <% if rubocop_version >= "1.84" %>
754
749
  Style/EmptyClassDefinition:
755
750
  Enabled: false
756
- <% end %>
757
751
 
758
752
  Style/EmptyElse:
759
753
  Enabled: false
@@ -771,10 +765,8 @@ Style/EmptyLiteral:
771
765
  Style/EmptyMethod:
772
766
  Enabled: false
773
767
 
774
- <% if rubocop_version >= "1.76" %>
775
768
  Style/EmptyStringInsideInterpolation:
776
769
  Enabled: false
777
- <% end %>
778
770
 
779
771
  Style/Encoding:
780
772
  Enabled: false
@@ -815,10 +807,8 @@ Style/FileEmpty:
815
807
  Style/FileNull:
816
808
  Enabled: false
817
809
 
818
- <% if rubocop_version >= "1.85" %>
819
810
  Style/FileOpen:
820
811
  Enabled: false
821
- <% end %>
822
812
 
823
813
  Style/FileRead:
824
814
  Enabled: false
@@ -866,10 +856,8 @@ Style/HashEachMethods:
866
856
  Style/HashExcept:
867
857
  Enabled: false
868
858
 
869
- <% if rubocop_version >= "1.75" %>
870
859
  Style/HashFetchChain:
871
860
  Enabled: false
872
- <% end %>
873
861
 
874
862
  Style/HashLikeCase:
875
863
  Enabled: false
@@ -913,10 +901,8 @@ Style/InverseMethods:
913
901
  Style/ItAssignment:
914
902
  Enabled: false
915
903
 
916
- <% if rubocop_version >= "1.75" %>
917
904
  Style/ItBlockParameter:
918
905
  Enabled: false
919
- <% end %>
920
906
 
921
907
  Style/KeywordArgumentsMerging:
922
908
  Enabled: false
@@ -943,10 +929,8 @@ Style/MapCompactWithConditionalBlock:
943
929
  Style/MapIntoArray:
944
930
  Enabled: false
945
931
 
946
- <% if rubocop_version >= "1.85" %>
947
932
  Style/MapJoin:
948
933
  Enabled: true
949
- <% end %>
950
934
 
951
935
  Style/MapToHash:
952
936
  Enabled: false
@@ -987,10 +971,8 @@ Style/ModuleFunction:
987
971
  Enabled: false
988
972
  EnforcedStyle: extend_self
989
973
 
990
- <% if rubocop_version >= "1.82" %>
991
974
  Style/ModuleMemberExistenceCheck:
992
975
  Enabled: true
993
- <% end %>
994
976
 
995
977
  Style/MultilineBlockChain:
996
978
  Enabled: false
@@ -1028,10 +1010,8 @@ Style/NegatedUnless:
1028
1010
  Style/NegatedWhile:
1029
1011
  Enabled: false
1030
1012
 
1031
- <% if rubocop_version >= "1.84" %>
1032
1013
  Style/NegativeArrayIndex:
1033
1014
  Enabled: true
1034
- <% end %>
1035
1015
 
1036
1016
  Style/NestedFileDirname:
1037
1017
  Enabled: false
@@ -1078,10 +1058,8 @@ Style/NumericPredicate:
1078
1058
  Style/ObjectThen:
1079
1059
  Enabled: false
1080
1060
 
1081
- <% if rubocop_version >= "1.85" %>
1082
1061
  Style/OneClassPerFile:
1083
1062
  Enabled: false
1084
- <% end %>
1085
1063
 
1086
1064
  Style/OneLineConditional:
1087
1065
  Enabled: false
@@ -1107,10 +1085,8 @@ Style/ParallelAssignment:
1107
1085
  Style/ParenthesesAroundCondition:
1108
1086
  Enabled: false
1109
1087
 
1110
- <% if rubocop_version >= "1.85" %>
1111
1088
  Style/PartitionInsteadOfDoubleSelect:
1112
1089
  Enabled: false
1113
- <% end %>
1114
1090
 
1115
1091
  Style/PercentLiteralDelimiters:
1116
1092
  Enabled: false
@@ -1121,10 +1097,8 @@ Style/PercentQLiterals:
1121
1097
  Style/PerlBackrefs:
1122
1098
  Enabled: false
1123
1099
 
1124
- <% if rubocop_version >= "1.85" %>
1125
1100
  Style/PredicateWithKind:
1126
1101
  Enabled: false
1127
- <% end %>
1128
1102
 
1129
1103
  Style/PreferredHashMethods:
1130
1104
  Enabled: false
@@ -1141,10 +1115,8 @@ Style/RaiseArgs:
1141
1115
  Style/RandomWithOffset:
1142
1116
  Enabled: false
1143
1117
 
1144
- <% if rubocop_version >= "1.85" %>
1145
1118
  Style/ReduceToHash:
1146
- Enabled: true
1147
- <% end %>
1119
+ Enabled: false
1148
1120
 
1149
1121
  Style/RedundantArgument:
1150
1122
  Enabled: false
@@ -1152,10 +1124,8 @@ Style/RedundantArgument:
1152
1124
  Style/RedundantArrayConstructor:
1153
1125
  Enabled: false
1154
1126
 
1155
- <% if rubocop_version >= "1.76" %>
1156
1127
  Style/RedundantArrayFlatten:
1157
1128
  Enabled: true
1158
- <% end %>
1159
1129
 
1160
1130
  Style/RedundantAssignment:
1161
1131
  Enabled: false
@@ -1211,10 +1181,8 @@ Style/RedundantInterpolationUnfreeze:
1211
1181
  Style/RedundantLineContinuation:
1212
1182
  Enabled: false
1213
1183
 
1214
- <% if rubocop_version >= "1.85" %>
1215
1184
  Style/RedundantMinMaxBy:
1216
1185
  Enabled: true
1217
- <% end %>
1218
1186
 
1219
1187
  Style/RedundantParentheses:
1220
1188
  Enabled: false
@@ -1231,9 +1199,6 @@ Style/RedundantRegexpCharacterClass:
1231
1199
  Style/RedundantRegexpConstructor:
1232
1200
  Enabled: false
1233
1201
 
1234
- Style/RedundantRegexpEscape:
1235
- Enabled: false
1236
-
1237
1202
  Style/RedundantSelf:
1238
1203
  Enabled: false
1239
1204
 
@@ -1265,10 +1230,8 @@ Style/RescueStandardError:
1265
1230
  Style/ReturnNilInPredicateMethodDefinition:
1266
1231
  Enabled: false
1267
1232
 
1268
- <% if rubocop_version >= "1.84" %>
1269
1233
  Style/ReverseFind:
1270
1234
  Enabled: false
1271
- <% end %>
1272
1235
 
1273
1236
  Style/SafeNavigation:
1274
1237
  Enabled: false
@@ -1279,15 +1242,11 @@ Style/SafeNavigationChainLength:
1279
1242
  Style/Sample:
1280
1243
  Enabled: false
1281
1244
 
1282
- <% if rubocop_version >= "1.85" %>
1283
1245
  Style/SelectByKind:
1284
1246
  Enabled: true
1285
- <% end %>
1286
1247
 
1287
- <% if rubocop_version >= "1.85" %>
1288
1248
  Style/SelectByRange:
1289
1249
  Enabled: true
1290
- <% end %>
1291
1250
 
1292
1251
  Style/SelectByRegexp:
1293
1252
  Enabled: false
@@ -1359,14 +1318,17 @@ Style/SymbolArray:
1359
1318
  Style/SymbolProc:
1360
1319
  Enabled: false
1361
1320
 
1362
- <% if rubocop_version >= "1.85" %>
1363
1321
  Style/TallyMethod:
1364
1322
  Enabled: true
1365
- <% end %>
1366
1323
 
1367
1324
  Style/TernaryParentheses:
1368
1325
  Enabled: false
1369
1326
 
1327
+ <% if rubocop_version >= "1.91.0" %>
1328
+ Style/TimeNow:
1329
+ Enabled: false
1330
+ <% end %>
1331
+
1370
1332
  Style/TrailingCommaInArguments:
1371
1333
  Enabled: false
1372
1334
  EnforcedStyleForMultiline: comma
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-shopify
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify Engineering
@@ -15,20 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '1.72'
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: 1.72.1
18
+ version: '1.89'
22
19
  type: :runtime
23
20
  prerelease: false
24
21
  version_requirements: !ruby/object:Gem::Requirement
25
22
  requirements:
26
23
  - - "~>"
27
24
  - !ruby/object:Gem::Version
28
- version: '1.72'
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: 1.72.1
25
+ version: '1.89'
32
26
  - !ruby/object:Gem::Dependency
33
27
  name: lint_roller
34
28
  requirement: !ruby/object:Gem::Requirement
@@ -64,7 +58,7 @@ homepage: https://shopify.github.io/ruby-style-guide/
64
58
  licenses:
65
59
  - MIT
66
60
  metadata:
67
- source_code_uri: https://github.com/Shopify/ruby-style-guide/tree/v3.0.2
61
+ source_code_uri: https://github.com/Shopify/ruby-style-guide/tree/v3.1.0
68
62
  allowed_push_host: https://rubygems.org
69
63
  default_lint_roller_plugin: RuboCop::Shopify::Plugin
70
64
  rdoc_options: []