openfeature-sdk-sorbet 0.2.0.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -1
- data/.ruby-version +1 -1
- data/.tool-versions +1 -1
- data/CHANGELOG.md +9 -6
- data/Gemfile +1 -1
- data/Gemfile.lock +55 -49
- data/README.md +23 -6
- data/lib/open_feature/client.rb +90 -32
- data/lib/open_feature/client_metadata.rb +1 -0
- data/lib/open_feature/evaluation_context.rb +7 -5
- data/lib/open_feature/evaluation_details.rb +2 -2
- data/lib/open_feature/hook.rb +41 -1
- data/lib/open_feature/hook_context.rb +30 -0
- data/lib/open_feature/hooks.rb +22 -0
- data/lib/open_feature/multiple_source_provider.rb +28 -12
- data/lib/open_feature/no_op_provider.rb +2 -3
- data/lib/open_feature/provider.rb +16 -2
- data/lib/open_feature/provider_status.rb +13 -0
- data/lib/open_feature.rb +9 -2
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/{json@2.6.3.rbi → json@2.7.1.rbi} +80 -60
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
- data/sorbet/rbi/gems/{minitest@5.18.0.rbi → minitest@5.21.2.rbi} +299 -258
- data/sorbet/rbi/gems/{parallel@1.23.0.rbi → parallel@1.24.0.rbi} +8 -1
- data/sorbet/rbi/gems/{parser@3.2.2.1.rbi → parser@3.3.0.5.rbi} +438 -2219
- data/sorbet/rbi/gems/prism@0.19.0.rbi +25199 -0
- data/sorbet/rbi/gems/psych@5.1.2.rbi +1731 -0
- data/sorbet/rbi/gems/racc@1.7.3.rbi +157 -0
- data/sorbet/rbi/gems/{rake@13.0.6.rbi → rake@13.1.0.rbi} +68 -65
- data/sorbet/rbi/gems/{rbi@0.0.16.rbi → rbi@0.1.6.rbi} +628 -755
- data/sorbet/rbi/gems/{regexp_parser@2.8.0.rbi → regexp_parser@2.9.0.rbi} +203 -180
- data/sorbet/rbi/gems/{rexml@3.2.5.rbi → rexml@3.2.6.rbi} +116 -52
- data/sorbet/rbi/gems/{rubocop-ast@1.28.1.rbi → rubocop-ast@1.30.0.rbi} +178 -84
- data/sorbet/rbi/gems/{rubocop-minitest@0.31.0.rbi → rubocop-minitest@0.34.5.rbi} +280 -232
- data/sorbet/rbi/gems/{rubocop-performance@1.17.1.rbi → rubocop-performance@1.20.2.rbi} +397 -172
- data/sorbet/rbi/gems/{rubocop-sorbet@0.7.0.rbi → rubocop-sorbet@0.7.6.rbi} +728 -261
- data/sorbet/rbi/gems/{rubocop@1.51.0.rbi → rubocop@1.60.2.rbi} +4006 -1936
- data/sorbet/rbi/gems/spoom@1.2.1.rbi +17 -56
- data/sorbet/rbi/gems/stringio@3.1.0.rbi +8 -0
- data/sorbet/rbi/gems/{tapioca@0.11.6.rbi → tapioca@0.11.17.rbi} +778 -576
- data/sorbet/rbi/gems/{thor@1.2.2.rbi → thor@1.3.0.rbi} +775 -395
- data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +1 -1
- data/sorbet/rbi/gems/yard@0.9.34.rbi +2 -2
- data/sorbet/rbi/gems/{zeitwerk@2.6.8.rbi → zeitwerk@2.6.12.rbi} +78 -67
- data/sorbet/tapioca/config.yml +2 -2
- data/sorbet/tapioca/require.rb +3 -1
- metadata +36 -31
- data/openfeature-sdk-sorbet.gemspec +0 -35
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1083
- data/sorbet/rbi/gems/irb@1.6.4.rbi +0 -342
- data/sorbet/rbi/gems/unparser@0.6.7.rbi +0 -4524
- /data/sorbet/rbi/gems/{io-console@0.6.0.rbi → io-console@0.7.2.rbi} +0 -0
- /data/sorbet/rbi/gems/{reline@0.3.3.rbi → reline@0.4.2.rbi} +0 -0
- /data/sorbet/rbi/gems/{unicode-display_width@2.4.2.rbi → unicode-display_width@2.5.0.rbi} +0 -0
@@ -10,6 +10,35 @@ module RuboCop; end
|
|
10
10
|
# source://rubocop-performance//lib/rubocop/cop/mixin/regexp_metacharacter.rb#4
|
11
11
|
module RuboCop::Cop; end
|
12
12
|
|
13
|
+
module RuboCop::Cop::Lint; end
|
14
|
+
|
15
|
+
class RuboCop::Cop::Lint::UnusedMethodArgument < ::RuboCop::Cop::Base
|
16
|
+
# source://rubocop/1.60.2/lib/rubocop/cop/lint/unused_method_argument.rb#66
|
17
|
+
def not_implemented?(param0 = T.unsafe(nil)); end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
# source://rubocop/1.60.2/lib/rubocop/cop/lint/unused_method_argument.rb#81
|
22
|
+
def autocorrect(corrector, node); end
|
23
|
+
|
24
|
+
# source://rubocop/1.60.2/lib/rubocop/cop/lint/unused_method_argument.rb#85
|
25
|
+
def check_argument(variable); end
|
26
|
+
|
27
|
+
# source://rubocop/1.60.2/lib/rubocop/cop/lint/unused_method_argument.rb#93
|
28
|
+
def ignored_method?(body); end
|
29
|
+
|
30
|
+
# source://rubocop/1.60.2/lib/rubocop/cop/lint/unused_method_argument.rb#98
|
31
|
+
def message(variable); end
|
32
|
+
|
33
|
+
class << self
|
34
|
+
# source://rubocop-performance//lib/rubocop-performance.rb#15
|
35
|
+
def autocorrect_incompatible_with; end
|
36
|
+
|
37
|
+
# source://rubocop/1.60.2/lib/rubocop/cop/lint/unused_method_argument.rb#75
|
38
|
+
def joining_forces; end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
13
42
|
# source://rubocop-performance//lib/rubocop/cop/performance/ancestors_include.rb#5
|
14
43
|
module RuboCop::Cop::Performance; end
|
15
44
|
|
@@ -77,12 +106,15 @@ class RuboCop::Cop::Performance::ArraySemiInfiniteRangeSlice < ::RuboCop::Cop::B
|
|
77
106
|
# source://rubocop-performance//lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb#41
|
78
107
|
def endless_range_slice?(param0 = T.unsafe(nil)); end
|
79
108
|
|
109
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb#52
|
110
|
+
def on_csend(node); end
|
111
|
+
|
80
112
|
# source://rubocop-performance//lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb#52
|
81
113
|
def on_send(node); end
|
82
114
|
|
83
115
|
private
|
84
116
|
|
85
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb#
|
117
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/array_semi_infinite_range_slice.rb#66
|
86
118
|
def correction(receiver, range_node); end
|
87
119
|
end
|
88
120
|
|
@@ -208,6 +240,11 @@ class RuboCop::Cop::Performance::BlockGivenWithExplicitBlock < ::RuboCop::Cop::B
|
|
208
240
|
|
209
241
|
# source://rubocop-performance//lib/rubocop/cop/performance/block_given_with_explicit_block.rb#33
|
210
242
|
def reassigns_block_arg?(param0 = T.unsafe(nil), param1); end
|
243
|
+
|
244
|
+
class << self
|
245
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/block_given_with_explicit_block.rb#51
|
246
|
+
def autocorrect_incompatible_with; end
|
247
|
+
end
|
211
248
|
end
|
212
249
|
|
213
250
|
# source://rubocop-performance//lib/rubocop/cop/performance/block_given_with_explicit_block.rb#31
|
@@ -580,56 +617,63 @@ RuboCop::Cop::Performance::CollectionLiteralInLoop::POST_CONDITION_LOOP_TYPES =
|
|
580
617
|
|
581
618
|
# Identifies places where `sort { |a, b| a.foo <=> b.foo }`
|
582
619
|
# can be replaced by `sort_by(&:foo)`.
|
583
|
-
# This cop also checks `max` and `
|
620
|
+
# This cop also checks `sort!`, `min`, `max` and `minmax` methods.
|
584
621
|
#
|
585
622
|
# @example
|
586
623
|
# # bad
|
587
|
-
# array.sort
|
588
|
-
# array.
|
589
|
-
# array.
|
590
|
-
# array.
|
624
|
+
# array.sort { |a, b| a.foo <=> b.foo }
|
625
|
+
# array.sort! { |a, b| a.foo <=> b.foo }
|
626
|
+
# array.max { |a, b| a.foo <=> b.foo }
|
627
|
+
# array.min { |a, b| a.foo <=> b.foo }
|
628
|
+
# array.minmax { |a, b| a.foo <=> b.foo }
|
629
|
+
# array.sort { |a, b| a[:foo] <=> b[:foo] }
|
591
630
|
#
|
592
631
|
# # good
|
593
632
|
# array.sort_by(&:foo)
|
633
|
+
# array.sort_by!(&:foo)
|
594
634
|
# array.sort_by { |v| v.foo }
|
595
635
|
# array.sort_by do |var|
|
596
636
|
# var.foo
|
597
637
|
# end
|
598
638
|
# array.max_by(&:foo)
|
599
639
|
# array.min_by(&:foo)
|
640
|
+
# array.minmax_by(&:foo)
|
600
641
|
# array.sort_by { |a| a[:foo] }
|
601
642
|
#
|
602
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#
|
643
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#30
|
603
644
|
class RuboCop::Cop::Performance::CompareWithBlock < ::RuboCop::Cop::Base
|
604
645
|
include ::RuboCop::Cop::RangeHelp
|
605
646
|
extend ::RuboCop::Cop::AutoCorrector
|
606
647
|
|
607
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#
|
648
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#41
|
608
649
|
def compare?(param0 = T.unsafe(nil)); end
|
609
650
|
|
610
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#
|
651
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#55
|
611
652
|
def on_block(node); end
|
612
653
|
|
613
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#
|
654
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#48
|
614
655
|
def replaceable_body?(param0 = T.unsafe(nil), param1, param2); end
|
615
656
|
|
616
657
|
private
|
617
658
|
|
618
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#
|
659
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#114
|
619
660
|
def compare_range(send, node); end
|
620
661
|
|
621
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#
|
662
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#91
|
622
663
|
def message(send, method, var_a, var_b, args); end
|
623
664
|
|
624
665
|
# @return [Boolean]
|
625
666
|
#
|
626
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#
|
667
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#76
|
627
668
|
def slow_compare?(method, args_a, args_b); end
|
628
669
|
end
|
629
670
|
|
630
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#
|
671
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#34
|
631
672
|
RuboCop::Cop::Performance::CompareWithBlock::MSG = T.let(T.unsafe(nil), String)
|
632
673
|
|
674
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/compare_with_block.rb#38
|
675
|
+
RuboCop::Cop::Performance::CompareWithBlock::REPLACEMENT = T.let(T.unsafe(nil), Hash)
|
676
|
+
|
633
677
|
# Identifies places where `Concurrent.monotonic_time`
|
634
678
|
# can be replaced by `Process.clock_gettime(Process::CLOCK_MONOTONIC)`.
|
635
679
|
#
|
@@ -692,23 +736,28 @@ RuboCop::Cop::Performance::ConcurrentMonotonicTime::RESTRICT_ON_SEND = T.let(T.u
|
|
692
736
|
class RuboCop::Cop::Performance::ConstantRegexp < ::RuboCop::Cop::Base
|
693
737
|
extend ::RuboCop::Cop::AutoCorrector
|
694
738
|
|
695
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#
|
739
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#45
|
696
740
|
def on_regexp(node); end
|
697
741
|
|
698
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#
|
742
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#59
|
699
743
|
def regexp_escape?(param0 = T.unsafe(nil)); end
|
700
744
|
|
701
745
|
private
|
702
746
|
|
703
747
|
# @return [Boolean]
|
704
748
|
#
|
705
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#
|
749
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#64
|
706
750
|
def include_interpolated_const?(node); end
|
707
751
|
|
708
752
|
# @return [Boolean]
|
709
753
|
#
|
710
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#
|
754
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#55
|
711
755
|
def within_allowed_assignment?(node); end
|
756
|
+
|
757
|
+
class << self
|
758
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#41
|
759
|
+
def autocorrect_incompatible_with; end
|
760
|
+
end
|
712
761
|
end
|
713
762
|
|
714
763
|
# source://rubocop-performance//lib/rubocop/cop/performance/constant_regexp.rb#39
|
@@ -736,15 +785,18 @@ RuboCop::Cop::Performance::ConstantRegexp::MSG = T.let(T.unsafe(nil), String)
|
|
736
785
|
# Model.select('field AS field_one').count
|
737
786
|
# Model.select(:value).count
|
738
787
|
#
|
739
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#
|
788
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#48
|
740
789
|
class RuboCop::Cop::Performance::Count < ::RuboCop::Cop::Base
|
741
790
|
include ::RuboCop::Cop::RangeHelp
|
742
791
|
extend ::RuboCop::Cop::AutoCorrector
|
743
792
|
|
744
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#
|
793
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#55
|
745
794
|
def count_candidate?(param0 = T.unsafe(nil)); end
|
746
795
|
|
747
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#
|
796
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#62
|
797
|
+
def on_csend(node); end
|
798
|
+
|
799
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#62
|
748
800
|
def on_send(node); end
|
749
801
|
|
750
802
|
private
|
@@ -776,10 +828,10 @@ class RuboCop::Cop::Performance::Count < ::RuboCop::Cop::Base
|
|
776
828
|
def source_starting_at(node); end
|
777
829
|
end
|
778
830
|
|
779
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#
|
831
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#52
|
780
832
|
RuboCop::Cop::Performance::Count::MSG = T.let(T.unsafe(nil), String)
|
781
833
|
|
782
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#
|
834
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/count.rb#53
|
783
835
|
RuboCop::Cop::Performance::Count::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
784
836
|
|
785
837
|
# In Ruby 2.5, `String#delete_prefix` has been added.
|
@@ -829,7 +881,10 @@ class RuboCop::Cop::Performance::DeletePrefix < ::RuboCop::Cop::Base
|
|
829
881
|
# source://rubocop-performance//lib/rubocop/cop/performance/delete_prefix.rb#66
|
830
882
|
def delete_prefix_candidate?(param0 = T.unsafe(nil)); end
|
831
883
|
|
832
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/delete_prefix.rb#
|
884
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/delete_prefix.rb#71
|
885
|
+
def on_csend(node); end
|
886
|
+
|
887
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/delete_prefix.rb#71
|
833
888
|
def on_send(node); end
|
834
889
|
end
|
835
890
|
|
@@ -889,7 +944,10 @@ class RuboCop::Cop::Performance::DeleteSuffix < ::RuboCop::Cop::Base
|
|
889
944
|
# source://rubocop-performance//lib/rubocop/cop/performance/delete_suffix.rb#66
|
890
945
|
def delete_suffix_candidate?(param0 = T.unsafe(nil)); end
|
891
946
|
|
892
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/delete_suffix.rb#
|
947
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/delete_suffix.rb#71
|
948
|
+
def on_csend(node); end
|
949
|
+
|
950
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/delete_suffix.rb#71
|
893
951
|
def on_send(node); end
|
894
952
|
end
|
895
953
|
|
@@ -928,6 +986,9 @@ class RuboCop::Cop::Performance::Detect < ::RuboCop::Cop::Base
|
|
928
986
|
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#41
|
929
987
|
def detect_candidate?(param0 = T.unsafe(nil)); end
|
930
988
|
|
989
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#50
|
990
|
+
def on_csend(node); end
|
991
|
+
|
931
992
|
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#50
|
932
993
|
def on_send(node); end
|
933
994
|
|
@@ -935,27 +996,27 @@ class RuboCop::Cop::Performance::Detect < ::RuboCop::Cop::Base
|
|
935
996
|
|
936
997
|
# @return [Boolean]
|
937
998
|
#
|
938
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#
|
999
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#70
|
939
1000
|
def accept_first_call?(receiver, body); end
|
940
1001
|
|
941
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#
|
1002
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#102
|
942
1003
|
def autocorrect(corrector, node, replacement); end
|
943
1004
|
|
944
1005
|
# @return [Boolean]
|
945
1006
|
#
|
946
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#
|
1007
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#128
|
947
1008
|
def lazy?(node); end
|
948
1009
|
|
949
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#
|
1010
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#113
|
950
1011
|
def message_for_method(method, index); end
|
951
1012
|
|
952
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#
|
1013
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#124
|
953
1014
|
def preferred_method; end
|
954
1015
|
|
955
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#
|
1016
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#79
|
956
1017
|
def register_offense(node, receiver, second_method, index); end
|
957
1018
|
|
958
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#
|
1019
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/detect.rb#94
|
959
1020
|
def replacement(method, index); end
|
960
1021
|
end
|
961
1022
|
|
@@ -1087,6 +1148,9 @@ class RuboCop::Cop::Performance::EndWith < ::RuboCop::Cop::Base
|
|
1087
1148
|
include ::RuboCop::Cop::RegexpMetacharacter
|
1088
1149
|
extend ::RuboCop::Cop::AutoCorrector
|
1089
1150
|
|
1151
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/end_with.rb#62
|
1152
|
+
def on_csend(node); end
|
1153
|
+
|
1090
1154
|
# source://rubocop-performance//lib/rubocop/cop/performance/end_with.rb#62
|
1091
1155
|
def on_match_with_lvasgn(node); end
|
1092
1156
|
|
@@ -1150,6 +1214,9 @@ class RuboCop::Cop::Performance::FixedSize < ::RuboCop::Cop::Base
|
|
1150
1214
|
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#52
|
1151
1215
|
def counter(param0 = T.unsafe(nil)); end
|
1152
1216
|
|
1217
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#56
|
1218
|
+
def on_csend(node); end
|
1219
|
+
|
1153
1220
|
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#56
|
1154
1221
|
def on_send(node); end
|
1155
1222
|
|
@@ -1157,32 +1224,32 @@ class RuboCop::Cop::Performance::FixedSize < ::RuboCop::Cop::Base
|
|
1157
1224
|
|
1158
1225
|
# @return [Boolean]
|
1159
1226
|
#
|
1160
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#
|
1227
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#73
|
1161
1228
|
def allowed_argument?(arg); end
|
1162
1229
|
|
1163
1230
|
# @return [Boolean]
|
1164
1231
|
#
|
1165
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#
|
1232
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#77
|
1166
1233
|
def allowed_parent?(node); end
|
1167
1234
|
|
1168
1235
|
# @return [Boolean]
|
1169
1236
|
#
|
1170
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#
|
1237
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#69
|
1171
1238
|
def allowed_variable?(var); end
|
1172
1239
|
|
1173
1240
|
# @return [Boolean]
|
1174
1241
|
#
|
1175
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#
|
1242
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#87
|
1176
1243
|
def contains_double_splat?(node); end
|
1177
1244
|
|
1178
1245
|
# @return [Boolean]
|
1179
1246
|
#
|
1180
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#
|
1247
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#81
|
1181
1248
|
def contains_splat?(node); end
|
1182
1249
|
|
1183
1250
|
# @return [Boolean]
|
1184
1251
|
#
|
1185
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#
|
1252
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/fixed_size.rb#93
|
1186
1253
|
def non_string_argument?(node); end
|
1187
1254
|
end
|
1188
1255
|
|
@@ -1213,21 +1280,24 @@ class RuboCop::Cop::Performance::FlatMap < ::RuboCop::Cop::Base
|
|
1213
1280
|
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#28
|
1214
1281
|
def flat_map_candidate?(param0 = T.unsafe(nil)); end
|
1215
1282
|
|
1283
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#39
|
1284
|
+
def on_csend(node); end
|
1285
|
+
|
1216
1286
|
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#39
|
1217
1287
|
def on_send(node); end
|
1218
1288
|
|
1219
1289
|
private
|
1220
1290
|
|
1221
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#
|
1291
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#73
|
1222
1292
|
def autocorrect(corrector, node); end
|
1223
1293
|
|
1224
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#
|
1294
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#53
|
1225
1295
|
def offense_for_levels(node, map_node, first_method, flatten); end
|
1226
1296
|
|
1227
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#
|
1297
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#59
|
1228
1298
|
def offense_for_method(node, map_node, first_method, flatten); end
|
1229
1299
|
|
1230
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#
|
1300
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/flat_map.rb#63
|
1231
1301
|
def register_offense(node, map_node, first_method, flatten, message); end
|
1232
1302
|
end
|
1233
1303
|
|
@@ -1280,27 +1350,36 @@ class RuboCop::Cop::Performance::InefficientHashSearch < ::RuboCop::Cop::Base
|
|
1280
1350
|
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#47
|
1281
1351
|
def inefficient_include?(param0 = T.unsafe(nil)); end
|
1282
1352
|
|
1353
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#51
|
1354
|
+
def on_csend(node); end
|
1355
|
+
|
1283
1356
|
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#51
|
1284
1357
|
def on_send(node); end
|
1285
1358
|
|
1286
1359
|
private
|
1287
1360
|
|
1288
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#
|
1289
|
-
def
|
1361
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#91
|
1362
|
+
def correct_argument(node); end
|
1363
|
+
|
1364
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#99
|
1365
|
+
def correct_dot(node); end
|
1290
1366
|
|
1291
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#
|
1292
|
-
def
|
1367
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#95
|
1368
|
+
def correct_hash_expression(node); end
|
1293
1369
|
|
1294
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#
|
1295
|
-
def
|
1370
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#75
|
1371
|
+
def correct_method(node); end
|
1296
1372
|
|
1297
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#
|
1373
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#82
|
1298
1374
|
def current_method(node); end
|
1299
1375
|
|
1300
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#
|
1376
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#67
|
1301
1377
|
def message(node); end
|
1302
1378
|
|
1303
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#
|
1379
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#71
|
1380
|
+
def replacement(node); end
|
1381
|
+
|
1382
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/inefficient_hash_search.rb#86
|
1304
1383
|
def use_long_method; end
|
1305
1384
|
end
|
1306
1385
|
|
@@ -1398,30 +1477,33 @@ class RuboCop::Cop::Performance::MapCompact < ::RuboCop::Cop::Base
|
|
1398
1477
|
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#40
|
1399
1478
|
def map_compact(param0 = T.unsafe(nil)); end
|
1400
1479
|
|
1480
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#53
|
1481
|
+
def on_csend(node); end
|
1482
|
+
|
1401
1483
|
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#53
|
1402
1484
|
def on_send(node); end
|
1403
1485
|
|
1404
1486
|
private
|
1405
1487
|
|
1406
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#
|
1488
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#94
|
1407
1489
|
def compact_method_with_final_newline_range(compact_method_range); end
|
1408
1490
|
|
1409
1491
|
# @return [Boolean]
|
1410
1492
|
#
|
1411
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#
|
1493
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#90
|
1412
1494
|
def invoke_method_after_map_compact_on_same_line?(compact_node, chained_method); end
|
1413
1495
|
|
1414
1496
|
# @return [Boolean]
|
1415
1497
|
#
|
1416
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#
|
1498
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#86
|
1417
1499
|
def map_method_and_compact_method_on_same_line?(map_node, compact_node); end
|
1418
1500
|
|
1419
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#
|
1501
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#68
|
1420
1502
|
def remove_compact_method(corrector, map_node, compact_node, chained_method); end
|
1421
1503
|
|
1422
1504
|
# @return [Boolean]
|
1423
1505
|
#
|
1424
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#
|
1506
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#82
|
1425
1507
|
def use_dot?(node); end
|
1426
1508
|
end
|
1427
1509
|
|
@@ -1431,6 +1513,59 @@ RuboCop::Cop::Performance::MapCompact::MSG = T.let(T.unsafe(nil), String)
|
|
1431
1513
|
# source://rubocop-performance//lib/rubocop/cop/performance/map_compact.rb#36
|
1432
1514
|
RuboCop::Cop::Performance::MapCompact::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1433
1515
|
|
1516
|
+
# Checks if the map method is used in a chain.
|
1517
|
+
#
|
1518
|
+
# Autocorrection is not supported because an appropriate block variable name cannot be determined automatically.
|
1519
|
+
#
|
1520
|
+
# [source,ruby]
|
1521
|
+
# ----
|
1522
|
+
# class X
|
1523
|
+
# def initialize
|
1524
|
+
# @@num = 0
|
1525
|
+
# end
|
1526
|
+
#
|
1527
|
+
# def foo
|
1528
|
+
# @@num += 1
|
1529
|
+
# self
|
1530
|
+
# end
|
1531
|
+
#
|
1532
|
+
# def bar
|
1533
|
+
# @@num * 2
|
1534
|
+
# end
|
1535
|
+
# end
|
1536
|
+
#
|
1537
|
+
# [X.new, X.new].map(&:foo).map(&:bar) # => [4, 4]
|
1538
|
+
# [X.new, X.new].map { |x| x.foo.bar } # => [2, 4]
|
1539
|
+
# ----
|
1540
|
+
#
|
1541
|
+
# @example
|
1542
|
+
#
|
1543
|
+
# # bad
|
1544
|
+
# array.map(&:foo).map(&:bar)
|
1545
|
+
#
|
1546
|
+
# # good
|
1547
|
+
# array.map { |item| item.foo.bar }
|
1548
|
+
#
|
1549
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_method_chain.rb#43
|
1550
|
+
class RuboCop::Cop::Performance::MapMethodChain < ::RuboCop::Cop::Base
|
1551
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_method_chain.rb#49
|
1552
|
+
def block_pass_with_symbol_arg?(param0 = T.unsafe(nil)); end
|
1553
|
+
|
1554
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_method_chain.rb#53
|
1555
|
+
def on_send(node); end
|
1556
|
+
|
1557
|
+
private
|
1558
|
+
|
1559
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_method_chain.rb#72
|
1560
|
+
def find_begin_of_chained_map_method(node, map_args); end
|
1561
|
+
end
|
1562
|
+
|
1563
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_method_chain.rb#46
|
1564
|
+
RuboCop::Cop::Performance::MapMethodChain::MSG = T.let(T.unsafe(nil), String)
|
1565
|
+
|
1566
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/map_method_chain.rb#47
|
1567
|
+
RuboCop::Cop::Performance::MapMethodChain::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1568
|
+
|
1434
1569
|
# Identifies places where methods are converted to blocks, with the
|
1435
1570
|
# use of `&method`, and passed as arguments to method calls.
|
1436
1571
|
# It is faster to replace those with explicit blocks, calling those methods inside.
|
@@ -1509,26 +1644,24 @@ RuboCop::Cop::Performance::OpenStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), A
|
|
1509
1644
|
# # good
|
1510
1645
|
# ('a'..'z').cover?('b') # => true
|
1511
1646
|
#
|
1512
|
-
#
|
1513
|
-
# # the desired result:
|
1514
|
-
#
|
1515
|
-
# ('a'..'z').cover?('yellow') # => true
|
1516
|
-
#
|
1517
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#28
|
1647
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#29
|
1518
1648
|
class RuboCop::Cop::Performance::RangeInclude < ::RuboCop::Cop::Base
|
1519
1649
|
extend ::RuboCop::Cop::AutoCorrector
|
1520
1650
|
|
1521
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#
|
1651
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#44
|
1652
|
+
def on_csend(node); end
|
1653
|
+
|
1654
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#44
|
1522
1655
|
def on_send(node); end
|
1523
1656
|
|
1524
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#
|
1657
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#40
|
1525
1658
|
def range_include(param0 = T.unsafe(nil)); end
|
1526
1659
|
end
|
1527
1660
|
|
1528
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#
|
1661
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#32
|
1529
1662
|
RuboCop::Cop::Performance::RangeInclude::MSG = T.let(T.unsafe(nil), String)
|
1530
1663
|
|
1531
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#
|
1664
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/range_include.rb#33
|
1532
1665
|
RuboCop::Cop::Performance::RangeInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
1533
1666
|
|
1534
1667
|
# Identifies the use of a `&block` parameter and `block.call`
|
@@ -1720,26 +1853,47 @@ RuboCop::Cop::Performance::RedundantEqualityComparisonBlock::TARGET_METHODS = T.
|
|
1720
1853
|
class RuboCop::Cop::Performance::RedundantMatch < ::RuboCop::Cop::Base
|
1721
1854
|
extend ::RuboCop::Cop::AutoCorrector
|
1722
1855
|
|
1723
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#
|
1856
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#30
|
1724
1857
|
def match_call?(param0 = T.unsafe(nil)); end
|
1725
1858
|
|
1726
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#
|
1859
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#39
|
1727
1860
|
def on_send(node); end
|
1728
1861
|
|
1729
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#
|
1862
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#35
|
1730
1863
|
def only_truthiness_matters?(param0 = T.unsafe(nil)); end
|
1731
1864
|
|
1732
1865
|
private
|
1733
1866
|
|
1734
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#
|
1867
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#51
|
1735
1868
|
def autocorrect(corrector, node); end
|
1736
1869
|
|
1737
1870
|
# @return [Boolean]
|
1738
1871
|
#
|
1739
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#
|
1872
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#57
|
1740
1873
|
def autocorrectable?(node); end
|
1874
|
+
|
1875
|
+
# @return [Boolean]
|
1876
|
+
#
|
1877
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#86
|
1878
|
+
def call_like?(arg); end
|
1879
|
+
|
1880
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#63
|
1881
|
+
def replacement(node); end
|
1882
|
+
|
1883
|
+
# @return [Boolean]
|
1884
|
+
#
|
1885
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#73
|
1886
|
+
def requires_parentheses?(arg); end
|
1887
|
+
|
1888
|
+
# @return [Boolean]
|
1889
|
+
#
|
1890
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#80
|
1891
|
+
def requires_parentheses_for_call_like?(arg); end
|
1741
1892
|
end
|
1742
1893
|
|
1894
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#26
|
1895
|
+
RuboCop::Cop::Performance::RedundantMatch::HIGHER_PRECEDENCE_OPERATOR_METHODS = T.let(T.unsafe(nil), Array)
|
1896
|
+
|
1743
1897
|
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_match.rb#23
|
1744
1898
|
RuboCop::Cop::Performance::RedundantMatch::MSG = T.let(T.unsafe(nil), String)
|
1745
1899
|
|
@@ -1796,10 +1950,10 @@ class RuboCop::Cop::Performance::RedundantMerge < ::RuboCop::Cop::Base
|
|
1796
1950
|
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#98
|
1797
1951
|
def kwsplat_used?(pairs); end
|
1798
1952
|
|
1799
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
1953
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#146
|
1800
1954
|
def leading_spaces(node); end
|
1801
1955
|
|
1802
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
1956
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#150
|
1803
1957
|
def max_key_value_pairs; end
|
1804
1958
|
|
1805
1959
|
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#71
|
@@ -1833,44 +1987,44 @@ RuboCop::Cop::Performance::RedundantMerge::AREF_ASGN = T.let(T.unsafe(nil), Stri
|
|
1833
1987
|
# A utility class for checking the use of values within an
|
1834
1988
|
# `each_with_object` call.
|
1835
1989
|
#
|
1836
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
1990
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#156
|
1837
1991
|
class RuboCop::Cop::Performance::RedundantMerge::EachWithObjectInspector
|
1838
1992
|
extend ::RuboCop::AST::NodePattern::Macros
|
1839
1993
|
|
1840
1994
|
# @return [EachWithObjectInspector] a new instance of EachWithObjectInspector
|
1841
1995
|
#
|
1842
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
1996
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#159
|
1843
1997
|
def initialize(node, receiver); end
|
1844
1998
|
|
1845
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
1999
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#190
|
1846
2000
|
def each_with_object_node(param0 = T.unsafe(nil)); end
|
1847
2001
|
|
1848
2002
|
# @return [Boolean]
|
1849
2003
|
#
|
1850
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
2004
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#164
|
1851
2005
|
def value_used?; end
|
1852
2006
|
|
1853
2007
|
private
|
1854
2008
|
|
1855
2009
|
# @return [Boolean]
|
1856
2010
|
#
|
1857
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
2011
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#174
|
1858
2012
|
def eligible_receiver?; end
|
1859
2013
|
|
1860
2014
|
# Returns the value of attribute node.
|
1861
2015
|
#
|
1862
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
2016
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#172
|
1863
2017
|
def node; end
|
1864
2018
|
|
1865
2019
|
# Returns the value of attribute receiver.
|
1866
2020
|
#
|
1867
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
2021
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#172
|
1868
2022
|
def receiver; end
|
1869
2023
|
|
1870
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
2024
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#178
|
1871
2025
|
def second_argument; end
|
1872
2026
|
|
1873
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#
|
2027
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_merge.rb#185
|
1874
2028
|
def unwind(receiver); end
|
1875
2029
|
end
|
1876
2030
|
|
@@ -1927,6 +2081,9 @@ RuboCop::Cop::Performance::RedundantSortBlock::MSG = T.let(T.unsafe(nil), String
|
|
1927
2081
|
class RuboCop::Cop::Performance::RedundantSplitRegexpArgument < ::RuboCop::Cop::Base
|
1928
2082
|
extend ::RuboCop::Cop::AutoCorrector
|
1929
2083
|
|
2084
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_split_regexp_argument.rb#27
|
2085
|
+
def on_csend(node); end
|
2086
|
+
|
1930
2087
|
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_split_regexp_argument.rb#27
|
1931
2088
|
def on_send(node); end
|
1932
2089
|
|
@@ -1937,10 +2094,10 @@ class RuboCop::Cop::Performance::RedundantSplitRegexpArgument < ::RuboCop::Cop::
|
|
1937
2094
|
|
1938
2095
|
# @return [Boolean]
|
1939
2096
|
#
|
1940
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_split_regexp_argument.rb#
|
2097
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_split_regexp_argument.rb#42
|
1941
2098
|
def determinist_regexp?(regexp_node); end
|
1942
2099
|
|
1943
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_split_regexp_argument.rb#
|
2100
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/redundant_split_regexp_argument.rb#46
|
1944
2101
|
def replacement(regexp_node); end
|
1945
2102
|
end
|
1946
2103
|
|
@@ -2132,10 +2289,10 @@ class RuboCop::Cop::Performance::RegexpMatch < ::RuboCop::Cop::Base
|
|
2132
2289
|
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#105
|
2133
2290
|
def match_with_lvasgn?(node); end
|
2134
2291
|
|
2135
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2292
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#142
|
2136
2293
|
def on_case(node); end
|
2137
2294
|
|
2138
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2295
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#138
|
2139
2296
|
def on_if(node); end
|
2140
2297
|
|
2141
2298
|
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#123
|
@@ -2143,56 +2300,61 @@ class RuboCop::Cop::Performance::RegexpMatch < ::RuboCop::Cop::Base
|
|
2143
2300
|
|
2144
2301
|
private
|
2145
2302
|
|
2146
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2303
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#165
|
2147
2304
|
def autocorrect(corrector, node); end
|
2148
2305
|
|
2149
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2306
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#154
|
2150
2307
|
def check_condition(cond); end
|
2151
2308
|
|
2152
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2309
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#250
|
2153
2310
|
def correct_operator(corrector, recv, arg, oper = T.unsafe(nil)); end
|
2154
2311
|
|
2155
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2312
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#275
|
2156
2313
|
def correction_range(recv, arg); end
|
2157
2314
|
|
2158
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2315
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#221
|
2159
2316
|
def find_last_match(body, range, scope_root); end
|
2160
2317
|
|
2161
2318
|
# @return [Boolean]
|
2162
2319
|
#
|
2163
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2320
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#181
|
2164
2321
|
def last_match_used?(match_node); end
|
2165
2322
|
|
2166
2323
|
# @return [Boolean]
|
2167
2324
|
#
|
2168
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2325
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#246
|
2169
2326
|
def match_gvar?(sym); end
|
2170
2327
|
|
2171
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2328
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#177
|
2172
2329
|
def message(node); end
|
2173
2330
|
|
2174
2331
|
# @return [Boolean]
|
2175
2332
|
#
|
2176
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2333
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#217
|
2177
2334
|
def modifier_form?(match_node); end
|
2178
2335
|
|
2179
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2336
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#203
|
2180
2337
|
def next_match_pos(body, match_node_pos, scope_root); end
|
2181
2338
|
|
2182
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2339
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#190
|
2183
2340
|
def range_to_search_for_last_matches(match_node, body, scope_root); end
|
2184
2341
|
|
2185
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2342
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#259
|
2186
2343
|
def replace_with_match_predicate_method(corrector, recv, arg, op_range); end
|
2187
2344
|
|
2188
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2345
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#228
|
2189
2346
|
def scope_body(node); end
|
2190
2347
|
|
2191
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2348
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#240
|
2192
2349
|
def scope_root(node); end
|
2193
2350
|
|
2194
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#
|
2351
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#270
|
2195
2352
|
def swap_receiver_and_arg(corrector, recv, arg); end
|
2353
|
+
|
2354
|
+
class << self
|
2355
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#134
|
2356
|
+
def autocorrect_incompatible_with; end
|
2357
|
+
end
|
2196
2358
|
end
|
2197
2359
|
|
2198
2360
|
# source://rubocop-performance//lib/rubocop/cop/performance/regexp_match.rb#112
|
@@ -2229,6 +2391,9 @@ class RuboCop::Cop::Performance::ReverseEach < ::RuboCop::Cop::Base
|
|
2229
2391
|
include ::RuboCop::Cop::RangeHelp
|
2230
2392
|
extend ::RuboCop::Cop::AutoCorrector
|
2231
2393
|
|
2394
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_each.rb#33
|
2395
|
+
def on_csend(node); end
|
2396
|
+
|
2232
2397
|
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_each.rb#33
|
2233
2398
|
def on_send(node); end
|
2234
2399
|
|
@@ -2237,12 +2402,12 @@ class RuboCop::Cop::Performance::ReverseEach < ::RuboCop::Cop::Base
|
|
2237
2402
|
|
2238
2403
|
private
|
2239
2404
|
|
2240
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_each.rb#
|
2405
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_each.rb#54
|
2241
2406
|
def offense_range(node); end
|
2242
2407
|
|
2243
2408
|
# @return [Boolean]
|
2244
2409
|
#
|
2245
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_each.rb#
|
2410
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_each.rb#48
|
2246
2411
|
def use_return_value?(node); end
|
2247
2412
|
end
|
2248
2413
|
|
@@ -2270,6 +2435,9 @@ class RuboCop::Cop::Performance::ReverseFirst < ::RuboCop::Cop::Base
|
|
2270
2435
|
include ::RuboCop::Cop::RangeHelp
|
2271
2436
|
extend ::RuboCop::Cop::AutoCorrector
|
2272
2437
|
|
2438
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#30
|
2439
|
+
def on_csend(node); end
|
2440
|
+
|
2273
2441
|
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#30
|
2274
2442
|
def on_send(node); end
|
2275
2443
|
|
@@ -2278,16 +2446,13 @@ class RuboCop::Cop::Performance::ReverseFirst < ::RuboCop::Cop::Base
|
|
2278
2446
|
|
2279
2447
|
private
|
2280
2448
|
|
2281
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#
|
2282
|
-
def build_bad_method(node); end
|
2283
|
-
|
2284
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#55
|
2449
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#56
|
2285
2450
|
def build_good_method(node); end
|
2286
2451
|
|
2287
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#
|
2288
|
-
def build_message(node); end
|
2452
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#50
|
2453
|
+
def build_message(node, range); end
|
2289
2454
|
|
2290
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#
|
2455
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/reverse_first.rb#46
|
2291
2456
|
def correction_range(receiver, node); end
|
2292
2457
|
end
|
2293
2458
|
|
@@ -2315,17 +2480,17 @@ class RuboCop::Cop::Performance::SelectMap < ::RuboCop::Cop::Base
|
|
2315
2480
|
extend ::RuboCop::Cop::TargetRubyVersion
|
2316
2481
|
|
2317
2482
|
# source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#27
|
2318
|
-
def
|
2483
|
+
def on_csend(node); end
|
2319
2484
|
|
2320
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#
|
2485
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#27
|
2321
2486
|
def on_send(node); end
|
2322
2487
|
|
2323
2488
|
private
|
2324
2489
|
|
2325
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#
|
2490
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#41
|
2326
2491
|
def map_method_candidate(node); end
|
2327
2492
|
|
2328
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#
|
2493
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/select_map.rb#51
|
2329
2494
|
def offense_range(node, map_method); end
|
2330
2495
|
end
|
2331
2496
|
|
@@ -2381,6 +2546,9 @@ class RuboCop::Cop::Performance::Size < ::RuboCop::Cop::Base
|
|
2381
2546
|
# source://rubocop-performance//lib/rubocop/cop/performance/size.rb#52
|
2382
2547
|
def hash?(param0 = T.unsafe(nil)); end
|
2383
2548
|
|
2549
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/size.rb#65
|
2550
|
+
def on_csend(node); end
|
2551
|
+
|
2384
2552
|
# source://rubocop-performance//lib/rubocop/cop/performance/size.rb#65
|
2385
2553
|
def on_send(node); end
|
2386
2554
|
end
|
@@ -2441,7 +2609,10 @@ RuboCop::Cop::Performance::SortReverse::MSG = T.let(T.unsafe(nil), String)
|
|
2441
2609
|
class RuboCop::Cop::Performance::Squeeze < ::RuboCop::Cop::Base
|
2442
2610
|
extend ::RuboCop::Cop::AutoCorrector
|
2443
2611
|
|
2444
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/squeeze.rb#
|
2612
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/squeeze.rb#39
|
2613
|
+
def on_csend(node); end
|
2614
|
+
|
2615
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/squeeze.rb#39
|
2445
2616
|
def on_send(node); end
|
2446
2617
|
|
2447
2618
|
# source://rubocop-performance//lib/rubocop/cop/performance/squeeze.rb#29
|
@@ -2451,7 +2622,7 @@ class RuboCop::Cop::Performance::Squeeze < ::RuboCop::Cop::Base
|
|
2451
2622
|
|
2452
2623
|
# @return [Boolean]
|
2453
2624
|
#
|
2454
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/squeeze.rb#
|
2625
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/squeeze.rb#61
|
2455
2626
|
def repeating_literal?(regex_str); end
|
2456
2627
|
end
|
2457
2628
|
|
@@ -2505,6 +2676,9 @@ class RuboCop::Cop::Performance::StartWith < ::RuboCop::Cop::Base
|
|
2505
2676
|
include ::RuboCop::Cop::RegexpMetacharacter
|
2506
2677
|
extend ::RuboCop::Cop::AutoCorrector
|
2507
2678
|
|
2679
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/start_with.rb#62
|
2680
|
+
def on_csend(node); end
|
2681
|
+
|
2508
2682
|
# source://rubocop-performance//lib/rubocop/cop/performance/start_with.rb#62
|
2509
2683
|
def on_match_with_lvasgn(node); end
|
2510
2684
|
|
@@ -2534,33 +2708,65 @@ RuboCop::Cop::Performance::StartWith::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Ar
|
|
2534
2708
|
# send('do_something')
|
2535
2709
|
# attr_accessor 'do_something'
|
2536
2710
|
# instance_variable_get('@ivar')
|
2711
|
+
# respond_to?("string_#{interpolation}")
|
2537
2712
|
#
|
2538
2713
|
# # good
|
2539
2714
|
# send(:do_something)
|
2540
2715
|
# attr_accessor :do_something
|
2541
2716
|
# instance_variable_get(:@ivar)
|
2717
|
+
# respond_to?(:"string_#{interpolation}")
|
2542
2718
|
#
|
2543
|
-
#
|
2719
|
+
# # good - these methods don't support namespaced symbols
|
2720
|
+
# const_get("#{module_path}::Base")
|
2721
|
+
# const_source_location("#{module_path}::Base")
|
2722
|
+
# const_defined?("#{module_path}::Base")
|
2723
|
+
#
|
2724
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#33
|
2544
2725
|
class RuboCop::Cop::Performance::StringIdentifierArgument < ::RuboCop::Cop::Base
|
2545
2726
|
extend ::RuboCop::Cop::AutoCorrector
|
2546
2727
|
|
2547
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#
|
2728
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#64
|
2548
2729
|
def on_send(node); end
|
2730
|
+
|
2731
|
+
private
|
2732
|
+
|
2733
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#105
|
2734
|
+
def argument_replacement(node, value); end
|
2735
|
+
|
2736
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#95
|
2737
|
+
def register_offense(argument, argument_value); end
|
2738
|
+
|
2739
|
+
# @return [Boolean]
|
2740
|
+
#
|
2741
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#89
|
2742
|
+
def string_argument_compatible?(argument, node); end
|
2743
|
+
|
2744
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#77
|
2745
|
+
def string_arguments(node); end
|
2549
2746
|
end
|
2550
2747
|
|
2551
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#
|
2748
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#38
|
2552
2749
|
RuboCop::Cop::Performance::StringIdentifierArgument::COMMAND_METHODS = T.let(T.unsafe(nil), Array)
|
2553
2750
|
|
2554
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#
|
2751
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#43
|
2752
|
+
RuboCop::Cop::Performance::StringIdentifierArgument::INTERPOLATION_IGNORE_METHODS = T.let(T.unsafe(nil), Array)
|
2753
|
+
|
2754
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#36
|
2555
2755
|
RuboCop::Cop::Performance::StringIdentifierArgument::MSG = T.let(T.unsafe(nil), String)
|
2556
2756
|
|
2757
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#46
|
2758
|
+
RuboCop::Cop::Performance::StringIdentifierArgument::MULTIPLE_ARGUMENTS_METHODS = T.let(T.unsafe(nil), Array)
|
2759
|
+
|
2557
2760
|
# NOTE: `attr` method is not included in this list as it can cause false positives in Nokogiri API.
|
2558
2761
|
# And `attr` may not be used because `Style/Attr` registers an offense.
|
2559
2762
|
# https://github.com/rubocop/rubocop-performance/issues/278
|
2560
2763
|
#
|
2561
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#
|
2764
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#54
|
2562
2765
|
RuboCop::Cop::Performance::StringIdentifierArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2563
2766
|
|
2767
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_identifier_argument.rb#45
|
2768
|
+
RuboCop::Cop::Performance::StringIdentifierArgument::TWO_ARGUMENTS_METHOD = T.let(T.unsafe(nil), Symbol)
|
2769
|
+
|
2564
2770
|
# Identifies unnecessary use of a regex where `String#include?` would suffice.
|
2565
2771
|
#
|
2566
2772
|
# @example
|
@@ -2571,35 +2777,39 @@ RuboCop::Cop::Performance::StringIdentifierArgument::RESTRICT_ON_SEND = T.let(T.
|
|
2571
2777
|
# /ab/ =~ str
|
2572
2778
|
# str.match(/ab/)
|
2573
2779
|
# /ab/.match(str)
|
2780
|
+
# /ab/ === str
|
2574
2781
|
#
|
2575
2782
|
# # good
|
2576
2783
|
# str.include?('ab')
|
2577
2784
|
#
|
2578
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#
|
2785
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#23
|
2579
2786
|
class RuboCop::Cop::Performance::StringInclude < ::RuboCop::Cop::Base
|
2580
2787
|
extend ::RuboCop::Cop::AutoCorrector
|
2581
2788
|
|
2582
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#
|
2789
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#36
|
2790
|
+
def on_csend(node); end
|
2791
|
+
|
2792
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#36
|
2583
2793
|
def on_match_with_lvasgn(node); end
|
2584
2794
|
|
2585
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#
|
2795
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#36
|
2586
2796
|
def on_send(node); end
|
2587
2797
|
|
2588
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#
|
2798
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#29
|
2589
2799
|
def redundant_regex?(param0 = T.unsafe(nil)); end
|
2590
2800
|
|
2591
2801
|
private
|
2592
2802
|
|
2593
2803
|
# @return [Boolean]
|
2594
2804
|
#
|
2595
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#
|
2805
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#58
|
2596
2806
|
def literal?(regex_str); end
|
2597
2807
|
end
|
2598
2808
|
|
2599
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#
|
2809
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#26
|
2600
2810
|
RuboCop::Cop::Performance::StringInclude::MSG = T.let(T.unsafe(nil), String)
|
2601
2811
|
|
2602
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#
|
2812
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_include.rb#27
|
2603
2813
|
RuboCop::Cop::Performance::StringInclude::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2604
2814
|
|
2605
2815
|
# Identifies places where `gsub` can be replaced by `tr` or `delete`.
|
@@ -2622,6 +2832,9 @@ class RuboCop::Cop::Performance::StringReplacement < ::RuboCop::Cop::Base
|
|
2622
2832
|
include ::RuboCop::Cop::RangeHelp
|
2623
2833
|
extend ::RuboCop::Cop::AutoCorrector
|
2624
2834
|
|
2835
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#37
|
2836
|
+
def on_csend(node); end
|
2837
|
+
|
2625
2838
|
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#37
|
2626
2839
|
def on_send(node); end
|
2627
2840
|
|
@@ -2632,45 +2845,45 @@ class RuboCop::Cop::Performance::StringReplacement < ::RuboCop::Cop::Base
|
|
2632
2845
|
|
2633
2846
|
# @return [Boolean]
|
2634
2847
|
#
|
2635
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2848
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#84
|
2636
2849
|
def accept_first_param?(first_param); end
|
2637
2850
|
|
2638
2851
|
# @return [Boolean]
|
2639
2852
|
#
|
2640
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2853
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#79
|
2641
2854
|
def accept_second_param?(second_param); end
|
2642
2855
|
|
2643
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2856
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#60
|
2644
2857
|
def autocorrect(corrector, node); end
|
2645
2858
|
|
2646
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2859
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#100
|
2647
2860
|
def first_source(first_param); end
|
2648
2861
|
|
2649
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2862
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#143
|
2650
2863
|
def message(node, first_source, second_source); end
|
2651
2864
|
|
2652
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2865
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#149
|
2653
2866
|
def method_suffix(node); end
|
2654
2867
|
|
2655
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2868
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#49
|
2656
2869
|
def offense(node, first_param, second_param); end
|
2657
2870
|
|
2658
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2871
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#129
|
2659
2872
|
def range(node); end
|
2660
2873
|
|
2661
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2874
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#153
|
2662
2875
|
def remove_second_param(corrector, node, first_param); end
|
2663
2876
|
|
2664
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2877
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#70
|
2665
2878
|
def replace_method(corrector, node, first_source, second_source, first_param); end
|
2666
2879
|
|
2667
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2880
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#133
|
2668
2881
|
def replacement_method(node, first_source, second_source); end
|
2669
2882
|
|
2670
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2883
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#118
|
2671
2884
|
def source_from_regex_constructor(node); end
|
2672
2885
|
|
2673
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#
|
2886
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/string_replacement.rb#111
|
2674
2887
|
def source_from_regex_literal(node); end
|
2675
2888
|
end
|
2676
2889
|
|
@@ -2732,9 +2945,12 @@ class RuboCop::Cop::Performance::Sum < ::RuboCop::Cop::Base
|
|
2732
2945
|
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#102
|
2733
2946
|
def elem_plus_acc?(param0 = T.unsafe(nil), param1, param2); end
|
2734
2947
|
|
2735
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2948
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#115
|
2736
2949
|
def on_block(node); end
|
2737
2950
|
|
2951
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#107
|
2952
|
+
def on_csend(node); end
|
2953
|
+
|
2738
2954
|
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#107
|
2739
2955
|
def on_send(node); end
|
2740
2956
|
|
@@ -2751,54 +2967,54 @@ class RuboCop::Cop::Performance::Sum < ::RuboCop::Cop::Base
|
|
2751
2967
|
|
2752
2968
|
# @return [Boolean]
|
2753
2969
|
#
|
2754
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2970
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#160
|
2755
2971
|
def array_literal?(node); end
|
2756
2972
|
|
2757
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2973
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#165
|
2758
2974
|
def autocorrect(corrector, init, range); end
|
2759
2975
|
|
2760
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2976
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#173
|
2761
2977
|
def autocorrect_sum_map(corrector, sum, map, init); end
|
2762
2978
|
|
2763
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2979
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#250
|
2764
2980
|
def build_block_bad_method(method, init, var_acc, var_elem, body); end
|
2765
2981
|
|
2766
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2982
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#217
|
2767
2983
|
def build_block_message(send, init, var_acc, var_elem, body); end
|
2768
2984
|
|
2769
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2985
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#223
|
2770
2986
|
def build_good_method(init, block_pass = T.unsafe(nil)); end
|
2771
2987
|
|
2772
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2988
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#236
|
2773
2989
|
def build_method_bad_method(init, method, operation); end
|
2774
2990
|
|
2775
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2991
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#198
|
2776
2992
|
def build_method_message(node, method, init, operation); end
|
2777
2993
|
|
2778
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2779
|
-
def build_sum_map_message(
|
2994
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#209
|
2995
|
+
def build_sum_map_message(send_node, init); end
|
2780
2996
|
|
2781
2997
|
# @return [Boolean]
|
2782
2998
|
#
|
2783
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
2999
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#155
|
2784
3000
|
def empty_array_literal?(node); end
|
2785
3001
|
|
2786
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
3002
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#130
|
2787
3003
|
def handle_sum_candidate(node); end
|
2788
3004
|
|
2789
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
3005
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#143
|
2790
3006
|
def handle_sum_map_candidate(node); end
|
2791
3007
|
|
2792
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
3008
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#261
|
2793
3009
|
def method_call_with_args_range(node); end
|
2794
3010
|
|
2795
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
3011
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#194
|
2796
3012
|
def sum_block_range(send, node); end
|
2797
3013
|
|
2798
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
3014
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#190
|
2799
3015
|
def sum_map_range(map, sum); end
|
2800
3016
|
|
2801
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#
|
3017
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/sum.rb#186
|
2802
3018
|
def sum_method_range(node); end
|
2803
3019
|
end
|
2804
3020
|
|
@@ -2830,24 +3046,32 @@ RuboCop::Cop::Performance::Sum::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
|
2830
3046
|
class RuboCop::Cop::Performance::TimesMap < ::RuboCop::Cop::Base
|
2831
3047
|
extend ::RuboCop::Cop::AutoCorrector
|
2832
3048
|
|
2833
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#
|
3049
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#44
|
2834
3050
|
def on_block(node); end
|
2835
3051
|
|
2836
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#
|
3052
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#39
|
3053
|
+
def on_csend(node); end
|
3054
|
+
|
3055
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#44
|
2837
3056
|
def on_numblock(node); end
|
2838
3057
|
|
2839
3058
|
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#39
|
2840
3059
|
def on_send(node); end
|
2841
3060
|
|
2842
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#
|
3061
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#79
|
2843
3062
|
def times_map_call(param0 = T.unsafe(nil)); end
|
2844
3063
|
|
2845
3064
|
private
|
2846
3065
|
|
2847
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#
|
3066
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#51
|
2848
3067
|
def check(node); end
|
2849
3068
|
|
2850
|
-
#
|
3069
|
+
# @return [Boolean]
|
3070
|
+
#
|
3071
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#63
|
3072
|
+
def handleable_receiver?(node); end
|
3073
|
+
|
3074
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/times_map.rb#70
|
2851
3075
|
def message(map_or_collect, count); end
|
2852
3076
|
end
|
2853
3077
|
|
@@ -2866,8 +3090,8 @@ RuboCop::Cop::Performance::TimesMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr
|
|
2866
3090
|
#
|
2867
3091
|
# @example
|
2868
3092
|
# # bad
|
2869
|
-
# ''.dup
|
2870
|
-
# "something".dup
|
3093
|
+
# ''.dup # when Ruby 3.2 or lower
|
3094
|
+
# "something".dup # when Ruby 3.2 or lower
|
2871
3095
|
# String.new
|
2872
3096
|
# String.new('')
|
2873
3097
|
# String.new('something')
|
@@ -2879,26 +3103,27 @@ RuboCop::Cop::Performance::TimesMap::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Arr
|
|
2879
3103
|
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#27
|
2880
3104
|
class RuboCop::Cop::Performance::UnfreezeString < ::RuboCop::Cop::Base
|
2881
3105
|
extend ::RuboCop::Cop::AutoCorrector
|
3106
|
+
extend ::RuboCop::Cop::TargetRubyVersion
|
2882
3107
|
|
2883
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#
|
3108
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#36
|
2884
3109
|
def dup_string?(param0 = T.unsafe(nil)); end
|
2885
3110
|
|
2886
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#
|
3111
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#47
|
2887
3112
|
def on_send(node); end
|
2888
3113
|
|
2889
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#
|
3114
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#40
|
2890
3115
|
def string_new?(param0 = T.unsafe(nil)); end
|
2891
3116
|
|
2892
3117
|
private
|
2893
3118
|
|
2894
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#
|
3119
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#60
|
2895
3120
|
def string_value(node); end
|
2896
3121
|
end
|
2897
3122
|
|
2898
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#
|
3123
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#33
|
2899
3124
|
RuboCop::Cop::Performance::UnfreezeString::MSG = T.let(T.unsafe(nil), String)
|
2900
3125
|
|
2901
|
-
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#
|
3126
|
+
# source://rubocop-performance//lib/rubocop/cop/performance/unfreeze_string.rb#34
|
2902
3127
|
RuboCop::Cop::Performance::UnfreezeString::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
2903
3128
|
|
2904
3129
|
# Identifies places where `URI::Parser.new` can be replaced by `URI::DEFAULT_PARSER`.
|