rubocop-highlands 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +2 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE.md +9 -0
  5. data/README.md +68 -0
  6. data/config/default.yml +39 -0
  7. data/config/rubocop-bundler.yml +8 -0
  8. data/config/rubocop-gemspec.yml +9 -0
  9. data/config/rubocop-highlands.yml +100 -0
  10. data/config/rubocop-layout.yml +560 -0
  11. data/config/rubocop-lint.yml +301 -0
  12. data/config/rubocop-metrics.yml +47 -0
  13. data/config/rubocop-naming.yml +85 -0
  14. data/config/rubocop-performance.yml +141 -0
  15. data/config/rubocop-rails.yml +208 -0
  16. data/config/rubocop-rspec.yml +331 -0
  17. data/config/rubocop-security.yml +17 -0
  18. data/config/rubocop-style.yml +983 -0
  19. data/lib/rubocop-highlands.rb +11 -0
  20. data/lib/rubocop/cop/highlands/class_name.rb +47 -0
  21. data/lib/rubocop/cop/highlands/class_or_module_declared_in_wrong_file.rb +138 -0
  22. data/lib/rubocop/cop/highlands/const_assigned_in_wrong_file.rb +74 -0
  23. data/lib/rubocop/cop/highlands/continuation_slash.rb +25 -0
  24. data/lib/rubocop/cop/highlands/default_scope.rb +20 -0
  25. data/lib/rubocop/cop/highlands/factory_attr_references_class.rb +74 -0
  26. data/lib/rubocop/cop/highlands/factory_class_use_string.rb +39 -0
  27. data/lib/rubocop/cop/highlands/mass_assignment_accessible_modifier.rb +18 -0
  28. data/lib/rubocop/cop/highlands/module_method_in_wrong_file.rb +104 -0
  29. data/lib/rubocop/cop/highlands/no_timeout.rb +19 -0
  30. data/lib/rubocop/cop/highlands/opt_arg_parameters.rb +38 -0
  31. data/lib/rubocop/cop/highlands/phrase_bundle_keys.rb +67 -0
  32. data/lib/rubocop/cop/highlands/risky_activerecord_invocation.rb +63 -0
  33. data/lib/rubocop/cop/highlands/rspec_describe_or_context_under_namespace.rb +114 -0
  34. data/lib/rubocop/cop/highlands/rspec_environment_modification.rb +58 -0
  35. data/lib/rubocop/cop/highlands/simple_modifier_conditional.rb +23 -0
  36. data/lib/rubocop/cop/highlands/simple_unless.rb +19 -0
  37. data/lib/rubocop/cop/highlands/spec_constant_assignment.rb +55 -0
  38. data/lib/rubocop/cop/highlands/unsafe_yaml_marshal.rb +47 -0
  39. data/lib/rubocop/highlands.rb +16 -0
  40. data/lib/rubocop/highlands/inflections.rb +14 -0
  41. data/lib/rubocop/highlands/inject.rb +20 -0
  42. data/lib/rubocop/highlands/rails_autoloading.rb +55 -0
  43. data/lib/rubocop/highlands/version.rb +8 -0
  44. data/rubocop-highlands.gemspec +31 -0
  45. data/spec/rubocop/cop/highlands/class_name_spec.rb +78 -0
  46. data/spec/rubocop/cop/highlands/class_or_module_declared_in_wrong_file_spec.rb +174 -0
  47. data/spec/rubocop/cop/highlands/const_assigned_in_wrong_file_spec.rb +178 -0
  48. data/spec/rubocop/cop/highlands/continuation_slash_spec.rb +162 -0
  49. data/spec/rubocop/cop/highlands/default_scope_spec.rb +38 -0
  50. data/spec/rubocop/cop/highlands/factory_attr_references_class_spec.rb +160 -0
  51. data/spec/rubocop/cop/highlands/factory_class_use_string_spec.rb +26 -0
  52. data/spec/rubocop/cop/highlands/mass_assignment_accessible_modifier_spec.rb +28 -0
  53. data/spec/rubocop/cop/highlands/module_method_in_wrong_file_spec.rb +181 -0
  54. data/spec/rubocop/cop/highlands/no_timeout_spec.rb +30 -0
  55. data/spec/rubocop/cop/highlands/opt_arg_parameter_spec.rb +103 -0
  56. data/spec/rubocop/cop/highlands/phrase_bundle_keys_spec.rb +74 -0
  57. data/spec/rubocop/cop/highlands/risky_activerecord_invocation_spec.rb +54 -0
  58. data/spec/rubocop/cop/highlands/rspec_describe_or_context_under_namespace_spec.rb +284 -0
  59. data/spec/rubocop/cop/highlands/rspec_environment_modification_spec.rb +64 -0
  60. data/spec/rubocop/cop/highlands/simple_modifier_conditional_spec.rb +122 -0
  61. data/spec/rubocop/cop/highlands/simple_unless_spec.rb +36 -0
  62. data/spec/rubocop/cop/highlands/spec_constant_assignment_spec.rb +80 -0
  63. data/spec/rubocop/cop/highlands/unsafe_yaml_marshal_spec.rb +50 -0
  64. data/spec/spec_helper.rb +35 -0
  65. metadata +151 -0
@@ -0,0 +1,301 @@
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/rubocop-hq/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/rubocop-hq/ruby-style-guide#safe-assignment-in-condition
18
+ Enabled: true
19
+ AllowSafeAssignment: false
20
+
21
+ Lint/BigDecimalNew:
22
+ Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
23
+ Enabled: false
24
+
25
+ Lint/BooleanSymbol:
26
+ Enabled: false
27
+
28
+ Lint/CircularArgumentReference:
29
+ Description: Don't refer to the keyword argument in the default value.
30
+ Enabled: false
31
+
32
+ Lint/Debugger:
33
+ Description: Check for debugger calls.
34
+ Enabled: true
35
+
36
+ # Supports --auto-correct
37
+ Lint/DeprecatedClassMethods:
38
+ Description: Check for deprecated class method calls.
39
+ Enabled: false
40
+
41
+ Lint/DuplicateCaseCondition:
42
+ Enabled: false
43
+
44
+ Lint/DuplicateMethods:
45
+ Description: Check for duplicate methods calls.
46
+ Enabled: true
47
+
48
+ Lint/DuplicatedKey:
49
+ Description: Check for duplicate keys in hash literals.
50
+ Enabled: true
51
+
52
+ Lint/EachWithObjectArgument:
53
+ Description: Check for immutable argument given to each_with_object.
54
+ Enabled: false
55
+
56
+ Lint/ElseLayout:
57
+ Description: Check for odd code arrangement in an else block.
58
+ Enabled: true
59
+
60
+ Lint/EmptyEnsure:
61
+ Description: Checks for empty ensure block.
62
+ Enabled: false
63
+
64
+ Lint/EmptyInterpolation:
65
+ Description: Checks for empty string interpolation.
66
+ Enabled: true
67
+
68
+ Lint/EmptyWhen:
69
+ Enabled: false
70
+
71
+ Lint/EndInMethod:
72
+ Description: END blocks should not be placed inside method definitions.
73
+ Enabled: false
74
+
75
+ Lint/EnsureReturn:
76
+ Description: Do not use return in an ensure block.
77
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-return-ensure
78
+ Enabled: false
79
+
80
+ Lint/ErbNewArguments:
81
+ Enabled: false
82
+
83
+ Lint/FloatOutOfRange:
84
+ Description: Catches floating-point literals too large or small for Ruby to represent.
85
+ Enabled: false
86
+
87
+ Lint/FormatParameterMismatch:
88
+ Description: The number of parameters to format/sprint must match the fields.
89
+ Enabled: true
90
+
91
+ Lint/HandleExceptions:
92
+ Description: Don't suppress exception.
93
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#dont-hide-exceptions
94
+ Enabled: false
95
+
96
+ Lint/ImplicitStringConcatenation:
97
+ Description: Checks for adjacent string literals on the same line, which could better
98
+ be represented as a single string literal.
99
+ Enabled: true
100
+
101
+ Lint/IneffectiveAccessModifier:
102
+ Description: Checks for attempts to use `private` or `protected` to set the visibility
103
+ of a class method, which does not work.
104
+ Enabled: true
105
+
106
+ Lint/InheritException:
107
+ Enabled: true
108
+ # The default base class in favour of `Exception`.
109
+ EnforcedStyle: standard_error
110
+
111
+ Lint/InterpolationCheck:
112
+ Enabled: false
113
+
114
+ Lint/LiteralAsCondition:
115
+ Description: Checks of literals used in conditions.
116
+ Enabled: false
117
+
118
+ # Supports --auto-correct
119
+ Lint/LiteralInInterpolation:
120
+ Description: Avoid interpolating literals in strings
121
+ Enabled: false
122
+ AutoCorrect: false
123
+
124
+ Lint/Loop:
125
+ Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
126
+ for post-loop tests.
127
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#loop-with-break
128
+ Enabled: false
129
+
130
+ Lint/MissingCopEnableDirective:
131
+ # Maximum number of consecutive lines the cop can be disabled for.
132
+ # 0 allows only single-line disables
133
+ # 1 would mean the maximum allowed is the following:
134
+ # # rubocop:disable SomeCop
135
+ # a = 1
136
+ # # rubocop:enable SomeCop
137
+ # .inf for any size
138
+ MaximumRangeSize: .inf
139
+ Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`'
140
+ Enabled: true
141
+
142
+ Lint/MultipleCompare:
143
+ Enabled: false
144
+
145
+ Lint/NestedMethodDefinition:
146
+ Description: Do not use nested method definitions.
147
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-nested-methods
148
+ Enabled: false
149
+
150
+ Lint/NextWithoutAccumulator:
151
+ Enabled: false
152
+
153
+ Lint/NonLocalExitFromIterator:
154
+ Description: Do not use return in iterator to cause non-local exit.
155
+ Enabled: false
156
+
157
+ Lint/OrderedMagicComments:
158
+ Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
159
+ Enabled: true
160
+
161
+ Lint/ParenthesesAsGroupedExpression:
162
+ Description: Checks for method calls with a space before the opening parenthesis.
163
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#parens-no-spaces
164
+ Enabled: true
165
+
166
+ Lint/PercentStringArray:
167
+ Description: >-
168
+ Checks for unwanted commas and quotes in %w/%W literals.
169
+ Enabled: true
170
+
171
+ Lint/PercentSymbolArray:
172
+ Enabled: false
173
+
174
+ Lint/RandOne:
175
+ Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely
176
+ a mistake.
177
+ Enabled: true
178
+
179
+ Lint/RedundantWithIndex:
180
+ Enabled: false
181
+
182
+ Lint/RedundantWithObject:
183
+ Enabled: false
184
+
185
+ Lint/RegexpAsCondition:
186
+ Enabled: false
187
+
188
+ Lint/RequireParentheses:
189
+ Description: Use parentheses in the method call to avoid confusion about precedence.
190
+ Enabled: true
191
+
192
+ Lint/RescueException:
193
+ Description: Avoid rescuing the Exception class.
194
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-blind-rescues
195
+ Enabled: true
196
+
197
+ Lint/RescueType:
198
+ Enabled: false
199
+
200
+ Lint/ReturnInVoidContext:
201
+ Enabled: false
202
+
203
+ Lint/SafeNavigationChain:
204
+ Enabled: false
205
+
206
+ Lint/SafeNavigationConsistency:
207
+ Enabled: false
208
+
209
+ Lint/ScriptPermission:
210
+ Enabled: false
211
+
212
+ Lint/ShadowedArgument:
213
+ Description: 'Avoid reassigning arguments before they were used.'
214
+ Enabled: true
215
+
216
+ Lint/ShadowedException:
217
+ Description: >-
218
+ Avoid rescuing a higher level exception
219
+ before a lower level exception.
220
+ Enabled: false
221
+
222
+ Lint/ShadowingOuterLocalVariable:
223
+ Description: Do not use the same name as outer local variable for block arguments
224
+ or block local variables.
225
+ Enabled: true
226
+
227
+ # Supports --auto-correct
228
+ Lint/StringConversionInInterpolation:
229
+ Description: Checks for Object#to_s usage in string interpolation.
230
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-to-s
231
+ Enabled: true
232
+
233
+ Lint/UnderscorePrefixedVariableName:
234
+ Description: Do not use prefix `_` for a variable that is used.
235
+ Enabled: false
236
+
237
+ Lint/UnifiedInteger:
238
+ Enabled: false
239
+
240
+ Lint/UnneededCopDisableDirective:
241
+ Description: >-
242
+ Checks for rubocop:disable comments that can be removed.
243
+ Note: this cop is not disabled when disabling all cops. It must be explicitly disabled.
244
+ Enabled: true
245
+
246
+ Lint/UnneededCopEnableDirective:
247
+ Description: Checks for rubocop:enable comments that can be removed.
248
+ Enabled: true
249
+
250
+ Lint/UnneededRequireStatement:
251
+ Enabled: false
252
+
253
+ Lint/UnneededSplatExpansion:
254
+ Enabled: false
255
+
256
+ Lint/UnreachableCode:
257
+ Description: Unreachable code.
258
+ Enabled: false
259
+
260
+ # Supports --auto-correct
261
+ Lint/UnusedBlockArgument:
262
+ Description: Checks for unused block arguments.
263
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#underscore-unused-vars
264
+ Enabled: false
265
+
266
+ # Supports --auto-correct
267
+ Lint/UnusedMethodArgument:
268
+ Description: Checks for unused method arguments.
269
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#underscore-unused-vars
270
+ Enabled: false
271
+
272
+ Lint/UriEscapeUnescape:
273
+ Enabled: false
274
+
275
+ Lint/UriRegexp:
276
+ Enabled: false
277
+
278
+ Lint/UselessAccessModifier:
279
+ Description: Checks for useless access modifiers.
280
+ Enabled: true
281
+
282
+ Lint/UselessAssignment:
283
+ Description: Checks for useless assignment to a local variable.
284
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#underscore-unused-vars
285
+ Enabled: true
286
+
287
+ Lint/UselessComparison:
288
+ Description: Checks for comparison of something with itself.
289
+ Enabled: true
290
+
291
+ Lint/UselessElseWithoutRescue:
292
+ Description: Checks for useless `else` in `begin..end` without `rescue`.
293
+ Enabled: true
294
+
295
+ Lint/UselessSetterCall:
296
+ Description: Checks for useless setter call to a local variable.
297
+ Enabled: true
298
+
299
+ Lint/Void:
300
+ Description: Possible use of operator/literal/variable in void context.
301
+ Enabled: false
@@ -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/rubocop-hq/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/rubocop-hq/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,85 @@
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/rubocop-hq/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/rubocop-hq/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/rubocop-hq/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/rubocop-hq/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/rubocop-hq/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/MemoizedInstanceVariableName:
37
+ Description: >-
38
+ Memoized method name should match memo instance variable name.
39
+ Enabled: false
40
+
41
+ Naming/MethodName:
42
+ Description: Use the configured style when naming methods.
43
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#snake-case-symbols-methods-vars
44
+ Enabled: false
45
+ EnforcedStyle: snake_case
46
+ SupportedStyles:
47
+ - snake_case
48
+ - camelCase
49
+
50
+ Naming/PredicateName:
51
+ Description: Check the names of predicate methods.
52
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#bool-methods-qmark
53
+ Enabled: false
54
+ NamePrefix:
55
+ - is_
56
+ - has_
57
+ - have_
58
+ NamePrefixBlacklist:
59
+ - is_
60
+ - has_
61
+ - have_
62
+
63
+ Naming/UncommunicativeBlockParamName:
64
+ Description: >-
65
+ Checks for block parameter names that contain capital letters,
66
+ end in numbers, or do not meet a minimal length.
67
+ Enabled: false
68
+
69
+ Naming/UncommunicativeMethodParamName:
70
+ Description: >-
71
+ Checks for method parameter names that contain capital letters,
72
+ end in numbers, or do not meet a minimal length.
73
+ Enabled: false
74
+
75
+ Naming/VariableName:
76
+ Description: Use the configured style when naming variables.
77
+ StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#snake-case-symbols-methods-vars
78
+ Enabled: true
79
+ EnforcedStyle: snake_case
80
+ SupportedStyles:
81
+ - snake_case
82
+ - camelCase
83
+
84
+ Naming/VariableNumber:
85
+ Enabled: false
@@ -0,0 +1,141 @@
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
+ Performance/InefficientHashSearch:
57
+ Enabled: false
58
+
59
+ # Supports --auto-correct
60
+ Performance/LstripRstrip:
61
+ Description: Use `strip` instead of `lstrip.rstrip`.
62
+ Enabled: false
63
+
64
+ # Supports --auto-correct
65
+ Performance/RangeInclude:
66
+ Description: Use `Range#cover?` instead of `Range#include?`.
67
+ Reference: https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code
68
+ Enabled: false
69
+
70
+ # Supports --auto-correct
71
+ Performance/RedundantBlockCall:
72
+ Description: Use `yield` instead of `block.call`.
73
+ Reference: https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code
74
+ Enabled: false
75
+
76
+ # Supports --auto-correct
77
+ Performance/RedundantMatch:
78
+ Description: Use `=~` instead of `String#match` or `Regexp#match` in a context where
79
+ the returned `MatchData` is not needed.
80
+ Enabled: false
81
+
82
+ # Supports --auto-correct
83
+ Performance/RedundantMerge:
84
+ Description: Use Hash#[]=, rather than Hash#merge! with a single key-value pair.
85
+ Reference: https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code
86
+ Enabled: false
87
+
88
+ # Supports --auto-correct
89
+ Performance/RedundantSortBy:
90
+ Description: Use `sort` instead of `sort_by { |x| x }`.
91
+ Enabled: false
92
+
93
+ Performance/RegexpMatch:
94
+ Enabled: false
95
+
96
+ # Supports --auto-correct
97
+ Performance/ReverseEach:
98
+ Description: Use `reverse_each` instead of `reverse.each`.
99
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
100
+ Enabled: false
101
+
102
+ # Supports --auto-correct
103
+ Performance/Sample:
104
+ Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`.
105
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code
106
+ Enabled: false
107
+
108
+ # Supports --auto-correct
109
+ Performance/Size:
110
+ Description: Use `size` instead of `count` for counting the number of elements in
111
+ `Array` and `Hash`.
112
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
113
+ Enabled: false
114
+
115
+ # Supports --auto-correct
116
+ Performance/StartWith:
117
+ Description: Use `start_with?` instead of a regex match anchored to the beginning
118
+ of a string.
119
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end
120
+ Enabled: false
121
+
122
+ # Supports --auto-correct
123
+ Performance/StringReplacement:
124
+ Description: Use `tr` instead of `gsub` when you are replacing the same number of
125
+ characters. Use `delete` instead of `gsub` when you are deleting characters.
126
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
127
+ Enabled: false
128
+
129
+ Performance/TimesMap:
130
+ Description: Checks for .times.map calls.
131
+ Enabled: false
132
+
133
+ Performance/UnfreezeString:
134
+ Enabled: false
135
+
136
+ Performance/UnneededSort:
137
+ Enabled: false
138
+
139
+ Performance/UriDefaultParser:
140
+ Enabled: false
141
+