rubocop-airbnb 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +2 -0
- data/Gemfile +7 -0
- data/LICENSE.md +9 -0
- data/README.md +68 -0
- data/config/default.yml +39 -0
- data/config/rubocop-airbnb.yml +96 -0
- data/config/rubocop-bundler.yml +8 -0
- data/config/rubocop-gemspec.yml +9 -0
- data/config/rubocop-layout.yml +514 -0
- data/config/rubocop-lint.yml +315 -0
- data/config/rubocop-metrics.yml +47 -0
- data/config/rubocop-naming.yml +68 -0
- data/config/rubocop-performance.yml +143 -0
- data/config/rubocop-rails.yml +193 -0
- data/config/rubocop-rspec.yml +281 -0
- data/config/rubocop-security.yml +13 -0
- data/config/rubocop-style.yml +953 -0
- data/lib/rubocop-airbnb.rb +11 -0
- data/lib/rubocop/airbnb.rb +16 -0
- data/lib/rubocop/airbnb/inflections.rb +14 -0
- data/lib/rubocop/airbnb/inject.rb +20 -0
- data/lib/rubocop/airbnb/rails_autoloading.rb +55 -0
- data/lib/rubocop/airbnb/version.rb +8 -0
- data/lib/rubocop/cop/airbnb/class_name.rb +47 -0
- data/lib/rubocop/cop/airbnb/class_or_module_declared_in_wrong_file.rb +138 -0
- data/lib/rubocop/cop/airbnb/const_assigned_in_wrong_file.rb +74 -0
- data/lib/rubocop/cop/airbnb/continuation_slash.rb +25 -0
- data/lib/rubocop/cop/airbnb/default_scope.rb +20 -0
- data/lib/rubocop/cop/airbnb/factory_attr_references_class.rb +74 -0
- data/lib/rubocop/cop/airbnb/factory_class_use_string.rb +39 -0
- data/lib/rubocop/cop/airbnb/mass_assignment_accessible_modifier.rb +18 -0
- data/lib/rubocop/cop/airbnb/module_method_in_wrong_file.rb +104 -0
- data/lib/rubocop/cop/airbnb/no_timeout.rb +19 -0
- data/lib/rubocop/cop/airbnb/opt_arg_parameters.rb +38 -0
- data/lib/rubocop/cop/airbnb/phrase_bundle_keys.rb +67 -0
- data/lib/rubocop/cop/airbnb/risky_activerecord_invocation.rb +63 -0
- data/lib/rubocop/cop/airbnb/rspec_describe_or_context_under_namespace.rb +114 -0
- data/lib/rubocop/cop/airbnb/rspec_environment_modification.rb +58 -0
- data/lib/rubocop/cop/airbnb/simple_modifier_conditional.rb +23 -0
- data/lib/rubocop/cop/airbnb/spec_constant_assignment.rb +55 -0
- data/lib/rubocop/cop/airbnb/unsafe_yaml_marshal.rb +47 -0
- data/rubocop-airbnb.gemspec +32 -0
- data/spec/rubocop/cop/airbnb/class_name_spec.rb +78 -0
- data/spec/rubocop/cop/airbnb/class_or_module_declared_in_wrong_file_spec.rb +174 -0
- data/spec/rubocop/cop/airbnb/const_assigned_in_wrong_file_spec.rb +178 -0
- data/spec/rubocop/cop/airbnb/continuation_slash_spec.rb +162 -0
- data/spec/rubocop/cop/airbnb/default_scope_spec.rb +38 -0
- data/spec/rubocop/cop/airbnb/factory_attr_references_class_spec.rb +160 -0
- data/spec/rubocop/cop/airbnb/factory_class_use_string_spec.rb +26 -0
- data/spec/rubocop/cop/airbnb/mass_assignment_accessible_modifier_spec.rb +28 -0
- data/spec/rubocop/cop/airbnb/module_method_in_wrong_file_spec.rb +181 -0
- data/spec/rubocop/cop/airbnb/no_timeout_spec.rb +30 -0
- data/spec/rubocop/cop/airbnb/opt_arg_parameter_spec.rb +103 -0
- data/spec/rubocop/cop/airbnb/phrase_bundle_keys_spec.rb +74 -0
- data/spec/rubocop/cop/airbnb/risky_activerecord_invocation_spec.rb +54 -0
- data/spec/rubocop/cop/airbnb/rspec_describe_or_context_under_namespace_spec.rb +284 -0
- data/spec/rubocop/cop/airbnb/rspec_environment_modification_spec.rb +64 -0
- data/spec/rubocop/cop/airbnb/simple_modifier_conditional_spec.rb +122 -0
- data/spec/rubocop/cop/airbnb/spec_constant_assignment_spec.rb +80 -0
- data/spec/rubocop/cop/airbnb/unsafe_yaml_marshal_spec.rb +50 -0
- data/spec/spec_helper.rb +35 -0
- metadata +150 -0
@@ -0,0 +1,315 @@
|
|
1
|
+
Lint/AmbiguousBlockAssociation:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
Lint/AmbiguousOperator:
|
5
|
+
Description: Checks for ambiguous operators in the first argument of a method invocation
|
6
|
+
without parentheses.
|
7
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
|
8
|
+
Enabled: true
|
9
|
+
|
10
|
+
Lint/AmbiguousRegexpLiteral:
|
11
|
+
Description: Checks for ambiguous regexp literals in the first argument of a method
|
12
|
+
invocation without parenthesis.
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Lint/AssignmentInCondition:
|
16
|
+
Description: Don't use assignment in conditions.
|
17
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
18
|
+
Enabled: true
|
19
|
+
AllowSafeAssignment: false
|
20
|
+
|
21
|
+
# Supports --auto-correct
|
22
|
+
Lint/BlockAlignment:
|
23
|
+
Description: Align block ends correctly.
|
24
|
+
Enabled: true
|
25
|
+
|
26
|
+
Lint/BooleanSymbol:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Lint/CircularArgumentReference:
|
30
|
+
Description: Don't refer to the keyword argument in the default value.
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Lint/ConditionPosition:
|
34
|
+
Description: Checks for condition placed in a confusing position relative to the keyword.
|
35
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
|
36
|
+
Enabled: true
|
37
|
+
|
38
|
+
Lint/Debugger:
|
39
|
+
Description: Check for debugger calls.
|
40
|
+
Enabled: true
|
41
|
+
|
42
|
+
# Supports --auto-correct
|
43
|
+
Lint/DefEndAlignment:
|
44
|
+
Description: Align ends corresponding to defs correctly.
|
45
|
+
Enabled: true
|
46
|
+
EnforcedStyleAlignWith: start_of_line
|
47
|
+
AutoCorrect: false
|
48
|
+
|
49
|
+
# Supports --auto-correct
|
50
|
+
Lint/DeprecatedClassMethods:
|
51
|
+
Description: Check for deprecated class method calls.
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
Lint/DuplicateCaseCondition:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
Lint/DuplicateMethods:
|
58
|
+
Description: Check for duplicate methods calls.
|
59
|
+
Enabled: true
|
60
|
+
|
61
|
+
Lint/DuplicatedKey:
|
62
|
+
Description: Check for duplicate keys in hash literals.
|
63
|
+
Enabled: true
|
64
|
+
|
65
|
+
Lint/EachWithObjectArgument:
|
66
|
+
Description: Check for immutable argument given to each_with_object.
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Lint/ElseLayout:
|
70
|
+
Description: Check for odd code arrangement in an else block.
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
Lint/EmptyEnsure:
|
74
|
+
Description: Checks for empty ensure block.
|
75
|
+
Enabled: false
|
76
|
+
|
77
|
+
Lint/EmptyInterpolation:
|
78
|
+
Description: Checks for empty string interpolation.
|
79
|
+
Enabled: true
|
80
|
+
|
81
|
+
Lint/EmptyWhen:
|
82
|
+
Enabled: false
|
83
|
+
|
84
|
+
# Supports --auto-correct
|
85
|
+
Lint/EndAlignment:
|
86
|
+
Description: Align ends correctly.
|
87
|
+
# The value `keyword` means that `end` should be aligned with the matching
|
88
|
+
# keyword (if, while, etc.).
|
89
|
+
# The value `variable` means that in assignments, `end` should be aligned
|
90
|
+
# with the start of the variable on the left hand side of `=`. In all other
|
91
|
+
# situations, `end` should still be aligned with the keyword.
|
92
|
+
# The value `start_of_line` means that `end` should be aligned with the start
|
93
|
+
# of the line which the matching keyword appears on.
|
94
|
+
Enabled: true
|
95
|
+
EnforcedStyleAlignWith: keyword
|
96
|
+
AutoCorrect: false
|
97
|
+
|
98
|
+
Lint/EndInMethod:
|
99
|
+
Description: END blocks should not be placed inside method definitions.
|
100
|
+
Enabled: false
|
101
|
+
|
102
|
+
Lint/EnsureReturn:
|
103
|
+
Description: Do not use return in an ensure block.
|
104
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
Lint/FloatOutOfRange:
|
108
|
+
Description: Catches floating-point literals too large or small for Ruby to represent.
|
109
|
+
Enabled: false
|
110
|
+
|
111
|
+
Lint/FormatParameterMismatch:
|
112
|
+
Description: The number of parameters to format/sprint must match the fields.
|
113
|
+
Enabled: true
|
114
|
+
|
115
|
+
Lint/HandleExceptions:
|
116
|
+
Description: Don't suppress exception.
|
117
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
Lint/ImplicitStringConcatenation:
|
121
|
+
Description: Checks for adjacent string literals on the same line, which could better
|
122
|
+
be represented as a single string literal.
|
123
|
+
Enabled: true
|
124
|
+
|
125
|
+
Lint/IneffectiveAccessModifier:
|
126
|
+
Description: Checks for attempts to use `private` or `protected` to set the visibility
|
127
|
+
of a class method, which does not work.
|
128
|
+
Enabled: true
|
129
|
+
|
130
|
+
Lint/InheritException:
|
131
|
+
Enabled: true
|
132
|
+
# The default base class in favour of `Exception`.
|
133
|
+
EnforcedStyle: standard_error
|
134
|
+
|
135
|
+
Lint/InterpolationCheck:
|
136
|
+
Enabled: false
|
137
|
+
|
138
|
+
Lint/LiteralAsCondition:
|
139
|
+
Description: Checks of literals used in conditions.
|
140
|
+
Enabled: false
|
141
|
+
|
142
|
+
# Supports --auto-correct
|
143
|
+
Lint/LiteralInInterpolation:
|
144
|
+
Description: Avoid interpolating literals in strings
|
145
|
+
Enabled: false
|
146
|
+
AutoCorrect: false
|
147
|
+
|
148
|
+
Lint/Loop:
|
149
|
+
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
|
150
|
+
for post-loop tests.
|
151
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
|
152
|
+
Enabled: false
|
153
|
+
|
154
|
+
Lint/MissingCopEnableDirective:
|
155
|
+
# Maximum number of consecutive lines the cop can be disabled for.
|
156
|
+
# 0 allows only single-line disables
|
157
|
+
# 1 would mean the maximum allowed is the following:
|
158
|
+
# # rubocop:disable SomeCop
|
159
|
+
# a = 1
|
160
|
+
# # rubocop:enable SomeCop
|
161
|
+
# .inf for any size
|
162
|
+
MaximumRangeSize: .inf
|
163
|
+
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`'
|
164
|
+
Enabled: true
|
165
|
+
|
166
|
+
Lint/MultipleCompare:
|
167
|
+
Enabled: false
|
168
|
+
|
169
|
+
Lint/NestedMethodDefinition:
|
170
|
+
Description: Do not use nested method definitions.
|
171
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-methods
|
172
|
+
Enabled: false
|
173
|
+
|
174
|
+
Lint/NextWithoutAccumulator:
|
175
|
+
Enabled: false
|
176
|
+
|
177
|
+
Lint/NonLocalExitFromIterator:
|
178
|
+
Description: Do not use return in iterator to cause non-local exit.
|
179
|
+
Enabled: false
|
180
|
+
|
181
|
+
Lint/ParenthesesAsGroupedExpression:
|
182
|
+
Description: Checks for method calls with a space before the opening parenthesis.
|
183
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
|
184
|
+
Enabled: true
|
185
|
+
|
186
|
+
Lint/PercentStringArray:
|
187
|
+
Description: >-
|
188
|
+
Checks for unwanted commas and quotes in %w/%W literals.
|
189
|
+
Enabled: true
|
190
|
+
|
191
|
+
Lint/PercentSymbolArray:
|
192
|
+
Enabled: false
|
193
|
+
|
194
|
+
Lint/RandOne:
|
195
|
+
Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely
|
196
|
+
a mistake.
|
197
|
+
Enabled: true
|
198
|
+
|
199
|
+
Lint/RedundantWithIndex:
|
200
|
+
Enabled: false
|
201
|
+
|
202
|
+
Lint/RedundantWithObject:
|
203
|
+
Enabled: false
|
204
|
+
|
205
|
+
Lint/RegexpAsCondition:
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
Lint/RequireParentheses:
|
209
|
+
Description: Use parentheses in the method call to avoid confusion about precedence.
|
210
|
+
Enabled: true
|
211
|
+
|
212
|
+
Lint/RescueException:
|
213
|
+
Description: Avoid rescuing the Exception class.
|
214
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-blind-rescues
|
215
|
+
Enabled: true
|
216
|
+
|
217
|
+
Lint/RescueType:
|
218
|
+
Enabled: false
|
219
|
+
|
220
|
+
Lint/ReturnInVoidContext:
|
221
|
+
Enabled: false
|
222
|
+
|
223
|
+
Lint/SafeNavigationChain:
|
224
|
+
Enabled: false
|
225
|
+
|
226
|
+
Lint/ScriptPermission:
|
227
|
+
Enabled: false
|
228
|
+
|
229
|
+
Lint/ShadowedArgument:
|
230
|
+
Description: 'Avoid reassigning arguments before they were used.'
|
231
|
+
Enabled: true
|
232
|
+
|
233
|
+
Lint/ShadowedException:
|
234
|
+
Description: >-
|
235
|
+
Avoid rescuing a higher level exception
|
236
|
+
before a lower level exception.
|
237
|
+
Enabled: false
|
238
|
+
|
239
|
+
Lint/ShadowingOuterLocalVariable:
|
240
|
+
Description: Do not use the same name as outer local variable for block arguments
|
241
|
+
or block local variables.
|
242
|
+
Enabled: true
|
243
|
+
|
244
|
+
# Supports --auto-correct
|
245
|
+
Lint/StringConversionInInterpolation:
|
246
|
+
Description: Checks for Object#to_s usage in string interpolation.
|
247
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-to-s
|
248
|
+
Enabled: true
|
249
|
+
|
250
|
+
Lint/UnderscorePrefixedVariableName:
|
251
|
+
Description: Do not use prefix `_` for a variable that is used.
|
252
|
+
Enabled: false
|
253
|
+
|
254
|
+
Lint/UnifiedInteger:
|
255
|
+
Enabled: false
|
256
|
+
|
257
|
+
Lint/UnneededDisable:
|
258
|
+
Description: >-
|
259
|
+
Checks for rubocop:disable comments that can be removed.
|
260
|
+
Note: this cop is not disabled when disabling all cops. It must be explicitly disabled.
|
261
|
+
Enabled: true
|
262
|
+
|
263
|
+
Lint/UnneededRequireStatement:
|
264
|
+
Enabled: false
|
265
|
+
|
266
|
+
Lint/UnneededSplatExpansion:
|
267
|
+
Enabled: false
|
268
|
+
|
269
|
+
Lint/UnreachableCode:
|
270
|
+
Description: Unreachable code.
|
271
|
+
Enabled: false
|
272
|
+
|
273
|
+
# Supports --auto-correct
|
274
|
+
Lint/UnusedBlockArgument:
|
275
|
+
Description: Checks for unused block arguments.
|
276
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
277
|
+
Enabled: false
|
278
|
+
|
279
|
+
# Supports --auto-correct
|
280
|
+
Lint/UnusedMethodArgument:
|
281
|
+
Description: Checks for unused method arguments.
|
282
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
283
|
+
Enabled: false
|
284
|
+
|
285
|
+
Lint/UriEscapeUnescape:
|
286
|
+
Enabled: false
|
287
|
+
|
288
|
+
Lint/UriRegexp:
|
289
|
+
Enabled: false
|
290
|
+
|
291
|
+
Lint/UselessAccessModifier:
|
292
|
+
Description: Checks for useless access modifiers.
|
293
|
+
Enabled: true
|
294
|
+
|
295
|
+
Lint/UselessAssignment:
|
296
|
+
Description: Checks for useless assignment to a local variable.
|
297
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars
|
298
|
+
Enabled: true
|
299
|
+
|
300
|
+
Lint/UselessComparison:
|
301
|
+
Description: Checks for comparison of something with itself.
|
302
|
+
Enabled: true
|
303
|
+
|
304
|
+
Lint/UselessElseWithoutRescue:
|
305
|
+
Description: Checks for useless `else` in `begin..end` without `rescue`.
|
306
|
+
Enabled: true
|
307
|
+
|
308
|
+
Lint/UselessSetterCall:
|
309
|
+
Description: Checks for useless setter call to a local variable.
|
310
|
+
Enabled: true
|
311
|
+
|
312
|
+
Lint/Void:
|
313
|
+
Description: Possible use of operator/literal/variable in void context.
|
314
|
+
Enabled: false
|
315
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# We're using cane for ABC complexity checks
|
2
|
+
Metrics/AbcSize:
|
3
|
+
Enabled: false
|
4
|
+
|
5
|
+
Metrics/BlockLength:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
Metrics/BlockNesting:
|
9
|
+
Description: Avoid excessive block nesting
|
10
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
|
11
|
+
Enabled: false
|
12
|
+
Max: 3
|
13
|
+
|
14
|
+
# We are not perfect robot-humans
|
15
|
+
Metrics/ClassLength:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Metrics/CyclomaticComplexity:
|
19
|
+
Description: A complexity metric that is strongly correlated to the number of test
|
20
|
+
cases needed to validate a method.
|
21
|
+
Enabled: false
|
22
|
+
Max: 6
|
23
|
+
|
24
|
+
Metrics/LineLength:
|
25
|
+
Max: 100
|
26
|
+
AllowURI: true
|
27
|
+
|
28
|
+
Metrics/MethodLength:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Metrics/ModuleLength:
|
32
|
+
Description: Avoid modules longer than 100 lines of code.
|
33
|
+
Enabled: false
|
34
|
+
CountComments: false
|
35
|
+
Max: 100
|
36
|
+
|
37
|
+
Metrics/ParameterLists:
|
38
|
+
Description: Avoid parameter lists longer than three or four parameters.
|
39
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
40
|
+
Enabled: false
|
41
|
+
Max: 5
|
42
|
+
CountKeywordArgs: true
|
43
|
+
|
44
|
+
Metrics/PerceivedComplexity:
|
45
|
+
Description: A complexity metric geared towards measuring complexity for a human reader.
|
46
|
+
Enabled: false
|
47
|
+
Max: 7
|
@@ -0,0 +1,68 @@
|
|
1
|
+
Naming/AccessorMethodName:
|
2
|
+
Description: Check the naming of accessor methods for get_/set_.
|
3
|
+
Enabled: false
|
4
|
+
|
5
|
+
Naming/AsciiIdentifiers:
|
6
|
+
Description: Use only ascii symbols in identifiers.
|
7
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
|
8
|
+
Enabled: true
|
9
|
+
|
10
|
+
Naming/BinaryOperatorParameterName:
|
11
|
+
Description: When defining binary operators, name the argument other.
|
12
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Naming/ClassAndModuleCamelCase:
|
16
|
+
Description: Use CamelCase for classes and modules.
|
17
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#camelcase-classes
|
18
|
+
Enabled: true
|
19
|
+
|
20
|
+
Naming/ConstantName:
|
21
|
+
Description: Constants should use SCREAMING_SNAKE_CASE.
|
22
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#screaming-snake-case
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Naming/FileName:
|
26
|
+
Description: Use snake_case for source file names.
|
27
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Naming/HeredocDelimiterCase:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Naming/HeredocDelimiterNaming:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
Naming/MethodName:
|
37
|
+
Description: Use the configured style when naming methods.
|
38
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
39
|
+
Enabled: false
|
40
|
+
EnforcedStyle: snake_case
|
41
|
+
SupportedStyles:
|
42
|
+
- snake_case
|
43
|
+
- camelCase
|
44
|
+
|
45
|
+
Naming/PredicateName:
|
46
|
+
Description: Check the names of predicate methods.
|
47
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
48
|
+
Enabled: false
|
49
|
+
NamePrefix:
|
50
|
+
- is_
|
51
|
+
- has_
|
52
|
+
- have_
|
53
|
+
NamePrefixBlacklist:
|
54
|
+
- is_
|
55
|
+
- has_
|
56
|
+
- have_
|
57
|
+
|
58
|
+
Naming/VariableName:
|
59
|
+
Description: Use the configured style when naming variables.
|
60
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
|
61
|
+
Enabled: true
|
62
|
+
EnforcedStyle: snake_case
|
63
|
+
SupportedStyles:
|
64
|
+
- snake_case
|
65
|
+
- camelCase
|
66
|
+
|
67
|
+
Naming/VariableNumber:
|
68
|
+
Enabled: false
|
@@ -0,0 +1,143 @@
|
|
1
|
+
Performance/Caller:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
# Type 'Performance' (8):
|
5
|
+
# Supports --auto-correct
|
6
|
+
Performance/CaseWhenSplat:
|
7
|
+
Description: Place `when` conditions that use splat at the end of the list of `when`
|
8
|
+
branches.
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
# Supports --auto-correct
|
12
|
+
Performance/Casecmp:
|
13
|
+
Description: Use `casecmp` rather than `downcase ==`.
|
14
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Performance/CompareWithBlock:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
# Supports --auto-correct
|
21
|
+
Performance/Count:
|
22
|
+
Description: Use `count` instead of `select...size`, `reject...size`, `select...count`,
|
23
|
+
`reject...count`, `select...length`, and `reject...length`.
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
# Supports --auto-correct
|
27
|
+
Performance/Detect:
|
28
|
+
Description: Use `detect` instead of `select.first`, `find_all.first`, `select.last`,
|
29
|
+
and `find_all.last`.
|
30
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Performance/DoubleStartEndWith:
|
34
|
+
Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x,
|
35
|
+
...) || str.{start,end}_with?(y, ...)`.
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
# Supports --auto-correct
|
39
|
+
Performance/EndWith:
|
40
|
+
Description: Use `end_with?` instead of a regex match anchored to the end of a string.
|
41
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Performance/FixedSize:
|
45
|
+
Description: Do not compute the size of statically sized objects except in constants
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
# Supports --auto-correct
|
49
|
+
Performance/FlatMap:
|
50
|
+
Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
|
51
|
+
or `Enumberable#collect..Array#flatten(1)`
|
52
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
|
53
|
+
Enabled: false
|
54
|
+
EnabledForFlattenWithoutParams: false
|
55
|
+
|
56
|
+
# Supports --auto-correct
|
57
|
+
Performance/HashEachMethods:
|
58
|
+
Description: Use `Hash#each_key` and `Hash#each_value` instead of `Hash#keys.each`
|
59
|
+
and `Hash#values.each`.
|
60
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#hash-each
|
61
|
+
Enabled: false
|
62
|
+
AutoCorrect: false
|
63
|
+
|
64
|
+
# Supports --auto-correct
|
65
|
+
Performance/LstripRstrip:
|
66
|
+
Description: Use `strip` instead of `lstrip.rstrip`.
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
# Supports --auto-correct
|
70
|
+
Performance/RangeInclude:
|
71
|
+
Description: Use `Range#cover?` instead of `Range#include?`.
|
72
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
|
73
|
+
Enabled: false
|
74
|
+
|
75
|
+
# Supports --auto-correct
|
76
|
+
Performance/RedundantBlockCall:
|
77
|
+
Description: Use `yield` instead of `block.call`.
|
78
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
# Supports --auto-correct
|
82
|
+
Performance/RedundantMatch:
|
83
|
+
Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where
|
84
|
+
the returned `MatchData` is not needed.
|
85
|
+
Enabled: false
|
86
|
+
|
87
|
+
# Supports --auto-correct
|
88
|
+
Performance/RedundantMerge:
|
89
|
+
Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
|
90
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
# Supports --auto-correct
|
94
|
+
Performance/RedundantSortBy:
|
95
|
+
Description: Use `sort` instead of `sort_by { |x| x }`.
|
96
|
+
Enabled: false
|
97
|
+
|
98
|
+
Performance/RegexpMatch:
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
# Supports --auto-correct
|
102
|
+
Performance/ReverseEach:
|
103
|
+
Description: Use `reverse_each` instead of `reverse.each`.
|
104
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
|
105
|
+
Enabled: false
|
106
|
+
|
107
|
+
# Supports --auto-correct
|
108
|
+
Performance/Sample:
|
109
|
+
Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`.
|
110
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code
|
111
|
+
Enabled: false
|
112
|
+
|
113
|
+
# Supports --auto-correct
|
114
|
+
Performance/Size:
|
115
|
+
Description: Use `size` instead of `count` for counting the number of elements in
|
116
|
+
`Array` and `Hash`.
|
117
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
# Supports --auto-correct
|
121
|
+
Performance/StartWith:
|
122
|
+
Description: Use `start_with?` instead of a regex match anchored to the beginning
|
123
|
+
of a string.
|
124
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
|
125
|
+
Enabled: false
|
126
|
+
|
127
|
+
# Supports --auto-correct
|
128
|
+
Performance/StringReplacement:
|
129
|
+
Description: Use `tr` instead of `gsub` when you are replacing the same number of
|
130
|
+
characters. Use `delete` instead of `gsub` when you are deleting characters.
|
131
|
+
Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
|
132
|
+
Enabled: false
|
133
|
+
|
134
|
+
Performance/TimesMap:
|
135
|
+
Description: Checks for .times.map calls.
|
136
|
+
Enabled: false
|
137
|
+
|
138
|
+
Performance/UnfreezeString:
|
139
|
+
Enabled: false
|
140
|
+
|
141
|
+
Performance/UriDefaultParser:
|
142
|
+
Enabled: false
|
143
|
+
|