forked from airbnb/ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rubocop-performance.yml
122 lines (99 loc) · 4.07 KB
/
rubocop-performance.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Performance/Caller:
Enabled: false
# Type 'Performance' (8):
# Supports --auto-correct
Performance/CaseWhenSplat:
Description: Place `when` conditions that use splat at the end of the list of `when`
branches.
Enabled: false
# Supports --auto-correct
Performance/Casecmp:
Description: Use `casecmp` rather than `downcase ==`.
Reference: https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code
Enabled: false
Performance/CompareWithBlock:
Enabled: false
# Supports --auto-correct
Performance/Count:
Description: Use `count` instead of `select...size`, `reject...size`, `select...count`,
`reject...count`, `select...length`, and `reject...length`.
Enabled: false
# Supports --auto-correct
Performance/Detect:
Description: Use `detect` instead of `select.first`, `find_all.first`, `select.last`,
and `find_all.last`.
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
Enabled: false
Performance/DoubleStartEndWith:
Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x,
...) || str.{start,end}_with?(y, ...)`.
Enabled: false
# Supports --auto-correct
Performance/EndWith:
Description: Use `end_with?` instead of a regex match anchored to the end of a string.
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
Enabled: false
Performance/FixedSize:
Description: Do not compute the size of statically sized objects except in constants
Enabled: false
# Supports --auto-correct
Performance/FlatMap:
Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
or `Enumberable#collect..Array#flatten(1)`
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
Enabled: false
EnabledForFlattenWithoutParams: false
Performance/InefficientHashSearch:
Enabled: false
# Supports --auto-correct
Performance/RangeInclude:
Description: Use `Range#cover?` instead of `Range#include?`.
Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
Enabled: false
# Supports --auto-correct
Performance/RedundantBlockCall:
Description: Use `yield` instead of `block.call`.
Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
Enabled: false
# Supports --auto-correct
Performance/RedundantMatch:
Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where
the returned `MatchData` is not needed.
Enabled: false
# Supports --auto-correct
Performance/RedundantMerge:
Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
Enabled: false
Performance/RegexpMatch:
Enabled: false
# Supports --auto-correct
Performance/ReverseEach:
Description: Use `reverse_each` instead of `reverse.each`.
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
Enabled: false
# Supports --auto-correct
Performance/Size:
Description: Use `size` instead of `count` for counting the number of elements in
`Array` and `Hash`.
Reference: https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
Enabled: false
# Supports --auto-correct
Performance/StartWith:
Description: Use `start_with?` instead of a regex match anchored to the beginning
of a string.
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
Enabled: false
# Supports --auto-correct
Performance/StringReplacement:
Description: Use `tr` instead of `gsub` when you are replacing the same number of
characters. Use `delete` instead of `gsub` when you are deleting characters.
Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
Enabled: false
Performance/TimesMap:
Description: Checks for .times.map calls.
Enabled: false
Performance/UnfreezeString:
Enabled: false
Performance/UriDefaultParser:
Enabled: false