forked from rubocop/rubocop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.rubocop.yml
371 lines (328 loc) · 12.5 KB
/
.rubocop.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# This is the configuration used to check the rubocop source code.
inherit_from: .rubocop_todo.yml
plugins:
- rubocop-internal_affairs
- rubocop-performance
- rubocop-rake
- rubocop-rspec
AllCops:
NewCops: enable
Exclude:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
- 'tmp/**/*'
- '.git/**/*'
- 'bin/*'
TargetRubyVersion: 2.7
SuggestExtensions: false
Naming/PredicateName:
# Method define macros for dynamically generated method.
MethodDefinitionMacros:
- define_method
- define_singleton_method
- def_node_matcher
- def_node_search
Style/AccessorGrouping:
Exclude:
- lib/rubocop/formatter/base_formatter.rb
- lib/rubocop/cop/offense.rb
Style/FormatStringToken:
# Because we parse a lot of source codes from strings. Percent arrays
# look like unannotated format string tokens to this cop.
Exclude:
- spec/**/*
Style/IpAddresses:
# The test for this cop includes strings that would cause offenses
Exclude:
- spec/rubocop/cop/style/ip_addresses_spec.rb
Style/ReturnNilInPredicateMethodDefinition:
AllowedMethods:
- on_defined? # rubocop-ast node handler
Layout/EndOfLine:
EnforcedStyle: lf
Layout/ClassStructure:
Enabled: true
Layout/RedundantLineBreak:
Enabled: true
Layout/TrailingWhitespace:
AllowInHeredoc: false
Lint/AmbiguousBlockAssociation:
Exclude:
- 'spec/**/*.rb'
Layout/HashAlignment:
EnforcedHashRocketStyle:
- key
- table
EnforcedColonStyle:
- key
- table
Layout/LineLength:
Max: 100
AllowedPatterns:
- !ruby/regexp /\A +(it|describe|context|shared_examples|include_examples|it_behaves_like) ["']/
Lint/InterpolationCheck:
Exclude:
- 'spec/**/*.rb'
Lint/UselessAccessModifier:
MethodCreatingMethods:
- 'def_matcher'
- 'def_node_matcher'
Lint/EmptyFile:
Exclude:
# This file is intentionally empty to catch rubocop cops failing on empty files.
- spec/rubocop/intentionally_empty_file.rb
Metrics/BlockLength:
Exclude:
- 'Rakefile'
- '**/*.rake'
- 'spec/**/*.rb'
Metrics/ClassLength:
Exclude:
- lib/rubocop/config_obsoletion.rb
- lib/rubocop/options.rb
Metrics/ModuleLength:
Exclude:
- 'spec/**/*.rb'
Naming/InclusiveLanguage:
Enabled: true
CheckStrings: true
FlaggedTerms:
' a offense':
Suggestions:
- an offense
' and offense':
Suggestions:
- ' an offense'
auto-correct:
Suggestions:
- autocorrect
auto_correct:
Suggestions:
- autocorrect
behaviour:
Suggestions:
- behavior
offence:
Suggestions:
- offense
'does not registers':
Suggestions:
- does not register
'register no offense':
Suggestions:
- registers no offense
'register an error':
Suggestions:
- register an offense
'registers an error':
Suggestions:
- registers an offense
'does not register and corrects':
Suggestions:
does not register
'does not register an offense and corrects':
Suggestions:
does not register an offense
Exclude:
- lib/rubocop/cop/naming/inclusive_language.rb
- lib/rubocop/cop/mixin/auto_corrector.rb
- spec/rubocop/cop/naming/inclusive_language_spec.rb
RSpec:
Language:
Expectations:
- expect_autocorrect_options_for_autocorrect
- expect_autocorrect_options_for_autocorrect_all
- expect_autocorrect_options_for_fix_layout
- expect_correction
- expect_feature_loader
- expect_no_offenses
- expect_offense
RSpec/ExampleWithoutDescription:
EnforcedStyle: single_line_only
RSpec/PredicateMatcher:
# Also consider `be(true)` and `be(false)` as offenses, instead of only `be_truthy` and `be_falsy`
Strict: false
RSpec/SpecFilePathFormat:
CustomTransform:
GitHubActionsFormatter: github_actions_formatter
JUnitFormatter: junit_formatter
OnSendWithoutOnCSend: on_send_without_on_csend
RedundantLetRuboCopConfigNew: redundant_let_rubocop_config_new
Exclude:
- spec/rubocop/cop/mixin/enforce_superclass_spec.rb
RSpec/MessageSpies:
EnforcedStyle: receive
RSpec/NestedGroups:
Max: 7
RSpec/MultipleMemoizedHelpers:
Enabled: false
Performance/CollectionLiteralInLoop:
Exclude:
- 'Rakefile'
- 'spec/**/*.rb'
Performance/EndWith:
SafeMultiline: false
Performance/StartWith:
SafeMultiline: false
RSpec/StubbedMock:
Enabled: false
InternalAffairs/UndefinedConfig:
Exclude:
- 'lib/rubocop/cop/correctors/**/*.rb'
- 'lib/rubocop/cop/mixin/**/*.rb'
InternalAffairs/StyleDetectedApiUse:
Exclude:
- 'lib/rubocop/cop/mixin/percent_array.rb'
InternalAffairs/NumblockHandler:
Exclude:
- 'lib/rubocop/cop/internal_affairs/*.rb'
InternalAffairs/OnSendWithoutOnCSend:
Exclude:
- 'lib/rubocop/cop/bundler/**/*.rb'
- 'lib/rubocop/cop/gemspec/**/*.rb'
- 'lib/rubocop/cop/mixin/**/*.rb'
# `send` method is an operator call
- 'lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb'
- 'lib/rubocop/cop/internal_affairs/method_name_equal.rb'
- 'lib/rubocop/cop/internal_affairs/node_type_predicate.rb'
- 'lib/rubocop/cop/internal_affairs/single_line_comparison.rb'
- 'lib/rubocop/cop/layout/space_after_not.rb'
- 'lib/rubocop/cop/layout/space_around_operators.rb'
- 'lib/rubocop/cop/layout/space_before_brackets.rb'
- 'lib/rubocop/cop/layout/space_in_lambda_literal.rb'
- 'lib/rubocop/cop/layout/space_inside_reference_brackets.rb'
- 'lib/rubocop/cop/lint/ambiguous_operator_precedence.rb'
- 'lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb'
- 'lib/rubocop/cop/lint/identity_comparison.rb'
- 'lib/rubocop/cop/lint/literal_as_condition.rb'
- 'lib/rubocop/cop/lint/multiple_comparison.rb'
- 'lib/rubocop/cop/style/array_join.rb'
- 'lib/rubocop/cop/style/bitwise_predicate.rb'
- 'lib/rubocop/cop/style/case_equality.rb'
- 'lib/rubocop/cop/style/conditional_assignment.rb'
- 'lib/rubocop/cop/style/double_negation.rb'
- 'lib/rubocop/cop/style/even_odd.rb'
- 'lib/rubocop/cop/style/float_division.rb'
- 'lib/rubocop/cop/style/nil_comparison.rb'
- 'lib/rubocop/cop/style/non_nil_check.rb'
- 'lib/rubocop/cop/style/not.rb'
- 'lib/rubocop/cop/style/operator_method_call.rb'
- 'lib/rubocop/cop/style/stabby_lambda_parentheses.rb'
- 'lib/rubocop/cop/style/string_concatenation.rb'
- 'lib/rubocop/cop/style/yoda_condition.rb'
- 'lib/rubocop/cop/style/yoda_expression.rb'
# `send` receiver is constant / self / literal
- 'lib/rubocop/cop/lint/big_decimal_new.rb'
- 'lib/rubocop/cop/lint/debugger.rb'
- 'lib/rubocop/cop/lint/deprecated_class_methods.rb'
- 'lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb'
- 'lib/rubocop/cop/lint/erb_new_arguments.rb'
- 'lib/rubocop/cop/lint/format_parameter_mismatch.rb'
- 'lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb'
- 'lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb'
- 'lib/rubocop/cop/lint/inherit_exception.rb'
- 'lib/rubocop/cop/lint/non_atomic_file_operation.rb'
- 'lib/rubocop/cop/lint/redundant_dir_glob_sort.rb'
- 'lib/rubocop/cop/lint/send_with_mixin_argument.rb'
- 'lib/rubocop/cop/lint/shared_mutable_default.rb'
- 'lib/rubocop/cop/lint/struct_new_override.rb'
- 'lib/rubocop/cop/lint/symbol_conversion.rb'
- 'lib/rubocop/cop/lint/to_enum_arguments.rb'
- 'lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb'
- 'lib/rubocop/cop/lint/uri_escape_unescape.rb'
- 'lib/rubocop/cop/lint/uri_regexp.rb'
- 'lib/rubocop/cop/metrics/collection_literal_length.rb'
- 'lib/rubocop/cop/security/io_methods.rb'
- 'lib/rubocop/cop/security/json_load.rb'
- 'lib/rubocop/cop/security/marshal_load.rb'
- 'lib/rubocop/cop/security/open.rb'
- 'lib/rubocop/cop/security/yaml_load.rb'
- 'lib/rubocop/cop/style/auto_resource_cleanup.rb'
- 'lib/rubocop/cop/style/class_equality_comparison.rb'
- 'lib/rubocop/cop/style/comparable_clamp.rb'
- 'lib/rubocop/cop/style/dir.rb'
- 'lib/rubocop/cop/style/dir_empty.rb'
- 'lib/rubocop/cop/style/empty_literal.rb'
- 'lib/rubocop/cop/style/env_home.rb'
- 'lib/rubocop/cop/style/expand_path_arguments.rb'
- 'lib/rubocop/cop/style/fetch_env_var.rb'
- 'lib/rubocop/cop/style/file_empty.rb'
- 'lib/rubocop/cop/style/file_read.rb'
- 'lib/rubocop/cop/style/file_touch.rb'
- 'lib/rubocop/cop/style/file_write.rb'
- 'lib/rubocop/cop/style/format_string.rb'
- 'lib/rubocop/cop/style/hash_conversion.rb'
- 'lib/rubocop/cop/style/nested_file_dirname.rb'
- 'lib/rubocop/cop/style/random_with_offset.rb'
- 'lib/rubocop/cop/style/redundant_array_constructor.rb'
- 'lib/rubocop/cop/style/redundant_format.rb'
- 'lib/rubocop/cop/style/redundant_freeze.rb'
- 'lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb'
- 'lib/rubocop/cop/style/redundant_regexp_constructor.rb'
- 'lib/rubocop/cop/style/redundant_self.rb'
- 'lib/rubocop/cop/style/stderr_puts.rb'
- 'lib/rubocop/cop/style/yaml_file_read.rb'
# `send` is a keyword / macro / has no receiver
- 'lib/rubocop/cop/internal_affairs/create_empty_file.rb'
- 'lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb'
- 'lib/rubocop/cop/internal_affairs/example_description.rb'
- 'lib/rubocop/cop/internal_affairs/example_heredoc_delimiter.rb'
- 'lib/rubocop/cop/internal_affairs/node_matcher_directive.rb'
- 'lib/rubocop/cop/internal_affairs/node_pattern_groups.rb'
- 'lib/rubocop/cop/internal_affairs/offense_location_keyword.rb'
- 'lib/rubocop/cop/internal_affairs/redundant_context_config_parameter.rb'
- 'lib/rubocop/cop/internal_affairs/redundant_expect_offense_arguments.rb'
- 'lib/rubocop/cop/internal_affairs/redundant_location_argument.rb'
- 'lib/rubocop/cop/internal_affairs/redundant_message_argument.rb'
- 'lib/rubocop/cop/internal_affairs/style_detected_api_use.rb'
- 'lib/rubocop/cop/internal_affairs/undefined_config.rb'
- 'lib/rubocop/cop/layout/def_end_alignment.rb'
- 'lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb'
- 'lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb'
- 'lib/rubocop/cop/layout/space_around_keyword.rb'
- 'lib/rubocop/cop/lint/constant_reassignment.rb'
- 'lib/rubocop/cop/lint/duplicate_methods.rb'
- 'lib/rubocop/cop/lint/duplicate_require.rb'
- 'lib/rubocop/cop/lint/lambda_without_literal_block.rb'
- 'lib/rubocop/cop/lint/raise_exception.rb'
- 'lib/rubocop/cop/lint/rand_one.rb'
- 'lib/rubocop/cop/lint/redundant_require_statement.rb'
- 'lib/rubocop/cop/lint/redundant_string_coercion.rb'
- 'lib/rubocop/cop/lint/refinement_import_methods.rb'
- 'lib/rubocop/cop/lint/require_relative_self_path.rb'
- 'lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb'
- 'lib/rubocop/cop/lint/useless_ruby2_keywords.rb'
- 'lib/rubocop/cop/naming/method_name.rb'
- 'lib/rubocop/cop/naming/predicate_name.rb'
- 'lib/rubocop/cop/security/eval.rb'
- 'lib/rubocop/cop/style/access_modifier_declarations.rb'
- 'lib/rubocop/cop/style/alias.rb'
- 'lib/rubocop/cop/style/attr.rb'
- 'lib/rubocop/cop/style/class_vars.rb'
- 'lib/rubocop/cop/style/document_dynamic_eval_definition.rb'
- 'lib/rubocop/cop/style/eval_with_location.rb'
- 'lib/rubocop/cop/style/implicit_runtime_error.rb'
- 'lib/rubocop/cop/style/mixin_usage.rb'
- 'lib/rubocop/cop/style/raise_args.rb'
- 'lib/rubocop/cop/style/redundant_current_directory_in_path.rb'
- 'lib/rubocop/cop/style/redundant_exception.rb'
- 'lib/rubocop/cop/style/redundant_file_extension_in_require.rb'
- 'lib/rubocop/cop/style/redundant_return.rb'
- 'lib/rubocop/cop/style/require_order.rb'
- 'lib/rubocop/cop/style/signal_exception.rb'
- 'lib/rubocop/cop/style/top_level_method_definition.rb'
# not valid or plausible for safe navigation
- 'lib/rubocop/cop/internal_affairs/cop_enabled.rb'
- 'lib/rubocop/cop/internal_affairs/processed_source_buffer_name.rb'
- 'lib/rubocop/cop/internal_affairs/redundant_method_dispatch_node.rb'
- 'lib/rubocop/cop/lint/it_without_arguments_in_block.rb'
- 'lib/rubocop/cop/lint/safe_navigation_chain.rb'
- 'lib/rubocop/cop/lint/useless_times.rb'
- 'lib/rubocop/cop/style/array_intersect.rb'
- 'lib/rubocop/cop/style/colon_method_call.rb'
- 'lib/rubocop/cop/style/numeric_predicate.rb'
- 'lib/rubocop/cop/style/single_argument_dig.rb'
Gemspec/DependencyVersion:
Enabled: true
Style/RequireOrder:
Enabled: true