rubocop-rubomatic 1.3.0 → 1.4.0.pre.rc.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +15 -0
- data/config/bundler.yml +0 -22
- data/config/default.yml +0 -4
- data/config/gemspec_on.yml +0 -23
- data/config/layout.yml +0 -346
- data/config/lint.yml +6 -403
- data/config/metrics.yml +0 -41
- data/config/migration.yml +0 -4
- data/config/naming.yml +0 -68
- data/config/performance.yml +3 -128
- data/config/security.yml +0 -31
- data/config/style.yml +14 -931
- data/lib/rubocop/rubomatic/version.rb +1 -1
- metadata +10 -10
data/config/metrics.yml
CHANGED
@@ -1,13 +1,5 @@
|
|
1
1
|
Metrics/AbcSize:
|
2
|
-
Description: >-
|
3
|
-
A calculated magnitude based on number of assignments,
|
4
|
-
branches, and conditions.
|
5
|
-
Reference:
|
6
|
-
- http://c2.com/cgi/wiki?AbcMetric
|
7
|
-
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
8
2
|
Enabled: true
|
9
|
-
VersionAdded: '0.27'
|
10
|
-
VersionChanged: '1.5'
|
11
3
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
12
4
|
# a Float.
|
13
5
|
AllowedMethods: [ ]
|
@@ -16,10 +8,7 @@ Metrics/AbcSize:
|
|
16
8
|
Max: 250
|
17
9
|
|
18
10
|
Metrics/BlockLength:
|
19
|
-
Description: 'Avoid long blocks with many lines.'
|
20
11
|
Enabled: true
|
21
|
-
VersionAdded: '0.44'
|
22
|
-
VersionChanged: '1.5'
|
23
12
|
CountComments: false # count full line comments?
|
24
13
|
Max: 500
|
25
14
|
CountAsOne:
|
@@ -37,28 +26,19 @@ Metrics/BlockLength:
|
|
37
26
|
- 'config/routes/*'
|
38
27
|
|
39
28
|
Metrics/BlockNesting:
|
40
|
-
Description: 'Avoid excessive block nesting.'
|
41
|
-
StyleGuide: '#three-is-the-number-thou-shalt-count'
|
42
29
|
Enabled: true
|
43
|
-
VersionAdded: '0.25'
|
44
|
-
VersionChanged: '0.47'
|
45
30
|
CountBlocks: false
|
46
31
|
Max: 10
|
47
32
|
|
48
33
|
Metrics/ClassLength:
|
49
|
-
Description: 'Avoid classes longer than 100 lines of code.'
|
50
34
|
Enabled: false
|
51
|
-
VersionAdded: '0.25'
|
52
|
-
VersionChanged: '0.87'
|
53
35
|
CountComments: false # count full line comments?
|
54
36
|
Max: 100
|
55
37
|
CountAsOne: [ ]
|
56
38
|
|
57
39
|
<% if RuboCop::Version.document_version.to_f >= 1.47 %>
|
58
40
|
Metrics/CollectionLiteralLength:
|
59
|
-
Description: Checks for `Array` or `Hash` literals with many entries.
|
60
41
|
Enabled: true
|
61
|
-
VersionAdded: '1.47'
|
62
42
|
LengthThreshold: 250
|
63
43
|
Exclude:
|
64
44
|
- lib/tasks/seeds
|
@@ -66,22 +46,13 @@ Metrics/CollectionLiteralLength:
|
|
66
46
|
|
67
47
|
# Avoid complex methods.
|
68
48
|
Metrics/CyclomaticComplexity:
|
69
|
-
Description: >-
|
70
|
-
A complexity metric that is strongly correlated to the number
|
71
|
-
of test cases needed to validate a method.
|
72
49
|
Enabled: true
|
73
|
-
VersionAdded: '0.25'
|
74
|
-
VersionChanged: '0.81'
|
75
50
|
AllowedMethods: [ ]
|
76
51
|
AllowedPatterns: [ ]
|
77
52
|
Max: 150
|
78
53
|
|
79
54
|
Metrics/MethodLength:
|
80
|
-
Description: 'Avoid methods longer than 10 lines of code.'
|
81
|
-
StyleGuide: '#short-methods'
|
82
55
|
Enabled: true
|
83
|
-
VersionAdded: '0.25'
|
84
|
-
VersionChanged: '1.5'
|
85
56
|
CountComments: false # count full line comments?
|
86
57
|
Max: 350
|
87
58
|
CountAsOne:
|
@@ -92,31 +63,19 @@ Metrics/MethodLength:
|
|
92
63
|
AllowedPatterns: [ ]
|
93
64
|
|
94
65
|
Metrics/ModuleLength:
|
95
|
-
Description: 'Avoid modules longer than 100 lines of code.'
|
96
66
|
Enabled: false
|
97
|
-
VersionAdded: '0.31'
|
98
|
-
VersionChanged: '0.87'
|
99
67
|
CountComments: false # count full line comments?
|
100
68
|
Max: 100
|
101
69
|
CountAsOne: [ ]
|
102
70
|
|
103
71
|
Metrics/ParameterLists:
|
104
|
-
Description: 'Avoid parameter lists longer than three or four parameters.'
|
105
|
-
StyleGuide: '#too-many-params'
|
106
72
|
Enabled: true
|
107
|
-
VersionAdded: '0.25'
|
108
|
-
VersionChanged: '1.5'
|
109
73
|
Max: 5
|
110
74
|
CountKeywordArgs: false
|
111
75
|
MaxOptionalParameters: 3
|
112
76
|
|
113
77
|
Metrics/PerceivedComplexity:
|
114
|
-
Description: >-
|
115
|
-
A complexity metric geared towards measuring complexity for a
|
116
|
-
human reader.
|
117
78
|
Enabled: true
|
118
|
-
VersionAdded: '0.25'
|
119
|
-
VersionChanged: '0.81'
|
120
79
|
AllowedMethods: [ ]
|
121
80
|
AllowedPatterns: [ ]
|
122
81
|
Max: 75
|
data/config/migration.yml
CHANGED
data/config/naming.yml
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
Naming/AccessorMethodName:
|
2
|
-
Description: Check the naming of accessor methods for get_/set_.
|
3
|
-
StyleGuide: '#accessor_mutator_method_names'
|
4
2
|
Enabled: true
|
5
|
-
VersionAdded: '0.50'
|
6
3
|
|
7
4
|
Naming/AsciiIdentifiers:
|
8
|
-
Description: 'Use only ascii symbols in identifiers and constants.'
|
9
|
-
StyleGuide: '#english-identifiers'
|
10
5
|
Enabled: true
|
11
|
-
VersionAdded: '0.50'
|
12
|
-
VersionChanged: '0.87'
|
13
6
|
AsciiConstants: true
|
14
7
|
|
15
8
|
Naming/BinaryOperatorParameterName:
|
16
|
-
Description: 'When defining binary operators, name the argument other.'
|
17
|
-
StyleGuide: '#other-arg'
|
18
9
|
Enabled: true
|
19
|
-
VersionAdded: '0.50'
|
20
|
-
VersionChanged: '1.2'
|
21
10
|
|
22
11
|
Naming/BlockForwarding:
|
23
|
-
Description: 'Use anonymous block forwarding.'
|
24
|
-
StyleGuide: '#block-forwarding'
|
25
12
|
Enabled: <%= ENV['RUBY_MAJOR'].to_f >= 3.1 %>
|
26
|
-
VersionAdded: '1.24'
|
27
13
|
EnforcedStyle: anonymous
|
28
14
|
SupportedStyles:
|
29
15
|
- anonymous
|
@@ -31,12 +17,7 @@ Naming/BlockForwarding:
|
|
31
17
|
BlockForwardingName: block
|
32
18
|
|
33
19
|
Naming/BlockParameterName:
|
34
|
-
Description: >-
|
35
|
-
Checks for block parameter names that contain capital letters,
|
36
|
-
end in numbers, or do not meet a minimal length.
|
37
20
|
Enabled: true
|
38
|
-
VersionAdded: '0.53'
|
39
|
-
VersionChanged: '0.77'
|
40
21
|
# Parameter names may be equal to or greater than this value
|
41
22
|
MinNameLength: 1
|
42
23
|
AllowNamesEndingInNumbers: true
|
@@ -46,28 +27,17 @@ Naming/BlockParameterName:
|
|
46
27
|
ForbiddenNames: [ ]
|
47
28
|
|
48
29
|
Naming/ClassAndModuleCamelCase:
|
49
|
-
Description: 'Use CamelCase for classes and modules.'
|
50
|
-
StyleGuide: '#camelcase-classes'
|
51
30
|
Enabled: true
|
52
|
-
VersionAdded: '0.50'
|
53
|
-
VersionChanged: '0.85'
|
54
31
|
# Allowed class/module names can be specified here.
|
55
32
|
# These can be full or part of the name.
|
56
33
|
AllowedNames:
|
57
34
|
- module_parent
|
58
35
|
|
59
36
|
Naming/ConstantName:
|
60
|
-
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
61
|
-
StyleGuide: '#screaming-snake-case'
|
62
37
|
Enabled: true
|
63
|
-
VersionAdded: '0.50'
|
64
38
|
|
65
39
|
Naming/FileName:
|
66
|
-
Description: 'Use snake_case for source file names.'
|
67
|
-
StyleGuide: '#snake-case-files'
|
68
40
|
Enabled: true
|
69
|
-
VersionAdded: '0.50'
|
70
|
-
VersionChanged: '1.23'
|
71
41
|
# Camel case file names listed in `AllCops:Include` and all file names listed
|
72
42
|
# in `AllCops:Exclude` are excluded by default. Add extra excludes here.
|
73
43
|
Exclude: [ ]
|
@@ -139,29 +109,19 @@ Naming/FileName:
|
|
139
109
|
- XSS
|
140
110
|
|
141
111
|
Naming/HeredocDelimiterCase:
|
142
|
-
Description: 'Use configured case for heredoc delimiters.'
|
143
|
-
StyleGuide: '#heredoc-delimiters'
|
144
112
|
Enabled: true
|
145
|
-
VersionAdded: '0.50'
|
146
|
-
VersionChanged: '1.2'
|
147
113
|
EnforcedStyle: uppercase
|
148
114
|
SupportedStyles:
|
149
115
|
- lowercase
|
150
116
|
- uppercase
|
151
117
|
|
152
118
|
Naming/HeredocDelimiterNaming:
|
153
|
-
Description: 'Use descriptive heredoc delimiters.'
|
154
|
-
StyleGuide: '#heredoc-delimiters'
|
155
119
|
Enabled: true
|
156
|
-
VersionAdded: '0.50'
|
157
120
|
ForbiddenDelimiters:
|
158
121
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
159
122
|
|
160
123
|
Naming/InclusiveLanguage:
|
161
|
-
Description: 'Recommend the use of inclusive language instead of problematic terms.'
|
162
124
|
Enabled: false
|
163
|
-
VersionAdded: '1.18'
|
164
|
-
VersionChanged: '1.21'
|
165
125
|
CheckIdentifiers: true
|
166
126
|
CheckConstants: true
|
167
127
|
CheckVariables: true
|
@@ -185,23 +145,15 @@ Naming/InclusiveLanguage:
|
|
185
145
|
Suggestions: [ 'replica', 'secondary', 'follower' ]
|
186
146
|
|
187
147
|
Naming/MemoizedInstanceVariableName:
|
188
|
-
Description: >-
|
189
|
-
Memoized method name should match memo instance variable name.
|
190
148
|
Enabled: true
|
191
|
-
VersionAdded: '0.53'
|
192
|
-
VersionChanged: '1.2'
|
193
149
|
EnforcedStyleForLeadingUnderscores: disallowed
|
194
150
|
SupportedStylesForLeadingUnderscores:
|
195
151
|
- disallowed
|
196
152
|
- required
|
197
153
|
- optional
|
198
|
-
Safe: false
|
199
154
|
|
200
155
|
Naming/MethodName:
|
201
|
-
Description: 'Use the configured style when naming methods.'
|
202
|
-
StyleGuide: '#snake-case-symbols-methods-vars'
|
203
156
|
Enabled: true
|
204
|
-
VersionAdded: '0.50'
|
205
157
|
EnforcedStyle: snake_case
|
206
158
|
SupportedStyles:
|
207
159
|
- snake_case
|
@@ -215,12 +167,7 @@ Naming/MethodName:
|
|
215
167
|
AllowedPatterns: [ ]
|
216
168
|
|
217
169
|
Naming/MethodParameterName:
|
218
|
-
Description: >-
|
219
|
-
Checks for method parameter names that contain capital letters,
|
220
|
-
end in numbers, or do not meet a minimal length.
|
221
170
|
Enabled: true
|
222
|
-
VersionAdded: '0.53'
|
223
|
-
VersionChanged: '0.77'
|
224
171
|
# Parameter names may be equal to or greater than this value
|
225
172
|
MinNameLength: 1
|
226
173
|
AllowNamesEndingInNumbers: true
|
@@ -245,11 +192,7 @@ Naming/MethodParameterName:
|
|
245
192
|
ForbiddenNames: [ ]
|
246
193
|
|
247
194
|
Naming/PredicateName:
|
248
|
-
Description: 'Check the names of predicate methods.'
|
249
|
-
StyleGuide: '#bool-methods-qmark'
|
250
195
|
Enabled: true
|
251
|
-
VersionAdded: '0.50'
|
252
|
-
VersionChanged: '0.77'
|
253
196
|
# Predicate name prefixes.
|
254
197
|
NamePrefix:
|
255
198
|
- is_
|
@@ -274,18 +217,11 @@ Naming/PredicateName:
|
|
274
217
|
- 'spec/**/*'
|
275
218
|
|
276
219
|
Naming/RescuedExceptionsVariableName:
|
277
|
-
Description: 'Use consistent rescued exceptions variables naming.'
|
278
220
|
Enabled: true
|
279
|
-
VersionAdded: '0.67'
|
280
|
-
VersionChanged: '0.68'
|
281
221
|
PreferredName: e
|
282
222
|
|
283
223
|
Naming/VariableName:
|
284
|
-
Description: 'Use the configured style when naming variables.'
|
285
|
-
StyleGuide: '#snake-case-symbols-methods-vars'
|
286
224
|
Enabled: true
|
287
|
-
VersionAdded: '0.50'
|
288
|
-
VersionChanged: '1.8'
|
289
225
|
EnforcedStyle: snake_case
|
290
226
|
SupportedStyles:
|
291
227
|
- snake_case
|
@@ -294,11 +230,7 @@ Naming/VariableName:
|
|
294
230
|
AllowedPatterns: [ ]
|
295
231
|
|
296
232
|
Naming/VariableNumber:
|
297
|
-
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
298
|
-
StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
|
299
233
|
Enabled: true
|
300
|
-
VersionAdded: '0.50'
|
301
|
-
VersionChanged: '1.4'
|
302
234
|
EnforcedStyle: normalcase
|
303
235
|
SupportedStyles:
|
304
236
|
- snake_case
|
data/config/performance.yml
CHANGED
@@ -4,258 +4,133 @@ Performance:
|
|
4
4
|
Enabled: false
|
5
5
|
|
6
6
|
Performance/BigDecimalWithNumericArgument:
|
7
|
-
Description: Convert numeric literal to string and pass it to `BigDecimal`.
|
8
7
|
Enabled: true
|
9
|
-
VersionAdded: '1.7'
|
10
8
|
|
11
9
|
Performance/ChainArrayAllocation:
|
12
|
-
Description: Instead of chaining array methods that allocate new arrays, mutate an
|
13
|
-
existing array.
|
14
|
-
Reference: https://twitter.com/schneems/status/1034123879978029057
|
15
10
|
Enabled: true
|
16
|
-
VersionAdded: '0.59'
|
17
11
|
|
18
12
|
Performance/CollectionLiteralInLoop:
|
19
|
-
Description: Extract Array and Hash literals outside of loops into local variables
|
20
|
-
or constants.
|
21
13
|
Enabled: true
|
22
|
-
VersionAdded: '1.8'
|
23
14
|
MinSize: 1
|
24
15
|
|
25
16
|
Performance/CompareWithBlock:
|
26
|
-
Description: Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.
|
27
17
|
Enabled: true
|
28
|
-
VersionAdded: '0.46'
|
29
18
|
|
30
19
|
Performance/ConstantRegexp:
|
31
|
-
Description: Finds regular expressions with dynamic components that are all constants.
|
32
20
|
Enabled: true
|
33
|
-
VersionAdded: '1.9'
|
34
|
-
VersionChanged: '1.10'
|
35
21
|
|
36
22
|
Performance/Count:
|
37
|
-
Description: Use `count` instead of `{select,find_all,filter,reject}...{size,count,length}`.
|
38
23
|
Enabled: true
|
39
|
-
VersionAdded: '0.31'
|
40
|
-
VersionChanged: '1.8'
|
41
24
|
|
42
25
|
Performance/DeletePrefix:
|
43
|
-
Description: Use `delete_prefix` instead of `gsub`.
|
44
26
|
Enabled: true
|
45
|
-
Safe: false
|
46
27
|
SafeMultiline: false
|
47
|
-
VersionAdded: '1.6'
|
48
|
-
VersionChanged: '1.11'
|
49
28
|
|
50
29
|
Performance/DeleteSuffix:
|
51
|
-
Description: Use `delete_suffix` instead of `gsub`.
|
52
30
|
Enabled: true
|
53
|
-
Safe: false
|
54
31
|
SafeMultiline: false
|
55
|
-
VersionAdded: '1.6'
|
56
|
-
VersionChanged: '1.11'
|
57
32
|
|
58
33
|
Performance/Detect:
|
59
|
-
Description: Use `detect` instead of `select.first`, `find_all.first`, `filter.first`,
|
60
|
-
`select.last`, `find_all.last`, and `filter.last`.
|
61
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
|
62
34
|
Enabled: true
|
63
|
-
VersionAdded: '0.30'
|
64
|
-
VersionChanged: '1.8'
|
65
35
|
|
66
36
|
Performance/DoubleStartEndWith:
|
67
|
-
Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x,
|
68
|
-
...) || str.{start,end}_with?(y, ...)`.
|
69
37
|
Enabled: true
|
70
|
-
VersionAdded: '0.36'
|
71
|
-
VersionChanged: '0.48'
|
72
38
|
IncludeActiveSupportAliases: true
|
73
39
|
|
74
40
|
Performance/EndWith:
|
75
|
-
Description: Use `end_with?` instead of a regex match anchored to the end of a string.
|
76
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
77
41
|
Enabled: true
|
78
42
|
SafeMultiline: false
|
79
|
-
VersionAdded: '0.36'
|
80
|
-
VersionChanged: '1.10'
|
81
43
|
|
82
44
|
Performance/FixedSize:
|
83
|
-
Description: Do not compute the size of statically sized objects except in constants.
|
84
45
|
Enabled: true
|
85
|
-
VersionAdded: '0.35'
|
86
46
|
|
87
47
|
Performance/FlatMap:
|
88
|
-
Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
|
89
|
-
or `Enumerable#collect..Array#flatten(1)`.
|
90
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
|
91
48
|
Enabled: true
|
92
|
-
VersionAdded: '0.30'
|
93
49
|
EnabledForFlattenWithoutParams: true
|
94
50
|
|
95
51
|
Performance/InefficientHashSearch:
|
96
|
-
Description: Use `key?` or `value?` instead of `keys.include?` or `values.include?`.
|
97
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#hashkey-instead-of-hashkeysinclude-code
|
98
52
|
Enabled: true
|
99
|
-
VersionAdded: '0.56'
|
100
|
-
Safe: false
|
101
53
|
|
102
54
|
Performance/IoReadlines:
|
103
|
-
Description: Use `IO.each_line` (`IO#each_line`) instead of `IO.readlines` (`IO#readlines`).
|
104
|
-
Reference: https://docs.gitlab.com/ee/development/performance.html#reading-from-files-and-other-data-sources
|
105
55
|
Enabled: true
|
106
|
-
VersionAdded: '1.7'
|
107
56
|
|
108
57
|
Performance/MapCompact:
|
109
|
-
Description: Use `filter_map` instead of `collection.map(&:do_something).compact`.
|
110
58
|
Enabled: true
|
111
|
-
|
59
|
+
|
60
|
+
Performance/MapMethodChain:
|
61
|
+
Enabled: true
|
112
62
|
|
113
63
|
Performance/MethodObjectAsBlock:
|
114
|
-
Description: Use block explicitly instead of block-passing a method object.
|
115
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#normal-way-to-apply-method-vs-method-code
|
116
64
|
Enabled: true
|
117
|
-
VersionAdded: '1.9'
|
118
65
|
|
119
66
|
Performance/OpenStruct:
|
120
|
-
Description: Use `Struct` instead of `OpenStruct`.
|
121
67
|
Enabled: true
|
122
|
-
VersionAdded: '0.61'
|
123
|
-
Safe: false
|
124
68
|
|
125
69
|
Performance/RangeInclude:
|
126
|
-
Description: Use `Range#cover?` instead of `Range#include?` (or `Range#member?`).
|
127
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
|
128
70
|
Enabled: true
|
129
|
-
VersionAdded: '0.36'
|
130
|
-
VersionChanged: '1.7'
|
131
|
-
Safe: false
|
132
71
|
|
133
72
|
Performance/RedundantBlockCall:
|
134
|
-
Description: Use `yield` instead of `block.call`.
|
135
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode
|
136
73
|
Enabled: true
|
137
|
-
VersionAdded: '0.36'
|
138
74
|
|
139
75
|
Performance/RedundantEqualityComparisonBlock:
|
140
|
-
Description: Checks for uses `Enumerable#all?`, `Enumerable#any?`, `Enumerable#one?`,
|
141
|
-
or `Enumerable#none?` are compared with `===` or similar methods in block.
|
142
|
-
Reference: https://github.com/rails/rails/pull/41363
|
143
76
|
Enabled: true
|
144
|
-
Safe: false
|
145
|
-
VersionAdded: '1.10'
|
146
77
|
AllowRegexpMatch: true
|
147
78
|
|
148
79
|
Performance/RedundantMatch:
|
149
|
-
Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where
|
150
|
-
the returned `MatchData` is not needed.
|
151
80
|
Enabled: true
|
152
|
-
VersionAdded: '0.36'
|
153
81
|
|
154
82
|
Performance/RedundantMerge:
|
155
|
-
Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
|
156
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
|
157
83
|
Enabled: true
|
158
|
-
Safe: false
|
159
|
-
VersionAdded: '0.36'
|
160
|
-
VersionChanged: '1.11'
|
161
84
|
MaxKeyValuePairs: 2
|
162
85
|
Exclude:
|
163
86
|
- './**/*.json.jbuilder'
|
164
87
|
|
165
88
|
Performance/RedundantSortBlock:
|
166
|
-
Description: Use `sort` instead of `sort { |a, b| a <=> b }`.
|
167
89
|
Enabled: true
|
168
|
-
VersionAdded: '1.7'
|
169
90
|
|
170
91
|
Performance/RedundantSplitRegexpArgument:
|
171
|
-
Description: Identifies places where `split` argument can be replaced from a deterministic
|
172
|
-
regexp to a string.
|
173
92
|
Enabled: true
|
174
|
-
VersionAdded: '1.10'
|
175
93
|
|
176
94
|
Performance/RedundantStringChars:
|
177
|
-
Description: Checks for redundant `String#chars`.
|
178
95
|
Enabled: true
|
179
|
-
VersionAdded: '1.7'
|
180
96
|
|
181
97
|
Performance/RegexpMatch:
|
182
|
-
Description: Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
|
183
|
-
`Regexp#===`, or `=~` when `MatchData` is not used.
|
184
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#regexp-vs-stringmatch-vs-string-vs-stringmatch-code-
|
185
98
|
Enabled: true
|
186
|
-
VersionAdded: '0.47'
|
187
99
|
|
188
100
|
Performance/ReverseEach:
|
189
|
-
Description: Use `reverse_each` instead of `reverse.each`.
|
190
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
|
191
101
|
Enabled: true
|
192
|
-
VersionAdded: '0.30'
|
193
102
|
|
194
103
|
Performance/ReverseFirst:
|
195
|
-
Description: Use `last(n).reverse` instead of `reverse.first(n)`.
|
196
104
|
Enabled: true
|
197
|
-
VersionAdded: '1.7'
|
198
105
|
|
199
106
|
Performance/SelectMap:
|
200
|
-
Description: Use `filter_map` instead of `ary.select(&:foo).map(&:bar)`.
|
201
107
|
Enabled: true
|
202
|
-
VersionAdded: '1.11'
|
203
108
|
|
204
109
|
Performance/Size:
|
205
|
-
Description: Use `size` instead of `count` for counting the number of elements in
|
206
|
-
`Array` and `Hash`.
|
207
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code
|
208
110
|
Enabled: true
|
209
|
-
VersionAdded: '0.30'
|
210
111
|
|
211
112
|
Performance/SortReverse:
|
212
|
-
Description: Use `sort.reverse` instead of `sort { |a, b| b <=> a }`.
|
213
113
|
Enabled: true
|
214
|
-
VersionAdded: '1.7'
|
215
114
|
|
216
115
|
Performance/Squeeze:
|
217
|
-
Description: Use `squeeze('a')` instead of `gsub(/a+/, 'a')`.
|
218
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#remove-extra-spaces-or-other-contiguous-characters-code
|
219
116
|
Enabled: true
|
220
|
-
VersionAdded: '1.7'
|
221
117
|
|
222
118
|
Performance/StartWith:
|
223
|
-
Description: Use `start_with?` instead of a regex match anchored to the beginning
|
224
|
-
of a string.
|
225
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
226
119
|
Enabled: true
|
227
120
|
SafeMultiline: false
|
228
|
-
VersionAdded: '0.36'
|
229
|
-
VersionChanged: '1.10'
|
230
121
|
|
231
122
|
Performance/StringIdentifierArgument:
|
232
|
-
Description: Use symbol identifier argument instead of string identifier argument.
|
233
123
|
Enabled: true
|
234
|
-
VersionAdded: '1.13'
|
235
124
|
|
236
125
|
Performance/StringInclude:
|
237
|
-
Description: Use `String#include?` instead of a regex match with literal-only pattern.
|
238
126
|
Enabled: true
|
239
|
-
VersionAdded: '1.7'
|
240
|
-
VersionChanged: '1.12'
|
241
127
|
|
242
128
|
Performance/StringReplacement:
|
243
|
-
Description: Use `tr` instead of `gsub` when you are replacing the same number of
|
244
|
-
characters. Use `delete` instead of `gsub` when you are deleting characters.
|
245
|
-
Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
|
246
129
|
Enabled: true
|
247
|
-
VersionAdded: '0.33'
|
248
130
|
|
249
131
|
Performance/Sum:
|
250
|
-
Description: Use `sum` instead of a custom array summation.
|
251
|
-
Reference: https://blog.bigbinary.com/2016/11/02/ruby-2-4-introduces-enumerable-sum.html
|
252
132
|
Enabled: true
|
253
|
-
VersionAdded: '1.8'
|
254
|
-
VersionChanged: '1.13'
|
255
133
|
OnlySumOrWithInitialValue: false
|
256
134
|
|
257
135
|
Performance/TimesMap:
|
258
|
-
Description: Checks for .times.map calls.
|
259
136
|
Enabled: true
|
260
|
-
VersionAdded: '0.36'
|
261
|
-
VersionChanged: '1.13'
|
data/config/security.yml
CHANGED
@@ -1,51 +1,20 @@
|
|
1
1
|
Security/CompoundHash:
|
2
|
-
Description: 'When overwriting Object#hash to combine values, prefer delegating to Array#hash over writing a custom implementation.'
|
3
2
|
Enabled: true
|
4
|
-
VersionAdded: '1.28'
|
5
3
|
|
6
4
|
Security/Eval:
|
7
|
-
Description: 'The use of eval represents a serious security risk.'
|
8
5
|
Enabled: true
|
9
|
-
VersionAdded: '0.47'
|
10
6
|
|
11
7
|
Security/IoMethods:
|
12
|
-
Description: >-
|
13
|
-
Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`,
|
14
|
-
`IO.foreach`, and `IO.readlines`.
|
15
8
|
Enabled: true
|
16
|
-
Safe: false
|
17
|
-
VersionAdded: '1.22'
|
18
9
|
|
19
10
|
Security/JSONLoad:
|
20
|
-
Description: >-
|
21
|
-
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
22
|
-
security issues. See reference for more information.
|
23
|
-
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
24
11
|
Enabled: true
|
25
|
-
VersionAdded: '0.43'
|
26
|
-
VersionChanged: '1.22'
|
27
|
-
# Autocorrect here will change to a method that may cause crashes depending
|
28
|
-
# on the value of the argument.
|
29
12
|
|
30
13
|
Security/MarshalLoad:
|
31
|
-
Description: >-
|
32
|
-
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
|
33
|
-
security issues. See reference for more information.
|
34
|
-
Reference: 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
|
35
14
|
Enabled: true
|
36
|
-
VersionAdded: '0.47'
|
37
15
|
|
38
16
|
Security/Open:
|
39
|
-
Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
|
40
17
|
Enabled: true
|
41
|
-
VersionAdded: '0.53'
|
42
|
-
VersionChanged: '1.0'
|
43
|
-
Safe: false
|
44
18
|
|
45
19
|
Security/YAMLLoad:
|
46
|
-
Description: >-
|
47
|
-
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
|
48
|
-
security issues. See reference for more information.
|
49
|
-
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
|
50
20
|
Enabled: true
|
51
|
-
VersionAdded: '0.47'
|