graphql-batch 0.4.2 → 0.4.3

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: 257c2068b92162f1e38b17192c08979fdfcd04fe4f4fa93d2a290dc3746e12ec
4
- data.tar.gz: 4b050c894e800925946423723a6431c5a28f3486c4f5de6f2e80c73ed578db18
3
+ metadata.gz: fccdeee0358f45c6750102fa77b7537f11d4a269a40985be5e8c01db1314b346
4
+ data.tar.gz: ca0737882a1d16189c262e30e113deffb46d4ed50faabca99f3b81f2c317ed9a
5
5
  SHA512:
6
- metadata.gz: 5f2d63cc78370652458bc351d5d05f0502f7429c66e4bd0676b1fd62eea0fc9a6eb359d7df9213a3be413bbcd81b29a425e300c8c9f21769b13a0e91864e59b7
7
- data.tar.gz: 0d35c4b83c8f8d732dc24889b16a4ad672e308582b4aab9c2a7f84da6d8388a5df8e0ae5adcca4e5ccb538b5c2f2568e772c635bff31663bb1620358ee98e3f6
6
+ metadata.gz: 8edbbe8673b1581b2927fed0ed4af9370f7009d0662cac952bebe0cc00cec2bf32fafe4eee092af47666e61f3f8a09ec3298d95715a7d6436e91af4dacfc2f02
7
+ data.tar.gz: 3b4cd32b2f65e7af83394a151df55f9880b8d0381d687c1135dfb541a9dd90e4bdaca8071d5aae68976ae176e3bc74304ae639f884dcad3e26249abd4e4c1334
@@ -0,0 +1,1029 @@
1
+ # Recommended rubocop version: ~> 0.78.0
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - 'db/schema.rb'
6
+ DisabledByDefault: true
7
+ StyleGuideBaseURL: https://shopify.github.io/ruby-style-guide/
8
+
9
+ Lint/AssignmentInCondition:
10
+ Enabled: true
11
+
12
+ Layout/AccessModifierIndentation:
13
+ EnforcedStyle: indent
14
+ SupportedStyles:
15
+ - outdent
16
+ - indent
17
+ IndentationWidth:
18
+
19
+ Style/Alias:
20
+ EnforcedStyle: prefer_alias_method
21
+ SupportedStyles:
22
+ - prefer_alias
23
+ - prefer_alias_method
24
+
25
+ Layout/HashAlignment:
26
+ EnforcedHashRocketStyle: key
27
+ EnforcedColonStyle: key
28
+ EnforcedLastArgumentHashStyle: ignore_implicit
29
+ SupportedLastArgumentHashStyles:
30
+ - always_inspect
31
+ - always_ignore
32
+ - ignore_implicit
33
+ - ignore_explicit
34
+
35
+ Layout/ParameterAlignment:
36
+ EnforcedStyle: with_fixed_indentation
37
+ SupportedStyles:
38
+ - with_first_parameter
39
+ - with_fixed_indentation
40
+ IndentationWidth:
41
+
42
+ Style/AndOr:
43
+ EnforcedStyle: always
44
+ SupportedStyles:
45
+ - always
46
+ - conditionals
47
+
48
+ Style/BarePercentLiterals:
49
+ EnforcedStyle: bare_percent
50
+ SupportedStyles:
51
+ - percent_q
52
+ - bare_percent
53
+
54
+ Style/BlockDelimiters:
55
+ EnforcedStyle: line_count_based
56
+ SupportedStyles:
57
+ - line_count_based
58
+ - semantic
59
+ - braces_for_chaining
60
+ ProceduralMethods:
61
+ - benchmark
62
+ - bm
63
+ - bmbm
64
+ - create
65
+ - each_with_object
66
+ - measure
67
+ - new
68
+ - realtime
69
+ - tap
70
+ - with_object
71
+ FunctionalMethods:
72
+ - let
73
+ - let!
74
+ - subject
75
+ - watch
76
+ IgnoredMethods:
77
+ - lambda
78
+ - proc
79
+ - it
80
+
81
+ Style/BracesAroundHashParameters:
82
+ EnforcedStyle: no_braces
83
+ SupportedStyles:
84
+ - braces
85
+ - no_braces
86
+ - context_dependent
87
+
88
+ Layout/CaseIndentation:
89
+ EnforcedStyle: end
90
+ SupportedStyles:
91
+ - case
92
+ - end
93
+ IndentOneStep: false
94
+ IndentationWidth:
95
+
96
+ Style/ClassAndModuleChildren:
97
+ EnforcedStyle: nested
98
+ SupportedStyles:
99
+ - nested
100
+ - compact
101
+
102
+ Style/ClassCheck:
103
+ EnforcedStyle: is_a?
104
+ SupportedStyles:
105
+ - is_a?
106
+ - kind_of?
107
+
108
+ Style/CommandLiteral:
109
+ EnforcedStyle: percent_x
110
+ SupportedStyles:
111
+ - backticks
112
+ - percent_x
113
+ - mixed
114
+ AllowInnerBackticks: false
115
+
116
+ Style/CommentAnnotation:
117
+ Keywords:
118
+ - TODO
119
+ - FIXME
120
+ - OPTIMIZE
121
+ - HACK
122
+ - REVIEW
123
+
124
+ Style/ConditionalAssignment:
125
+ EnforcedStyle: assign_to_condition
126
+ SupportedStyles:
127
+ - assign_to_condition
128
+ - assign_inside_condition
129
+ SingleLineConditionsOnly: true
130
+
131
+ Layout/DotPosition:
132
+ EnforcedStyle: leading
133
+ SupportedStyles:
134
+ - leading
135
+ - trailing
136
+
137
+ Style/EmptyElse:
138
+ EnforcedStyle: both
139
+ SupportedStyles:
140
+ - empty
141
+ - nil
142
+ - both
143
+
144
+ Layout/EmptyLineBetweenDefs:
145
+ AllowAdjacentOneLineDefs: false
146
+
147
+ Layout/EmptyLinesAroundBlockBody:
148
+ EnforcedStyle: no_empty_lines
149
+ SupportedStyles:
150
+ - empty_lines
151
+ - no_empty_lines
152
+
153
+ Layout/EmptyLinesAroundClassBody:
154
+ EnforcedStyle: no_empty_lines
155
+ SupportedStyles:
156
+ - empty_lines
157
+ - empty_lines_except_namespace
158
+ - no_empty_lines
159
+
160
+ Layout/EmptyLinesAroundModuleBody:
161
+ EnforcedStyle: no_empty_lines
162
+ SupportedStyles:
163
+ - empty_lines
164
+ - empty_lines_except_namespace
165
+ - no_empty_lines
166
+
167
+ Layout/ExtraSpacing:
168
+ AllowForAlignment: true
169
+ ForceEqualSignAlignment: false
170
+
171
+ Naming/FileName:
172
+ Exclude: []
173
+ ExpectMatchingDefinition: false
174
+ Regex:
175
+ IgnoreExecutableScripts: true
176
+
177
+ Layout/FirstArgumentIndentation:
178
+ EnforcedStyle: consistent
179
+ SupportedStyles:
180
+ - consistent
181
+ - special_for_inner_method_call
182
+ - special_for_inner_method_call_in_parentheses
183
+ IndentationWidth:
184
+
185
+ Style/For:
186
+ EnforcedStyle: each
187
+ SupportedStyles:
188
+ - for
189
+ - each
190
+
191
+ Style/FormatString:
192
+ EnforcedStyle: format
193
+ SupportedStyles:
194
+ - format
195
+ - sprintf
196
+ - percent
197
+
198
+ Style/FrozenStringLiteralComment:
199
+ Details: >-
200
+ Add `# frozen_string_literal: true` to the top of the file. Frozen string
201
+ literals will become the default in a future Ruby version, and we want to
202
+ make sure we're ready.
203
+ EnforcedStyle: always
204
+ SupportedStyles:
205
+ - always
206
+ - never
207
+
208
+ Style/GlobalVars:
209
+ AllowedVariables: []
210
+
211
+ Style/HashSyntax:
212
+ EnforcedStyle: ruby19
213
+ SupportedStyles:
214
+ - ruby19
215
+ - hash_rockets
216
+ - no_mixed_keys
217
+ - ruby19_no_mixed_keys
218
+ UseHashRocketsWithSymbolValues: false
219
+ PreferHashRocketsForNonAlnumEndingSymbols: false
220
+
221
+ Layout/IndentationConsistency:
222
+ EnforcedStyle: normal
223
+ SupportedStyles:
224
+ - normal
225
+ - rails
226
+
227
+ Layout/IndentationWidth:
228
+ Width: 2
229
+
230
+ Layout/FirstArrayElementIndentation:
231
+ EnforcedStyle: consistent
232
+ SupportedStyles:
233
+ - special_inside_parentheses
234
+ - consistent
235
+ - align_brackets
236
+ IndentationWidth:
237
+
238
+ Layout/AssignmentIndentation:
239
+ IndentationWidth:
240
+
241
+ Layout/FirstHashElementIndentation:
242
+ EnforcedStyle: consistent
243
+ SupportedStyles:
244
+ - special_inside_parentheses
245
+ - consistent
246
+ - align_braces
247
+ IndentationWidth:
248
+
249
+ Style/LambdaCall:
250
+ EnforcedStyle: call
251
+ SupportedStyles:
252
+ - call
253
+ - braces
254
+
255
+ Style/Next:
256
+ EnforcedStyle: skip_modifier_ifs
257
+ MinBodyLength: 3
258
+ SupportedStyles:
259
+ - skip_modifier_ifs
260
+ - always
261
+
262
+ Style/NonNilCheck:
263
+ IncludeSemanticChanges: false
264
+
265
+ Style/MethodCallWithArgsParentheses:
266
+ Enabled: true
267
+ IgnoreMacros: true
268
+ IgnoredMethods:
269
+ - require
270
+ - require_relative
271
+ - require_dependency
272
+ - yield
273
+ - raise
274
+ - puts
275
+ Exclude:
276
+ - Gemfile
277
+
278
+ Style/MethodDefParentheses:
279
+ EnforcedStyle: require_parentheses
280
+ SupportedStyles:
281
+ - require_parentheses
282
+ - require_no_parentheses
283
+ - require_no_parentheses_except_multiline
284
+
285
+ Naming/MethodName:
286
+ EnforcedStyle: snake_case
287
+ SupportedStyles:
288
+ - snake_case
289
+ - camelCase
290
+
291
+ Layout/MultilineArrayBraceLayout:
292
+ EnforcedStyle: symmetrical
293
+ SupportedStyles:
294
+ - symmetrical
295
+ - new_line
296
+ - same_line
297
+
298
+ Layout/MultilineHashBraceLayout:
299
+ EnforcedStyle: symmetrical
300
+ SupportedStyles:
301
+ - symmetrical
302
+ - new_line
303
+ - same_line
304
+
305
+ Layout/MultilineMethodCallBraceLayout:
306
+ EnforcedStyle: symmetrical
307
+ SupportedStyles:
308
+ - symmetrical
309
+ - new_line
310
+ - same_line
311
+
312
+ Layout/MultilineMethodCallIndentation:
313
+ EnforcedStyle: indented
314
+ SupportedStyles:
315
+ - aligned
316
+ - indented
317
+ - indented_relative_to_receiver
318
+ IndentationWidth: 2
319
+
320
+ Layout/MultilineMethodDefinitionBraceLayout:
321
+ EnforcedStyle: symmetrical
322
+ SupportedStyles:
323
+ - symmetrical
324
+ - new_line
325
+ - same_line
326
+
327
+ Style/NumericLiteralPrefix:
328
+ EnforcedOctalStyle: zero_only
329
+ SupportedOctalStyles:
330
+ - zero_with_o
331
+ - zero_only
332
+
333
+ Style/ParenthesesAroundCondition:
334
+ AllowSafeAssignment: true
335
+
336
+ Style/PercentQLiterals:
337
+ EnforcedStyle: lower_case_q
338
+ SupportedStyles:
339
+ - lower_case_q
340
+ - upper_case_q
341
+
342
+ Naming/PredicateName:
343
+ NamePrefix:
344
+ - is_
345
+ ForbiddenPrefixes:
346
+ - is_
347
+ AllowedMethods:
348
+ - is_a?
349
+ Exclude:
350
+ - 'spec/**/*'
351
+
352
+ Style/PreferredHashMethods:
353
+ EnforcedStyle: short
354
+ SupportedStyles:
355
+ - short
356
+ - verbose
357
+
358
+ Style/RaiseArgs:
359
+ EnforcedStyle: exploded
360
+ SupportedStyles:
361
+ - compact
362
+ - exploded
363
+
364
+ Style/RedundantReturn:
365
+ AllowMultipleReturnValues: false
366
+
367
+ Style/RegexpLiteral:
368
+ EnforcedStyle: mixed
369
+ SupportedStyles:
370
+ - slashes
371
+ - percent_r
372
+ - mixed
373
+ AllowInnerSlashes: false
374
+
375
+ Style/SafeNavigation:
376
+ ConvertCodeThatCanStartToReturnNil: false
377
+ Enabled: true
378
+
379
+ Lint/SafeNavigationChain:
380
+ Enabled: true
381
+
382
+ Style/Semicolon:
383
+ AllowAsExpressionSeparator: false
384
+
385
+ Style/SignalException:
386
+ EnforcedStyle: only_raise
387
+ SupportedStyles:
388
+ - only_raise
389
+ - only_fail
390
+ - semantic
391
+
392
+ Style/SingleLineMethods:
393
+ AllowIfMethodIsEmpty: true
394
+
395
+ Layout/SpaceBeforeFirstArg:
396
+ AllowForAlignment: true
397
+
398
+ Style/SpecialGlobalVars:
399
+ EnforcedStyle: use_english_names
400
+ SupportedStyles:
401
+ - use_perl_names
402
+ - use_english_names
403
+
404
+ Style/StabbyLambdaParentheses:
405
+ EnforcedStyle: require_parentheses
406
+ SupportedStyles:
407
+ - require_parentheses
408
+ - require_no_parentheses
409
+
410
+ Style/StringLiteralsInInterpolation:
411
+ EnforcedStyle: single_quotes
412
+ SupportedStyles:
413
+ - single_quotes
414
+ - double_quotes
415
+
416
+ Layout/SpaceAroundBlockParameters:
417
+ EnforcedStyleInsidePipes: no_space
418
+ SupportedStylesInsidePipes:
419
+ - space
420
+ - no_space
421
+
422
+ Layout/SpaceAroundEqualsInParameterDefault:
423
+ EnforcedStyle: space
424
+ SupportedStyles:
425
+ - space
426
+ - no_space
427
+
428
+ Layout/SpaceAroundOperators:
429
+ AllowForAlignment: true
430
+
431
+ Layout/SpaceBeforeBlockBraces:
432
+ EnforcedStyle: space
433
+ EnforcedStyleForEmptyBraces: space
434
+ SupportedStyles:
435
+ - space
436
+ - no_space
437
+
438
+ Layout/SpaceInsideBlockBraces:
439
+ EnforcedStyle: space
440
+ SupportedStyles:
441
+ - space
442
+ - no_space
443
+ EnforcedStyleForEmptyBraces: no_space
444
+ SpaceBeforeBlockParameters: true
445
+
446
+ Layout/SpaceInsideHashLiteralBraces:
447
+ EnforcedStyle: space
448
+ EnforcedStyleForEmptyBraces: no_space
449
+ SupportedStyles:
450
+ - space
451
+ - no_space
452
+ - compact
453
+
454
+ Layout/SpaceInsideStringInterpolation:
455
+ EnforcedStyle: no_space
456
+ SupportedStyles:
457
+ - space
458
+ - no_space
459
+
460
+ Style/SymbolProc:
461
+ IgnoredMethods:
462
+ - respond_to
463
+ - define_method
464
+
465
+ Style/TernaryParentheses:
466
+ EnforcedStyle: require_no_parentheses
467
+ SupportedStyles:
468
+ - require_parentheses
469
+ - require_no_parentheses
470
+ AllowSafeAssignment: true
471
+
472
+ Layout/TrailingEmptyLines:
473
+ EnforcedStyle: final_newline
474
+ SupportedStyles:
475
+ - final_newline
476
+ - final_blank_line
477
+
478
+ Style/TrivialAccessors:
479
+ ExactNameMatch: true
480
+ AllowPredicates: true
481
+ AllowDSLWriters: false
482
+ IgnoreClassMethods: false
483
+ AllowedMethods:
484
+ - to_ary
485
+ - to_a
486
+ - to_c
487
+ - to_enum
488
+ - to_h
489
+ - to_hash
490
+ - to_i
491
+ - to_int
492
+ - to_io
493
+ - to_open
494
+ - to_path
495
+ - to_proc
496
+ - to_r
497
+ - to_regexp
498
+ - to_str
499
+ - to_s
500
+ - to_sym
501
+
502
+ Naming/VariableName:
503
+ EnforcedStyle: snake_case
504
+ SupportedStyles:
505
+ - snake_case
506
+ - camelCase
507
+
508
+ Style/WhileUntilModifier:
509
+ Enabled: true
510
+
511
+ Metrics/BlockNesting:
512
+ Max: 3
513
+
514
+ Layout/LineLength:
515
+ Max: 120
516
+ AllowHeredoc: true
517
+ AllowURI: true
518
+ URISchemes:
519
+ - http
520
+ - https
521
+ IgnoreCopDirectives: false
522
+ IgnoredPatterns:
523
+ - '\A\s*(remote_)?test(_\w+)?\s.*(do|->)(\s|\Z)'
524
+
525
+ Metrics/ParameterLists:
526
+ Max: 5
527
+ CountKeywordArgs: false
528
+
529
+ Layout/BlockAlignment:
530
+ EnforcedStyleAlignWith: either
531
+ SupportedStylesAlignWith:
532
+ - either
533
+ - start_of_block
534
+ - start_of_line
535
+
536
+ Layout/EndAlignment:
537
+ EnforcedStyleAlignWith: variable
538
+ SupportedStylesAlignWith:
539
+ - keyword
540
+ - variable
541
+ - start_of_line
542
+
543
+ Layout/DefEndAlignment:
544
+ EnforcedStyleAlignWith: start_of_line
545
+ SupportedStylesAlignWith:
546
+ - start_of_line
547
+ - def
548
+
549
+ Lint/InheritException:
550
+ EnforcedStyle: runtime_error
551
+ SupportedStyles:
552
+ - runtime_error
553
+ - standard_error
554
+
555
+ Lint/UnusedBlockArgument:
556
+ IgnoreEmptyBlocks: true
557
+ AllowUnusedKeywordArguments: false
558
+
559
+ Lint/UnusedMethodArgument:
560
+ AllowUnusedKeywordArguments: false
561
+ IgnoreEmptyMethods: true
562
+
563
+ Naming/AccessorMethodName:
564
+ Enabled: true
565
+
566
+ Layout/ArrayAlignment:
567
+ Enabled: true
568
+
569
+ Style/ArrayJoin:
570
+ Enabled: true
571
+
572
+ Naming/AsciiIdentifiers:
573
+ Enabled: true
574
+
575
+ Style/Attr:
576
+ Enabled: true
577
+
578
+ Style/BeginBlock:
579
+ Enabled: true
580
+
581
+ Style/BlockComments:
582
+ Enabled: true
583
+
584
+ Layout/BlockEndNewline:
585
+ Enabled: true
586
+
587
+ Style/CaseEquality:
588
+ Enabled: true
589
+
590
+ Style/CharacterLiteral:
591
+ Enabled: true
592
+
593
+ Naming/ClassAndModuleCamelCase:
594
+ Enabled: true
595
+
596
+ Style/ClassMethods:
597
+ Enabled: true
598
+
599
+ Style/ClassVars:
600
+ Enabled: true
601
+
602
+ Layout/ClosingParenthesisIndentation:
603
+ Enabled: true
604
+
605
+ Style/ColonMethodCall:
606
+ Enabled: true
607
+
608
+ Layout/CommentIndentation:
609
+ Enabled: true
610
+
611
+ Naming/ConstantName:
612
+ Enabled: true
613
+
614
+ Style/DateTime:
615
+ Enabled: true
616
+
617
+ Style/DefWithParentheses:
618
+ Enabled: true
619
+
620
+ Style/EachForSimpleLoop:
621
+ Enabled: true
622
+
623
+ Style/EachWithObject:
624
+ Enabled: true
625
+
626
+ Layout/ElseAlignment:
627
+ Enabled: true
628
+
629
+ Style/EmptyCaseCondition:
630
+ Enabled: true
631
+
632
+ Layout/EmptyLines:
633
+ Enabled: true
634
+
635
+ Layout/EmptyLinesAroundAccessModifier:
636
+ Enabled: true
637
+
638
+ Layout/EmptyLinesAroundMethodBody:
639
+ Enabled: true
640
+
641
+ Style/EmptyLiteral:
642
+ Enabled: true
643
+
644
+ Style/EndBlock:
645
+ Enabled: true
646
+
647
+ Layout/EndOfLine:
648
+ Enabled: true
649
+
650
+ Style/EvenOdd:
651
+ Enabled: true
652
+
653
+ Layout/InitialIndentation:
654
+ Enabled: true
655
+
656
+ Lint/FlipFlop:
657
+ Enabled: true
658
+
659
+ Style/IfInsideElse:
660
+ Enabled: true
661
+
662
+ Style/IfUnlessModifierOfIfUnless:
663
+ Enabled: true
664
+
665
+ Style/IfWithSemicolon:
666
+ Enabled: true
667
+
668
+ Style/IdenticalConditionalBranches:
669
+ Enabled: true
670
+
671
+ Style/InfiniteLoop:
672
+ Enabled: true
673
+
674
+ Layout/LeadingCommentSpace:
675
+ Enabled: true
676
+
677
+ Style/LineEndConcatenation:
678
+ Enabled: true
679
+
680
+ Style/MethodCallWithoutArgsParentheses:
681
+ Enabled: true
682
+
683
+ Style/MethodMissingSuper:
684
+ Enabled: true
685
+
686
+ Style/MissingRespondToMissing:
687
+ Enabled: true
688
+
689
+ Layout/MultilineBlockLayout:
690
+ Enabled: true
691
+
692
+ Style/MultilineIfThen:
693
+ Enabled: true
694
+
695
+ Style/MultilineMemoization:
696
+ Enabled: true
697
+
698
+ Style/MultilineTernaryOperator:
699
+ Enabled: true
700
+
701
+ Style/NegatedIf:
702
+ Enabled: true
703
+
704
+ Style/NegatedWhile:
705
+ Enabled: true
706
+
707
+ Style/NestedModifier:
708
+ Enabled: true
709
+
710
+ Style/NestedParenthesizedCalls:
711
+ Enabled: true
712
+
713
+ Style/NestedTernaryOperator:
714
+ Enabled: true
715
+
716
+ Style/NilComparison:
717
+ Enabled: true
718
+
719
+ Style/Not:
720
+ Enabled: true
721
+
722
+ Style/OneLineConditional:
723
+ Enabled: true
724
+
725
+ Naming/BinaryOperatorParameterName:
726
+ Enabled: true
727
+
728
+ Style/OptionalArguments:
729
+ Enabled: true
730
+
731
+ Style/ParallelAssignment:
732
+ Enabled: true
733
+
734
+ Style/PerlBackrefs:
735
+ Enabled: true
736
+
737
+ Style/Proc:
738
+ Enabled: true
739
+
740
+ Style/RedundantBegin:
741
+ Enabled: true
742
+
743
+ Style/RedundantException:
744
+ Enabled: true
745
+
746
+ Style/RedundantFreeze:
747
+ Enabled: true
748
+
749
+ Style/RedundantParentheses:
750
+ Enabled: true
751
+
752
+ Style/RedundantSelf:
753
+ Enabled: true
754
+
755
+ Style/RedundantSortBy:
756
+ Enabled: true
757
+
758
+ Layout/RescueEnsureAlignment:
759
+ Enabled: true
760
+
761
+ Style/RescueModifier:
762
+ Enabled: true
763
+
764
+ Style/Sample:
765
+ Enabled: true
766
+
767
+ Style/SelfAssignment:
768
+ Enabled: true
769
+
770
+ Layout/SpaceAfterColon:
771
+ Enabled: true
772
+
773
+ Layout/SpaceAfterComma:
774
+ Enabled: true
775
+
776
+ Layout/SpaceAfterMethodName:
777
+ Enabled: true
778
+
779
+ Layout/SpaceAfterNot:
780
+ Enabled: true
781
+
782
+ Layout/SpaceAfterSemicolon:
783
+ Enabled: true
784
+
785
+ Layout/SpaceBeforeComma:
786
+ Enabled: true
787
+
788
+ Layout/SpaceBeforeComment:
789
+ Enabled: true
790
+
791
+ Layout/SpaceBeforeSemicolon:
792
+ Enabled: true
793
+
794
+ Layout/SpaceAroundKeyword:
795
+ Enabled: true
796
+
797
+ Layout/SpaceInsideArrayPercentLiteral:
798
+ Enabled: true
799
+
800
+ Layout/SpaceInsidePercentLiteralDelimiters:
801
+ Enabled: true
802
+
803
+ Layout/SpaceInsideArrayLiteralBrackets:
804
+ Enabled: true
805
+
806
+ Layout/SpaceInsideParens:
807
+ Enabled: true
808
+
809
+ Layout/SpaceInsideRangeLiteral:
810
+ Enabled: true
811
+
812
+ Style/SymbolLiteral:
813
+ Enabled: true
814
+
815
+ Layout/Tab:
816
+ Enabled: true
817
+
818
+ Layout/TrailingWhitespace:
819
+ Enabled: true
820
+
821
+ Style/UnlessElse:
822
+ Enabled: true
823
+
824
+ Style/RedundantCapitalW:
825
+ Enabled: true
826
+
827
+ Style/RedundantInterpolation:
828
+ Enabled: true
829
+
830
+ Style/RedundantPercentQ:
831
+ Enabled: true
832
+
833
+ Style/VariableInterpolation:
834
+ Enabled: true
835
+
836
+ Style/WhenThen:
837
+ Enabled: true
838
+
839
+ Style/WhileUntilDo:
840
+ Enabled: true
841
+
842
+ Style/ZeroLengthPredicate:
843
+ Enabled: true
844
+
845
+ Layout/HeredocIndentation:
846
+ EnforcedStyle: squiggly
847
+
848
+ Lint/AmbiguousOperator:
849
+ Enabled: true
850
+
851
+ Lint/AmbiguousRegexpLiteral:
852
+ Enabled: true
853
+
854
+ Lint/CircularArgumentReference:
855
+ Enabled: true
856
+
857
+ Layout/ConditionPosition:
858
+ Enabled: true
859
+
860
+ Lint/Debugger:
861
+ Enabled: true
862
+
863
+ Lint/DeprecatedClassMethods:
864
+ Enabled: true
865
+
866
+ Lint/DuplicateMethods:
867
+ Enabled: true
868
+
869
+ Lint/DuplicateHashKey:
870
+ Enabled: true
871
+
872
+ Lint/EachWithObjectArgument:
873
+ Enabled: true
874
+
875
+ Lint/ElseLayout:
876
+ Enabled: true
877
+
878
+ Lint/EmptyEnsure:
879
+ Enabled: true
880
+
881
+ Lint/EmptyInterpolation:
882
+ Enabled: true
883
+
884
+ Lint/EndInMethod:
885
+ Enabled: true
886
+
887
+ Lint/EnsureReturn:
888
+ Enabled: true
889
+
890
+ Lint/FloatOutOfRange:
891
+ Enabled: true
892
+
893
+ Lint/FormatParameterMismatch:
894
+ Enabled: true
895
+
896
+ Lint/SuppressedException:
897
+ AllowComments: true
898
+
899
+ Lint/ImplicitStringConcatenation:
900
+ Description: Checks for adjacent string literals on the same line, which could
901
+ better be represented as a single string literal.
902
+
903
+ Lint/IneffectiveAccessModifier:
904
+ Description: Checks for attempts to use `private` or `protected` to set the visibility
905
+ of a class method, which does not work.
906
+
907
+ Lint/LiteralAsCondition:
908
+ Enabled: true
909
+
910
+ Lint/LiteralInInterpolation:
911
+ Enabled: true
912
+
913
+ Lint/Loop:
914
+ Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
915
+ for post-loop tests.
916
+
917
+ Lint/NestedMethodDefinition:
918
+ Enabled: true
919
+
920
+ Lint/NextWithoutAccumulator:
921
+ Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject`
922
+ block.
923
+
924
+ Lint/NonLocalExitFromIterator:
925
+ Enabled: true
926
+
927
+ Lint/ParenthesesAsGroupedExpression:
928
+ Enabled: true
929
+
930
+ Lint/PercentStringArray:
931
+ Enabled: true
932
+
933
+ Lint/PercentSymbolArray:
934
+ Enabled: true
935
+
936
+ Lint/RandOne:
937
+ Description: Checks for `rand(1)` calls. Such calls always return `0` and most
938
+ likely a mistake.
939
+
940
+ Lint/RequireParentheses:
941
+ Enabled: true
942
+
943
+ Lint/RescueException:
944
+ Enabled: true
945
+
946
+ Lint/ShadowedException:
947
+ Enabled: true
948
+
949
+ Lint/ShadowingOuterLocalVariable:
950
+ Enabled: true
951
+
952
+ Lint/RedundantStringCoercion:
953
+ Enabled: true
954
+
955
+ Lint/UnderscorePrefixedVariableName:
956
+ Enabled: true
957
+
958
+ Lint/UnifiedInteger:
959
+ Enabled: true
960
+
961
+ Lint/RedundantCopDisableDirective:
962
+ Enabled: true
963
+
964
+ Lint/RedundantCopEnableDirective:
965
+ Enabled: true
966
+
967
+ Lint/RedundantSplatExpansion:
968
+ Enabled: true
969
+
970
+ Lint/UnreachableCode:
971
+ Enabled: true
972
+
973
+ Lint/UselessAccessModifier:
974
+ ContextCreatingMethods: []
975
+
976
+ Lint/UselessAssignment:
977
+ Enabled: true
978
+
979
+ Lint/UselessComparison:
980
+ Enabled: true
981
+
982
+ Lint/UselessElseWithoutRescue:
983
+ Enabled: true
984
+
985
+ Lint/UselessSetterCall:
986
+ Enabled: true
987
+
988
+ Lint/Void:
989
+ Enabled: true
990
+
991
+ Security/Eval:
992
+ Enabled: true
993
+
994
+ Security/JSONLoad:
995
+ Enabled: true
996
+
997
+ Security/Open:
998
+ Enabled: true
999
+
1000
+ Lint/BigDecimalNew:
1001
+ Enabled: true
1002
+
1003
+ Style/Strip:
1004
+ Enabled: true
1005
+
1006
+ Style/TrailingBodyOnClass:
1007
+ Enabled: true
1008
+
1009
+ Style/TrailingBodyOnModule:
1010
+ Enabled: true
1011
+
1012
+ Style/TrailingCommaInArrayLiteral:
1013
+ EnforcedStyleForMultiline: comma
1014
+ Enabled: true
1015
+
1016
+ Style/TrailingCommaInHashLiteral:
1017
+ EnforcedStyleForMultiline: comma
1018
+ Enabled: true
1019
+
1020
+ Layout/SpaceInsideReferenceBrackets:
1021
+ EnforcedStyle: no_space
1022
+ EnforcedStyleForEmptyBrackets: no_space
1023
+ Enabled: true
1024
+
1025
+ Style/ModuleFunction:
1026
+ EnforcedStyle: extend_self
1027
+
1028
+ Lint/OrderedMagicComments:
1029
+ Enabled: true
@@ -0,0 +1,6 @@
1
+ inherit_from:
2
+ - https://shopify.github.io/ruby-style-guide/rubocop.yml
3
+ - .rubocop_todo.yml
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 2.3
@@ -0,0 +1,192 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-02-06 13:18:09 -0500 using RuboCop version 0.78.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
12
+ # SupportedStyles: outdent, indent
13
+ Layout/AccessModifierIndentation:
14
+ Exclude:
15
+ - 'examples/http_loader.rb'
16
+
17
+ # Offense count: 5
18
+ # Cop supports --auto-correct.
19
+ # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
20
+ # URISchemes: http, https
21
+ Layout/LineLength:
22
+ Max: 182
23
+
24
+ # Offense count: 4
25
+ # Cop supports --auto-correct.
26
+ # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
27
+ # SupportedStylesForExponentOperator: space, no_space
28
+ Layout/SpaceAroundOperators:
29
+ Exclude:
30
+ - 'test/graphql_test.rb'
31
+
32
+ # Offense count: 6
33
+ # Cop supports --auto-correct.
34
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
35
+ # SupportedStyles: space, no_space
36
+ # SupportedStylesForEmptyBraces: space, no_space
37
+ Layout/SpaceBeforeBlockBraces:
38
+ Exclude:
39
+ - 'test/support/db.rb'
40
+
41
+ # Offense count: 5
42
+ # Cop supports --auto-correct.
43
+ # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
44
+ # SupportedStyles: space, no_space, compact
45
+ # SupportedStylesForEmptyBraces: space, no_space
46
+ Layout/SpaceInsideHashLiteralBraces:
47
+ Exclude:
48
+ - 'test/graphql_test.rb'
49
+ - 'test/multiplex_test.rb'
50
+
51
+ # Offense count: 1
52
+ # Cop supports --auto-correct.
53
+ # Configuration parameters: EnforcedStyle.
54
+ # SupportedStyles: space, no_space
55
+ Layout/SpaceInsideParens:
56
+ Exclude:
57
+ - 'test/loader_test.rb'
58
+
59
+ # Offense count: 5
60
+ # Cop supports --auto-correct.
61
+ # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
62
+ Lint/UnusedBlockArgument:
63
+ Exclude:
64
+ - 'lib/graphql/batch.rb'
65
+ - 'test/support/db.rb'
66
+ - 'test/support/loaders.rb'
67
+ - 'test/support/schema.rb'
68
+
69
+ # Offense count: 6
70
+ # Cop supports --auto-correct.
71
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
72
+ Lint/UnusedMethodArgument:
73
+ Exclude:
74
+ - 'lib/graphql/batch/loader.rb'
75
+ - 'lib/graphql/batch/setup.rb'
76
+ - 'lib/graphql/batch/setup_multiplex.rb'
77
+ - 'test/executor_test.rb'
78
+
79
+ # Offense count: 2
80
+ Lint/UselessAssignment:
81
+ Exclude:
82
+ - 'test/loader_test.rb'
83
+
84
+ # Offense count: 1
85
+ # Configuration parameters: CountBlocks.
86
+ Metrics/BlockNesting:
87
+ Max: 4
88
+
89
+ # Offense count: 1
90
+ # Cop supports --auto-correct.
91
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners.
92
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
93
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
94
+ # FunctionalMethods: let, let!, subject, watch
95
+ # IgnoredMethods: lambda, proc, it
96
+ Style/BlockDelimiters:
97
+ Exclude:
98
+ - 'test/support/db.rb'
99
+
100
+ # Offense count: 11
101
+ # Cop supports --auto-correct.
102
+ # Configuration parameters: AutoCorrect, EnforcedStyle.
103
+ # SupportedStyles: nested, compact
104
+ Style/ClassAndModuleChildren:
105
+ Exclude:
106
+ - 'lib/graphql/batch/executor.rb'
107
+ - 'lib/graphql/batch/loader.rb'
108
+ - 'lib/graphql/batch/mutation_field_extension.rb'
109
+ - 'lib/graphql/batch/setup.rb'
110
+ - 'lib/graphql/batch/setup_multiplex.rb'
111
+ - 'test/batch_test.rb'
112
+ - 'test/custom_executor_test.rb'
113
+ - 'test/executor_test.rb'
114
+ - 'test/graphql_test.rb'
115
+ - 'test/loader_test.rb'
116
+ - 'test/multiplex_test.rb'
117
+
118
+ # Offense count: 1
119
+ # Cop supports --auto-correct.
120
+ # Configuration parameters: EnforcedStyle, AllowInnerBackticks.
121
+ # SupportedStyles: backticks, percent_x, mixed
122
+ Style/CommandLiteral:
123
+ Exclude:
124
+ - 'graphql-batch.gemspec'
125
+
126
+ # Offense count: 2
127
+ # Cop supports --auto-correct.
128
+ Style/EmptyLiteral:
129
+ Exclude:
130
+ - 'test/support/schema.rb'
131
+
132
+ # Offense count: 24
133
+ # Cop supports --auto-correct.
134
+ # Configuration parameters: EnforcedStyle.
135
+ # SupportedStyles: always, never
136
+ Style/FrozenStringLiteralComment:
137
+ Enabled: false
138
+
139
+ # Offense count: 72
140
+ # Cop supports --auto-correct.
141
+ # Configuration parameters: IgnoreMacros, IgnoredMethods, IgnoredPatterns, IncludedMacros, AllowParenthesesInMultilineCall, AllowParenthesesInChaining, AllowParenthesesInCamelCaseMethod, EnforcedStyle.
142
+ # SupportedStyles: require_parentheses, omit_parentheses
143
+ Style/MethodCallWithArgsParentheses:
144
+ Exclude:
145
+ - 'Gemfile'
146
+ - 'graphql-batch.gemspec'
147
+ - 'test/batch_test.rb'
148
+ - 'test/custom_executor_test.rb'
149
+ - 'test/executor_test.rb'
150
+ - 'test/graphql_test.rb'
151
+ - 'test/loader_test.rb'
152
+ - 'test/multiplex_test.rb'
153
+ - 'test/support/schema.rb'
154
+ - 'test/test_helper.rb'
155
+
156
+ # Offense count: 1
157
+ # Cop supports --auto-correct.
158
+ Style/RedundantBegin:
159
+ Exclude:
160
+ - 'lib/graphql/batch.rb'
161
+
162
+ # Offense count: 1
163
+ # Cop supports --auto-correct.
164
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
165
+ # AllowedMethods: present?, blank?, presence, try, try!
166
+ Style/SafeNavigation:
167
+ Exclude:
168
+ - 'test/support/db.rb'
169
+
170
+ # Offense count: 1
171
+ # Cop supports --auto-correct.
172
+ # Configuration parameters: AllowAsExpressionSeparator.
173
+ Style/Semicolon:
174
+ Exclude:
175
+ - 'test/support/schema.rb'
176
+
177
+ # Offense count: 3
178
+ # Cop supports --auto-correct.
179
+ # Configuration parameters: EnforcedStyleForMultiline.
180
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
181
+ Style/TrailingCommaInArrayLiteral:
182
+ Exclude:
183
+ - 'test/graphql_test.rb'
184
+
185
+ # Offense count: 23
186
+ # Cop supports --auto-correct.
187
+ # Configuration parameters: EnforcedStyleForMultiline.
188
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
189
+ Style/TrailingCommaInHashLiteral:
190
+ Exclude:
191
+ - 'test/graphql_test.rb'
192
+ - 'test/multiplex_test.rb'
@@ -1,7 +1,11 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.3
4
- - 2.6
4
+ - 2.7
5
5
  env:
6
- - TESTING_INTERPRETER=true
7
- - TESTING_INTERPRETER=false
6
+ -
7
+ GRAPHQL_VERSION: 1.9.19
8
+ TESTING_LEGACY_DEFINITION_LAYER: true
9
+ -
10
+ GRAPHQL_VERSION: 1.10.2
11
+ TESTING_LEGACY_DEFINITION_LAYER: false
data/Gemfile CHANGED
@@ -2,6 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- if ENV["TESTING_INTERPRETER"] == "true"
6
- gem "graphql", "1.10.0.pre2"
7
- end
5
+ gem 'graphql', ENV['GRAPHQL_VERSION'] if ENV['GRAPHQL_VERSION']
6
+ gem 'rubocop', '~> 0.78.0', require: false
data/Rakefile CHANGED
@@ -7,4 +7,9 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList['test/**/*_test.rb']
8
8
  end
9
9
 
10
- task :default => :test
10
+ task :rubocop do
11
+ require 'rubocop/rake_task'
12
+ RuboCop::RakeTask.new
13
+ end
14
+
15
+ task(default: [:test, :rubocop])
@@ -18,10 +18,12 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
22
+
21
23
  spec.add_runtime_dependency "graphql", ">= 1.3", "< 2"
22
24
  spec.add_runtime_dependency "promise.rb", "~> 0.7.2"
23
25
 
24
26
  spec.add_development_dependency "byebug" if RUBY_ENGINE == 'ruby'
25
- spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rake", ">= 12.3.3"
26
28
  spec.add_development_dependency "minitest"
27
29
  end
@@ -1,21 +1,20 @@
1
1
  module GraphQL::Batch
2
2
  class Loader
3
- def self.for(*group_args)
4
- loader_key = loader_key_for(*group_args)
5
- executor = Executor.current
6
-
7
- unless executor
8
- raise GraphQL::Batch::NoExecutorError, 'Cannot create loader without'\
9
- ' an Executor. Wrap the call to `for` with `GraphQL::Batch.batch`'\
10
- ' or use `GraphQL::Batch::Setup` as a query instrumenter if'\
11
- ' using with `graphql-ruby`'
3
+ # Use new argument forwarding syntax if available as an optimization
4
+ if RUBY_ENGINE && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7")
5
+ class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
6
+ def self.for(...)
7
+ current_executor.loader(loader_key_for(...)) { new(...) }
8
+ end
9
+ RUBY
10
+ else
11
+ def self.for(*group_args)
12
+ current_executor.loader(loader_key_for(*group_args)) { new(*group_args) }
12
13
  end
13
-
14
- executor.loader(loader_key) { new(*group_args) }
15
14
  end
16
15
 
17
- def self.loader_key_for(*group_args)
18
- [self].concat(group_args)
16
+ def self.loader_key_for(*group_args, **group_kwargs)
17
+ [self, group_kwargs, group_args]
19
18
  end
20
19
 
21
20
  def self.load(key)
@@ -26,6 +25,23 @@ module GraphQL::Batch
26
25
  self.for.load_many(keys)
27
26
  end
28
27
 
28
+ class << self
29
+ private
30
+
31
+ def current_executor
32
+ executor = Executor.current
33
+
34
+ unless executor
35
+ raise GraphQL::Batch::NoExecutorError, 'Cannot create loader without'\
36
+ ' an Executor. Wrap the call to `for` with `GraphQL::Batch.batch`'\
37
+ ' or use `GraphQL::Batch::Setup` as a query instrumenter if'\
38
+ ' using with `graphql-ruby`'
39
+ end
40
+
41
+ executor
42
+ end
43
+ end
44
+
29
45
  attr_accessor :loader_key, :executor
30
46
 
31
47
  def load(key)
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Batch
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-batch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Thacker-Smith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-09 00:00:00.000000000 Z
11
+ date: 2020-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -62,16 +62,16 @@ dependencies:
62
62
  name: rake
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: '10.0'
67
+ version: 12.3.3
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '10.0'
74
+ version: 12.3.3
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: minitest
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -94,6 +94,9 @@ extensions: []
94
94
  extra_rdoc_files: []
95
95
  files:
96
96
  - ".gitignore"
97
+ - ".rubocop-https---shopify-github-io-ruby-style-guide-rubocop-yml"
98
+ - ".rubocop.yml"
99
+ - ".rubocop_todo.yml"
97
100
  - ".travis.yml"
98
101
  - CONTRIBUTING.md
99
102
  - Gemfile
@@ -116,7 +119,8 @@ files:
116
119
  homepage: https://github.com/Shopify/graphql-batch
117
120
  licenses:
118
121
  - MIT
119
- metadata: {}
122
+ metadata:
123
+ allowed_push_host: https://rubygems.org
120
124
  post_install_message:
121
125
  rdoc_options: []
122
126
  require_paths: