parallel_tests-fine_grain_test 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.hound.yml +8 -0
  4. data/.rubocop.default.yml +1114 -0
  5. data/.rubocop.disabled.yml +125 -0
  6. data/.rubocop.enabled.yml +1352 -0
  7. data/.rubocop.yml +66 -0
  8. data/.ruby-version +1 -0
  9. data/.travis.yml +5 -0
  10. data/Appraisals +14 -0
  11. data/Gemfile +8 -0
  12. data/README.md +51 -0
  13. data/Rakefile +10 -0
  14. data/bin/parallel_fine_grain_test +9 -0
  15. data/exe/parallel_tests-fine_grain_test +3 -0
  16. data/gemfiles/activesupport_3.gemfile +11 -0
  17. data/gemfiles/activesupport_3.gemfile.lock +44 -0
  18. data/gemfiles/activesupport_4.gemfile +10 -0
  19. data/gemfiles/activesupport_4.gemfile.lock +48 -0
  20. data/gemfiles/activesupport_5.gemfile +10 -0
  21. data/gemfiles/activesupport_5.gemfile.lock +47 -0
  22. data/lib/parallel_tests/fine_grain_test.rb +8 -0
  23. data/lib/parallel_tests/fine_grain_test/file_queue.rb +80 -0
  24. data/lib/parallel_tests/fine_grain_test/minitest.rb +4 -0
  25. data/lib/parallel_tests/fine_grain_test/minitest/extension.rb +27 -0
  26. data/lib/parallel_tests/fine_grain_test/minitest/suite.rb +35 -0
  27. data/lib/parallel_tests/fine_grain_test/railtie.rb +8 -0
  28. data/lib/parallel_tests/fine_grain_test/runner.rb +27 -0
  29. data/lib/parallel_tests/fine_grain_test/runtime_logger.rb +81 -0
  30. data/lib/parallel_tests/fine_grain_test/tasks.rb +21 -0
  31. data/lib/parallel_tests/fine_grain_test/test_case.rb +20 -0
  32. data/lib/parallel_tests/fine_grain_test/test_helper.rb +16 -0
  33. data/lib/parallel_tests/fine_grain_test/test_unit.rb +11 -0
  34. data/lib/parallel_tests/fine_grain_test/test_unit/collector.rb +54 -0
  35. data/lib/parallel_tests/fine_grain_test/test_unit/test_suite.rb +59 -0
  36. data/lib/parallel_tests/fine_grain_test/version.rb +5 -0
  37. data/parallel_tests-fine_grain_test.gemspec +23 -0
  38. metadata +122 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5c86479f7bff02e16622d3feaccbd3a94626b544
4
+ data.tar.gz: 763f23fe2a662e493b33edef5acd38be949c5633
5
+ SHA512:
6
+ metadata.gz: d36d48b76f878c48a029fddac95d8cf02921a1392292e28d2c2853bf988f2f79f9883a2ea1d0c40b59449debf4ef82452f741c2ee97aae8f5b11364447e25838
7
+ data.tar.gz: 279b0d79477eae91f3d5462bfd5444252fbae2d1379bb1af24bbea615a5253ead11a047b87615f38f68739cd10fce0f75df94bd40ac42b5f26c35a4aa44bbe3c
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.test.queue
data/.hound.yml ADDED
@@ -0,0 +1,8 @@
1
+ ruby:
2
+ config_file: .rubocop.yml
3
+ javascript:
4
+ enabled: false
5
+ eslint:
6
+ enabled: true
7
+ fail_on_violations: true
8
+
@@ -0,0 +1,1114 @@
1
+ # This is the default configuration file. Enabling and disabling is configured
2
+ # in separate files. This file adds all other parameters apart from Enabled.
3
+
4
+ # Common configuration.
5
+ AllCops:
6
+ # Include common Ruby source files.
7
+ Include:
8
+ - '**/*.gemspec'
9
+ - '**/*.podspec'
10
+ - '**/*.jbuilder'
11
+ - '**/*.rake'
12
+ - '**/*.opal'
13
+ - '**/config.ru'
14
+ - '**/Gemfile'
15
+ - '**/Rakefile'
16
+ - '**/Capfile'
17
+ - '**/Guardfile'
18
+ - '**/Podfile'
19
+ - '**/Thorfile'
20
+ - '**/Vagrantfile'
21
+ - '**/Berksfile'
22
+ - '**/Cheffile'
23
+ - '**/Vagabondfile'
24
+ Exclude:
25
+ - 'vendor/**/*'
26
+ # Default formatter will be used if no -f/--format option is given.
27
+ DefaultFormatter: progress
28
+ # Cop names are not displayed in offense messages by default. Change behavior
29
+ # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
30
+ # option.
31
+ DisplayCopNames: false
32
+ # Style guide URLs are not displayed in offense messages by default. Change
33
+ # behavior by overriding DisplayStyleGuide, or by giving the
34
+ # -S/--display-style-guide option.
35
+ DisplayStyleGuide: false
36
+ # Extra details are not displayed in offense messages by default. Change
37
+ # behavior by overriding ExtraDetails, or by giving the
38
+ # -E/--extra-details option.
39
+ ExtraDetails: false
40
+ # Additional cops that do not reference a style guide rule may be enabled by
41
+ # default. Change behavior by overriding StyleGuideCopsOnly, or by giving
42
+ # the --only-guide-cops option.
43
+ StyleGuideCopsOnly: false
44
+ # All cops except the ones in disabled.yml are enabled by default. Change
45
+ # this behavior by overriding DisabledByDefault. When DisabledByDefault is
46
+ # true, all cops in the default configuration are disabled, and and only cops
47
+ # in user configuration are enabled. This makes cops opt-in instead of
48
+ # opt-out. Note that when DisabledByDefault is true, cops in user
49
+ # configuration will be enabled even if they don't set the Enabled parameter.
50
+ DisabledByDefault: false
51
+ # Enables the result cache if true. Can be overridden by the --cache command
52
+ # line option.
53
+ UseCache: true
54
+ # Threshold for how many files can be stored in the result cache before some
55
+ # of the files are automatically removed.
56
+ MaxFilesInCache: 20000
57
+ # The cache will be stored in "rubocop_cache" under this directory. The name
58
+ # "/tmp" is special and will be converted to the system temporary directory,
59
+ # which is "/tmp" on Unix-like systems, but could be something else on other
60
+ # systems.
61
+ CacheRootDirectory: /tmp
62
+ # What version of the Ruby interpreter is the inspected code intended to
63
+ # run on? (If there is more than one, set this to the lowest version.)
64
+ TargetRubyVersion: 2.0
65
+
66
+ # Indent private/protected/public as deep as method definitions
67
+ Style/AccessModifierIndentation:
68
+ EnforcedStyle: indent
69
+ SupportedStyles:
70
+ - outdent
71
+ - indent
72
+ # By default, the indentation width from Style/IndentationWidth is used
73
+ # But it can be overridden by setting this parameter
74
+ IndentationWidth: ~
75
+
76
+ Style/Alias:
77
+ EnforcedStyle: prefer_alias
78
+ SupportedStyles:
79
+ - prefer_alias
80
+ - prefer_alias_method
81
+
82
+ # Align the elements of a hash literal if they span more than one line.
83
+ Style/AlignHash:
84
+ # Alignment of entries using hash rocket as separator. Valid values are:
85
+ #
86
+ # key - left alignment of keys
87
+ # 'a' => 2
88
+ # 'bb' => 3
89
+ # separator - alignment of hash rockets, keys are right aligned
90
+ # 'a' => 2
91
+ # 'bb' => 3
92
+ # table - left alignment of keys, hash rockets, and values
93
+ # 'a' => 2
94
+ # 'bb' => 3
95
+ EnforcedHashRocketStyle: key
96
+ # Alignment of entries using colon as separator. Valid values are:
97
+ #
98
+ # key - left alignment of keys
99
+ # a: 0
100
+ # bb: 1
101
+ # separator - alignment of colons, keys are right aligned
102
+ # a: 0
103
+ # bb: 1
104
+ # table - left alignment of keys and values
105
+ # a: 0
106
+ # bb: 1
107
+ EnforcedColonStyle: key
108
+ # Select whether hashes that are the last argument in a method call should be
109
+ # inspected? Valid values are:
110
+ #
111
+ # always_inspect - Inspect both implicit and explicit hashes.
112
+ # Registers an offense for:
113
+ # function(a: 1,
114
+ # b: 2)
115
+ # Registers an offense for:
116
+ # function({a: 1,
117
+ # b: 2})
118
+ # always_ignore - Ignore both implicit and explicit hashes.
119
+ # Accepts:
120
+ # function(a: 1,
121
+ # b: 2)
122
+ # Accepts:
123
+ # function({a: 1,
124
+ # b: 2})
125
+ # ignore_implicit - Ignore only implicit hashes.
126
+ # Accepts:
127
+ # function(a: 1,
128
+ # b: 2)
129
+ # Registers an offense for:
130
+ # function({a: 1,
131
+ # b: 2})
132
+ # ignore_explicit - Ignore only explicit hashes.
133
+ # Accepts:
134
+ # function({a: 1,
135
+ # b: 2})
136
+ # Registers an offense for:
137
+ # function(a: 1,
138
+ # b: 2)
139
+ EnforcedLastArgumentHashStyle: always_inspect
140
+ SupportedLastArgumentHashStyles:
141
+ - always_inspect
142
+ - always_ignore
143
+ - ignore_implicit
144
+ - ignore_explicit
145
+
146
+ Style/AlignParameters:
147
+ # Alignment of parameters in multi-line method calls.
148
+ #
149
+ # The `with_first_parameter` style aligns the following lines along the same
150
+ # column as the first parameter.
151
+ #
152
+ # method_call(a,
153
+ # b)
154
+ #
155
+ # The `with_fixed_indentation` style aligns the following lines with one
156
+ # level of indentation relative to the start of the line with the method call.
157
+ #
158
+ # method_call(a,
159
+ # b)
160
+ EnforcedStyle: with_first_parameter
161
+ SupportedStyles:
162
+ - with_first_parameter
163
+ - with_fixed_indentation
164
+
165
+ Style/AndOr:
166
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
167
+ # or completely (always).
168
+ EnforcedStyle: always
169
+ SupportedStyles:
170
+ - always
171
+ - conditionals
172
+
173
+
174
+ # Checks if usage of %() or %Q() matches configuration.
175
+ Style/BarePercentLiterals:
176
+ EnforcedStyle: bare_percent
177
+ SupportedStyles:
178
+ - percent_q
179
+ - bare_percent
180
+
181
+ Style/BlockDelimiters:
182
+ EnforcedStyle: line_count_based
183
+ SupportedStyles:
184
+ # The `line_count_based` style enforces braces around single line blocks and
185
+ # do..end around multi-line blocks.
186
+ - line_count_based
187
+ # The `semantic` style enforces braces around functional blocks, where the
188
+ # primary purpose of the block is to return a value and do..end for
189
+ # procedural blocks, where the primary purpose of the block is its
190
+ # side-effects.
191
+ #
192
+ # This looks at the usage of a block's method to determine its type (e.g. is
193
+ # the result of a `map` assigned to a variable or passed to another
194
+ # method) but exceptions are permitted in the `ProceduralMethods`,
195
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
196
+ - semantic
197
+ # The `braces_for_chaining` style enforces braces around single line blocks
198
+ # and do..end around multi-line blocks, except for multi-line blocks whose
199
+ # return value is being chained with another method (in which case braces
200
+ # are enforced).
201
+ - braces_for_chaining
202
+ ProceduralMethods:
203
+ # Methods that are known to be procedural in nature but look functional from
204
+ # their usage, e.g.
205
+ #
206
+ # time = Benchmark.realtime do
207
+ # foo.bar
208
+ # end
209
+ #
210
+ # Here, the return value of the block is discarded but the return value of
211
+ # `Benchmark.realtime` is used.
212
+ - benchmark
213
+ - bm
214
+ - bmbm
215
+ - create
216
+ - each_with_object
217
+ - measure
218
+ - new
219
+ - realtime
220
+ - tap
221
+ - with_object
222
+ FunctionalMethods:
223
+ # Methods that are known to be functional in nature but look procedural from
224
+ # their usage, e.g.
225
+ #
226
+ # let(:foo) { Foo.new }
227
+ #
228
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
229
+ # doesn't appear to be used from the return value of `let`.
230
+ - let
231
+ - let!
232
+ - subject
233
+ - watch
234
+ IgnoredMethods:
235
+ # Methods that can be either procedural or functional and cannot be
236
+ # categorised from their usage alone, e.g.
237
+ #
238
+ # foo = lambda do |x|
239
+ # puts "Hello, #{x}"
240
+ # end
241
+ #
242
+ # foo = lambda do |x|
243
+ # x * 100
244
+ # end
245
+ #
246
+ # Here, it is impossible to tell from the return value of `lambda` whether
247
+ # the inner block's return value is significant.
248
+ - lambda
249
+ - proc
250
+ - it
251
+
252
+ Style/BracesAroundHashParameters:
253
+ EnforcedStyle: no_braces
254
+ SupportedStyles:
255
+ # The `braces` style enforces braces around all method parameters that are
256
+ # hashes.
257
+ - braces
258
+ # The `no_braces` style checks that the last parameter doesn't have braces
259
+ # around it.
260
+ - no_braces
261
+ # The `context_dependent` style checks that the last parameter doesn't have
262
+ # braces around it, but requires braces if the second to last parameter is
263
+ # also a hash literal.
264
+ - context_dependent
265
+
266
+ # Indentation of `when`.
267
+ Style/CaseIndentation:
268
+ IndentWhenRelativeTo: case
269
+ SupportedStyles:
270
+ - case
271
+ - end
272
+ IndentOneStep: false
273
+ # By default, the indentation width from Style/IndentationWidth is used
274
+ # But it can be overridden by setting this parameter
275
+ # This only matters if IndentOneStep is true
276
+ IndentationWidth: ~
277
+
278
+ Style/ClassAndModuleChildren:
279
+ # Checks the style of children definitions at classes and modules.
280
+ #
281
+ # Basically there are two different styles:
282
+ #
283
+ # `nested` - have each child on a separate line
284
+ # class Foo
285
+ # class Bar
286
+ # end
287
+ # end
288
+ #
289
+ # `compact` - combine definitions as much as possible
290
+ # class Foo::Bar
291
+ # end
292
+ #
293
+ # The compact style is only forced, for classes / modules with one child.
294
+ EnforcedStyle: nested
295
+ SupportedStyles:
296
+ - nested
297
+ - compact
298
+
299
+ Style/ClassCheck:
300
+ EnforcedStyle: is_a?
301
+ SupportedStyles:
302
+ - is_a?
303
+ - kind_of?
304
+
305
+ # Align with the style guide.
306
+ Style/CollectionMethods:
307
+ # Mapping from undesired method to desired_method
308
+ # e.g. to use `detect` over `find`:
309
+ #
310
+ # CollectionMethods:
311
+ # PreferredMethods:
312
+ # find: detect
313
+ PreferredMethods:
314
+ collect: 'map'
315
+ collect!: 'map!'
316
+ inject: 'reduce'
317
+ detect: 'find'
318
+ find_all: 'select'
319
+
320
+ # Use ` or %x around command literals.
321
+ Style/CommandLiteral:
322
+ EnforcedStyle: backticks
323
+ # backticks: Always use backticks.
324
+ # percent_x: Always use %x.
325
+ # mixed: Use backticks on single-line commands, and %x on multi-line commands.
326
+ SupportedStyles:
327
+ - backticks
328
+ - percent_x
329
+ - mixed
330
+ # If false, the cop will always recommend using %x if one or more backticks
331
+ # are found in the command string.
332
+ AllowInnerBackticks: false
333
+
334
+ # Checks formatting of special comments
335
+ Style/CommentAnnotation:
336
+ Keywords:
337
+ - TODO
338
+ - FIXME
339
+ - OPTIMIZE
340
+ - HACK
341
+ - REVIEW
342
+
343
+ Style/ConditionalAssignment:
344
+ EnforcedStyle: assign_to_condition
345
+ SupportedStyles:
346
+ - assign_to_condition
347
+ - assign_inside_condition
348
+ # When configured to `assign_to_condition`, `SingleLineConditionsOnly`
349
+ # will only register an offense when all branches of a condition are
350
+ # a single line.
351
+ # When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
352
+ # will only register an offense for assignment to a condition that has
353
+ # at least one multiline branch.
354
+ SingleLineConditionsOnly: true
355
+
356
+ # Checks that you have put a copyright in a comment before any code.
357
+ #
358
+ # You can override the default Notice in your .rubocop.yml file.
359
+ #
360
+ # In order to use autocorrect, you must supply a value for the
361
+ # AutocorrectNotice key that matches the regexp Notice. A blank
362
+ # AutocorrectNotice will cause an error during autocorrect.
363
+ #
364
+ # Autocorrect will add a copyright notice in a comment at the top
365
+ # of the file immediately after any shebang or encoding comments.
366
+ #
367
+ # Example rubocop.yml:
368
+ #
369
+ # Style/Copyright:
370
+ # Enabled: true
371
+ # Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
372
+ # AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
373
+ #
374
+ Style/Copyright:
375
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
376
+ AutocorrectNotice: ''
377
+
378
+ # Multi-line method chaining should be done with leading dots.
379
+ Style/DotPosition:
380
+ EnforcedStyle: leading
381
+ SupportedStyles:
382
+ - leading
383
+ - trailing
384
+
385
+ # Warn on empty else statements
386
+ # empty - warn only on empty else
387
+ # nil - warn on else with nil in it
388
+ # both - warn on empty else and else with nil in it
389
+ Style/EmptyElse:
390
+ EnforcedStyle: both
391
+ SupportedStyles:
392
+ - empty
393
+ - nil
394
+ - both
395
+
396
+ # Use empty lines between defs.
397
+ Style/EmptyLineBetweenDefs:
398
+ # If true, this parameter means that single line method definitions don't
399
+ # need an empty line between them.
400
+ AllowAdjacentOneLineDefs: false
401
+
402
+ Style/EmptyLinesAroundBlockBody:
403
+ EnforcedStyle: no_empty_lines
404
+ SupportedStyles:
405
+ - empty_lines
406
+ - no_empty_lines
407
+
408
+ Style/EmptyLinesAroundClassBody:
409
+ EnforcedStyle: no_empty_lines
410
+ SupportedStyles:
411
+ - empty_lines
412
+ - no_empty_lines
413
+
414
+ Style/EmptyLinesAroundModuleBody:
415
+ EnforcedStyle: no_empty_lines
416
+ SupportedStyles:
417
+ - empty_lines
418
+ - no_empty_lines
419
+
420
+ # Checks whether the source file has a utf-8 encoding comment or not
421
+ # AutoCorrectEncodingComment must match the regex
422
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
423
+ Style/Encoding:
424
+ EnforcedStyle: always
425
+ SupportedStyles:
426
+ - when_needed
427
+ - always
428
+ AutoCorrectEncodingComment: '# encoding: utf-8'
429
+
430
+ Style/ExtraSpacing:
431
+ # When true, allows most uses of extra spacing if the intent is to align
432
+ # things with the previous or next line, not counting empty lines or comment
433
+ # lines.
434
+ AllowForAlignment: true
435
+ # When true, forces the alignment of = in assignments on consecutive lines.
436
+ ForceEqualSignAlignment: false
437
+
438
+ Style/FileName:
439
+ # File names listed in AllCops:Include are excluded by default. Add extra
440
+ # excludes here.
441
+ Exclude: []
442
+ # When true, requires that each source file should define a class or module
443
+ # with a name which matches the file name (converted to ... case).
444
+ # It further expects it to be nested inside modules which match the names
445
+ # of subdirectories in its path.
446
+ ExpectMatchingDefinition: false
447
+ # If non-nil, expect all source file names to match the following regex.
448
+ # Only the file name itself is matched, not the entire file path.
449
+ # Use anchors as necessary if you want to match the entire name rather than
450
+ # just a part of it.
451
+ Regex: ~
452
+ # With `IgnoreExecutableScripts` set to `true`, this cop does not
453
+ # report offending filenames for executable scripts (i.e. source
454
+ # files with a shebang in the first line).
455
+ IgnoreExecutableScripts: true
456
+
457
+ Style/FirstParameterIndentation:
458
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
459
+ SupportedStyles:
460
+ # The first parameter should always be indented one step more than the
461
+ # preceding line.
462
+ - consistent
463
+ # The first parameter should normally be indented one step more than the
464
+ # preceding line, but if it's a parameter for a method call that is itself
465
+ # a parameter in a method call, then the inner parameter should be indented
466
+ # relative to the inner method.
467
+ - special_for_inner_method_call
468
+ # Same as special_for_inner_method_call except that the special rule only
469
+ # applies if the outer method call encloses its arguments in parentheses.
470
+ - special_for_inner_method_call_in_parentheses
471
+ # By default, the indentation width from Style/IndentationWidth is used
472
+ # But it can be overridden by setting this parameter
473
+ IndentationWidth: ~
474
+
475
+ # Checks use of for or each in multiline loops.
476
+ Style/For:
477
+ EnforcedStyle: each
478
+ SupportedStyles:
479
+ - for
480
+ - each
481
+
482
+ # Enforce the method used for string formatting.
483
+ Style/FormatString:
484
+ EnforcedStyle: format
485
+ SupportedStyles:
486
+ - format
487
+ - sprintf
488
+ - percent
489
+
490
+ Style/FrozenStringLiteralComment:
491
+ EnforcedStyle: when_needed
492
+ SupportedStyles:
493
+ # `when_needed` will add the frozen string literal comment to files
494
+ # only when the `TargetRubyVersion` is set to 2.3+.
495
+ - when_needed
496
+ # `always` will always add the frozen string literal comment to a file
497
+ # regardless of the Ruby version or if `freeze` or `<<` are called on a
498
+ # string literal. If you run code against multiple versions of Ruby, it is
499
+ # possible that this will create errors in Ruby 2.3.0+.
500
+ - always
501
+
502
+ # Built-in global variables are allowed by default.
503
+ Style/GlobalVars:
504
+ AllowedVariables: []
505
+
506
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
507
+ # needs to have to trigger this cop
508
+ Style/GuardClause:
509
+ MinBodyLength: 1
510
+
511
+ Style/HashSyntax:
512
+ EnforcedStyle: ruby19
513
+ SupportedStyles:
514
+ - ruby19
515
+ - ruby19_no_mixed_keys
516
+ - hash_rockets
517
+ # Force hashes that have a symbol value to use hash rockets
518
+ UseHashRocketsWithSymbolValues: false
519
+
520
+ Style/IfUnlessModifier:
521
+ MaxLineLength: 80
522
+
523
+ Style/IndentationConsistency:
524
+ # The difference between `rails` and `normal` is that the `rails` style
525
+ # prescribes that in classes and modules the `protected` and `private`
526
+ # modifier keywords shall be indented the same as public methods and that
527
+ # protected and private members shall be indented one step more than the
528
+ # modifiers. Other than that, both styles mean that entities on the same
529
+ # logical depth shall have the same indentation.
530
+ EnforcedStyle: normal
531
+ SupportedStyles:
532
+ - normal
533
+ - rails
534
+
535
+ Style/IndentationWidth:
536
+ # Number of spaces for each indentation level.
537
+ Width: 2
538
+
539
+ # Checks the indentation of the first element in an array literal.
540
+ Style/IndentArray:
541
+ # The value `special_inside_parentheses` means that array literals with
542
+ # brackets that have their opening bracket on the same line as a surrounding
543
+ # opening round parenthesis, shall have their first element indented relative
544
+ # to the first position inside the parenthesis.
545
+ #
546
+ # The value `consistent` means that the indentation of the first element shall
547
+ # always be relative to the first position of the line where the opening
548
+ # bracket is.
549
+ #
550
+ # The value `align_brackets` means that the indentation of the first element
551
+ # shall always be relative to the position of the opening bracket.
552
+ EnforcedStyle: special_inside_parentheses
553
+ SupportedStyles:
554
+ - special_inside_parentheses
555
+ - consistent
556
+ - align_brackets
557
+ # By default, the indentation width from Style/IndentationWidth is used
558
+ # But it can be overridden by setting this parameter
559
+ IndentationWidth: ~
560
+
561
+ # Checks the indentation of assignment RHS, when on a different line from LHS
562
+ Style/IndentAssignment:
563
+ # By default, the indentation width from Style/IndentationWidth is used
564
+ # But it can be overridden by setting this parameter
565
+ IndentationWidth: ~
566
+
567
+ # Checks the indentation of the first key in a hash literal.
568
+ Style/IndentHash:
569
+ # The value `special_inside_parentheses` means that hash literals with braces
570
+ # that have their opening brace on the same line as a surrounding opening
571
+ # round parenthesis, shall have their first key indented relative to the
572
+ # first position inside the parenthesis.
573
+ #
574
+ # The value `consistent` means that the indentation of the first key shall
575
+ # always be relative to the first position of the line where the opening
576
+ # brace is.
577
+ #
578
+ # The value `align_braces` means that the indentation of the first key shall
579
+ # always be relative to the position of the opening brace.
580
+ EnforcedStyle: special_inside_parentheses
581
+ SupportedStyles:
582
+ - special_inside_parentheses
583
+ - consistent
584
+ - align_braces
585
+ # By default, the indentation width from Style/IndentationWidth is used
586
+ # But it can be overridden by setting this parameter
587
+ IndentationWidth: ~
588
+
589
+ Style/LambdaCall:
590
+ EnforcedStyle: call
591
+ SupportedStyles:
592
+ - call
593
+ - braces
594
+
595
+ Style/Next:
596
+ # With `always` all conditions at the end of an iteration needs to be
597
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
598
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
599
+ EnforcedStyle: skip_modifier_ifs
600
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
601
+ # needs to have to trigger this cop
602
+ MinBodyLength: 3
603
+ SupportedStyles:
604
+ - skip_modifier_ifs
605
+ - always
606
+
607
+ Style/NonNilCheck:
608
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
609
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
610
+ # **usually** OK, but might change behavior.
611
+ #
612
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
613
+ # offenses for `!x.nil?` and does no changes that might change behavior.
614
+ IncludeSemanticChanges: false
615
+
616
+ Style/MethodDefParentheses:
617
+ EnforcedStyle: require_parentheses
618
+ SupportedStyles:
619
+ - require_parentheses
620
+ - require_no_parentheses
621
+ - require_no_parentheses_except_multiline
622
+
623
+ Style/MethodName:
624
+ EnforcedStyle: snake_case
625
+ SupportedStyles:
626
+ - snake_case
627
+ - camelCase
628
+
629
+ Style/MultilineAssignmentLayout:
630
+ # The types of assignments which are subject to this rule.
631
+ SupportedTypes:
632
+ - block
633
+ - case
634
+ - class
635
+ - if
636
+ - kwbegin
637
+ - module
638
+ EnforcedStyle: new_line
639
+ SupportedStyles:
640
+ # Ensures that the assignment operator and the rhs are on the same line for
641
+ # the set of supported types.
642
+ - same_line
643
+ # Ensures that the assignment operator and the rhs are on separate lines
644
+ # for the set of supported types.
645
+ - new_line
646
+
647
+ Style/MultilineMethodCallIndentation:
648
+ EnforcedStyle: aligned
649
+ SupportedStyles:
650
+ - aligned
651
+ - indented
652
+ # By default, the indentation width from Style/IndentationWidth is used
653
+ # But it can be overridden by setting this parameter
654
+ IndentationWidth: ~
655
+
656
+ Style/MultilineOperationIndentation:
657
+ EnforcedStyle: aligned
658
+ SupportedStyles:
659
+ - aligned
660
+ - indented
661
+ # By default, the indentation width from Style/IndentationWidth is used
662
+ # But it can be overridden by setting this parameter
663
+ IndentationWidth: ~
664
+
665
+ Style/NumericLiterals:
666
+ MinDigits: 5
667
+
668
+ Style/OptionHash:
669
+ # A list of parameter names that will be flagged by this cop.
670
+ SuspiciousParamNames:
671
+ - options
672
+ - opts
673
+ - args
674
+ - params
675
+ - parameters
676
+
677
+ # Allow safe assignment in conditions.
678
+ Style/ParenthesesAroundCondition:
679
+ AllowSafeAssignment: true
680
+
681
+ Style/PercentLiteralDelimiters:
682
+ PreferredDelimiters:
683
+ '%': ()
684
+ '%i': ()
685
+ '%q': ()
686
+ '%Q': ()
687
+ '%r': '{}'
688
+ '%s': ()
689
+ '%w': ()
690
+ '%W': ()
691
+ '%x': ()
692
+
693
+ Style/PercentQLiterals:
694
+ EnforcedStyle: lower_case_q
695
+ SupportedStyles:
696
+ - lower_case_q # Use %q when possible, %Q when necessary
697
+ - upper_case_q # Always use %Q
698
+
699
+ Style/PredicateName:
700
+ # Predicate name prefixes.
701
+ NamePrefix:
702
+ - is_
703
+ - has_
704
+ - have_
705
+ # Predicate name prefixes that should be removed.
706
+ NamePrefixBlacklist:
707
+ - is_
708
+ - has_
709
+ - have_
710
+ # Predicate names which, despite having a blacklisted prefix, or no ?,
711
+ # should still be accepted
712
+ NameWhitelist:
713
+ - is_a?
714
+
715
+ Style/RaiseArgs:
716
+ EnforcedStyle: exploded
717
+ SupportedStyles:
718
+ - compact # raise Exception.new(msg)
719
+ - exploded # raise Exception, msg
720
+
721
+ Style/RedundantReturn:
722
+ # When true allows code like `return x, y`.
723
+ AllowMultipleReturnValues: false
724
+
725
+ # Use / or %r around regular expressions.
726
+ Style/RegexpLiteral:
727
+ EnforcedStyle: slashes
728
+ # slashes: Always use slashes.
729
+ # percent_r: Always use %r.
730
+ # mixed: Use slashes on single-line regexes, and %r on multi-line regexes.
731
+ SupportedStyles:
732
+ - slashes
733
+ - percent_r
734
+ - mixed
735
+ # If false, the cop will always recommend using %r if one or more slashes
736
+ # are found in the regexp string.
737
+ AllowInnerSlashes: false
738
+
739
+ Style/Semicolon:
740
+ # Allow ; to separate several expressions on the same line.
741
+ AllowAsExpressionSeparator: false
742
+
743
+ Style/SignalException:
744
+ EnforcedStyle: only_raise
745
+ SupportedStyles:
746
+ - only_raise
747
+ - only_fail
748
+ - semantic
749
+
750
+ Style/SingleLineBlockParams:
751
+ Methods:
752
+ - reduce:
753
+ - a
754
+ - e
755
+ - inject:
756
+ - a
757
+ - e
758
+
759
+ Style/SingleLineMethods:
760
+ AllowIfMethodIsEmpty: true
761
+
762
+ Style/SpaceBeforeFirstArg:
763
+ # When true, allows most uses of extra spacing if the intent is to align
764
+ # things with the previous or next line, not counting empty lines or comment
765
+ # lines.
766
+ AllowForAlignment: true
767
+
768
+ Style/SpecialGlobalVars:
769
+ EnforcedStyle: use_english_names
770
+ SupportedStyles:
771
+ - use_perl_names
772
+ - use_english_names
773
+
774
+ Style/StabbyLambdaParentheses:
775
+ EnforcedStyle: require_parentheses
776
+ SupportedStyles:
777
+ - require_parentheses
778
+ - require_no_parentheses
779
+
780
+ Style/StringLiterals:
781
+ EnforcedStyle: single_quotes
782
+ SupportedStyles:
783
+ - single_quotes
784
+ - double_quotes
785
+ # If true, strings which span multiple lines using \ for continuation must
786
+ # use the same type of quotes on each line.
787
+ ConsistentQuotesInMultiline: false
788
+
789
+ Style/StringLiteralsInInterpolation:
790
+ EnforcedStyle: single_quotes
791
+ SupportedStyles:
792
+ - single_quotes
793
+ - double_quotes
794
+
795
+ Style/StringMethods:
796
+ # Mapping from undesired method to desired_method
797
+ # e.g. to use `to_sym` over `intern`:
798
+ #
799
+ # StringMethods:
800
+ # PreferredMethods:
801
+ # intern: to_sym
802
+ PreferredMethods:
803
+ intern: to_sym
804
+
805
+ Style/SpaceAroundBlockParameters:
806
+ EnforcedStyleInsidePipes: no_space
807
+ SupportedStyles:
808
+ - space
809
+ - no_space
810
+
811
+ Style/SpaceAroundEqualsInParameterDefault:
812
+ EnforcedStyle: space
813
+ SupportedStyles:
814
+ - space
815
+ - no_space
816
+
817
+ Style/SpaceAroundOperators:
818
+ # When true, allows most uses of extra spacing if the intent is to align
819
+ # with an operator on the previous or next line, not counting empty lines
820
+ # or comment lines.
821
+ AllowForAlignment: true
822
+
823
+ Style/SpaceBeforeBlockBraces:
824
+ EnforcedStyle: space
825
+ SupportedStyles:
826
+ - space
827
+ - no_space
828
+
829
+ Style/SpaceInsideBlockBraces:
830
+ EnforcedStyle: space
831
+ SupportedStyles:
832
+ - space
833
+ - no_space
834
+ # Valid values are: space, no_space
835
+ EnforcedStyleForEmptyBraces: no_space
836
+ # Space between { and |. Overrides EnforcedStyle if there is a conflict.
837
+ SpaceBeforeBlockParameters: true
838
+
839
+ Style/SpaceInsideHashLiteralBraces:
840
+ EnforcedStyle: space
841
+ EnforcedStyleForEmptyBraces: no_space
842
+ SupportedStyles:
843
+ - space
844
+ - no_space
845
+
846
+ Style/SpaceInsideStringInterpolation:
847
+ EnforcedStyle: no_space
848
+ SupportedStyles:
849
+ - space
850
+ - no_space
851
+
852
+ Style/SymbolArray:
853
+ EnforcedStyle: percent
854
+ SupportedStyles:
855
+ - percent
856
+ - brackets
857
+
858
+ Style/SymbolProc:
859
+ # A list of method names to be ignored by the check.
860
+ # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
861
+ IgnoredMethods:
862
+ - respond_to
863
+
864
+ Style/TrailingBlankLines:
865
+ EnforcedStyle: final_newline
866
+ SupportedStyles:
867
+ - final_newline
868
+ - final_blank_line
869
+
870
+ Style/TrailingCommaInArguments:
871
+ # If `comma`, the cop requires a comma after the last argument, but only for
872
+ # parenthesized method calls where each argument is on its own line.
873
+ # If `consistent_comma`, the cop requires a comma after the last argument,
874
+ # for all parenthesized method calls with arguments.
875
+ EnforcedStyleForMultiline: no_comma
876
+ SupportedStyles:
877
+ - comma
878
+ - consistent_comma
879
+ - no_comma
880
+
881
+ Style/TrailingCommaInLiteral:
882
+ # If `comma`, the cop requires a comma after the last item in an array or
883
+ # hash, but only when each item is on its own line.
884
+ # If `consistent_comma`, the cop requires a comma after the last item of all
885
+ # non-empty array and hash literals.
886
+ EnforcedStyleForMultiline: no_comma
887
+ SupportedStyles:
888
+ - comma
889
+ - consistent_comma
890
+ - no_comma
891
+
892
+ # TrivialAccessors requires exact name matches and doesn't allow
893
+ # predicated methods by default.
894
+ Style/TrivialAccessors:
895
+ # When set to false the cop will suggest the use of accessor methods
896
+ # in situations like:
897
+ #
898
+ # def name
899
+ # @other_name
900
+ # end
901
+ #
902
+ # This way you can uncover "hidden" attributes in your code.
903
+ ExactNameMatch: true
904
+ AllowPredicates: true
905
+ # Allows trivial writers that don't end in an equal sign. e.g.
906
+ #
907
+ # def on_exception(action)
908
+ # @on_exception=action
909
+ # end
910
+ # on_exception :restart
911
+ #
912
+ # Commonly used in DSLs
913
+ AllowDSLWriters: false
914
+ IgnoreClassMethods: false
915
+ Whitelist:
916
+ - to_ary
917
+ - to_a
918
+ - to_c
919
+ - to_enum
920
+ - to_h
921
+ - to_hash
922
+ - to_i
923
+ - to_int
924
+ - to_io
925
+ - to_open
926
+ - to_path
927
+ - to_proc
928
+ - to_r
929
+ - to_regexp
930
+ - to_str
931
+ - to_s
932
+ - to_sym
933
+
934
+ Style/VariableName:
935
+ EnforcedStyle: snake_case
936
+ SupportedStyles:
937
+ - snake_case
938
+ - camelCase
939
+
940
+ Style/WhileUntilModifier:
941
+ MaxLineLength: 80
942
+
943
+ Style/WordArray:
944
+ EnforcedStyle: percent
945
+ SupportedStyles:
946
+ - percent
947
+ - brackets
948
+ MinSize: 0
949
+ # The regular expression WordRegex decides what is considered a word.
950
+ WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
951
+
952
+ ##################### Metrics ##################################
953
+
954
+ Metrics/AbcSize:
955
+ # The ABC size is a calculated magnitude, so this number can be a Fixnum or
956
+ # a Float.
957
+ Max: 15
958
+
959
+ Metrics/BlockNesting:
960
+ Max: 3
961
+
962
+ Metrics/ClassLength:
963
+ CountComments: false # count full line comments?
964
+ Max: 100
965
+
966
+ Metrics/ModuleLength:
967
+ CountComments: false # count full line comments?
968
+ Max: 100
969
+
970
+ # Avoid complex methods.
971
+ Metrics/CyclomaticComplexity:
972
+ Max: 6
973
+
974
+ Metrics/LineLength:
975
+ Max: 80
976
+ # To make it possible to copy or click on URIs in the code, we allow lines
977
+ # containing a URI to be longer than Max.
978
+ AllowHeredoc: true
979
+ AllowURI: true
980
+ URISchemes:
981
+ - http
982
+ - https
983
+
984
+ Metrics/MethodLength:
985
+ CountComments: false # count full line comments?
986
+ Max: 10
987
+
988
+ Metrics/ParameterLists:
989
+ Max: 5
990
+ CountKeywordArgs: true
991
+
992
+ Metrics/PerceivedComplexity:
993
+ Max: 7
994
+
995
+ ##################### Lint ##################################
996
+
997
+ # Allow safe assignment in conditions.
998
+ Lint/AssignmentInCondition:
999
+ AllowSafeAssignment: true
1000
+
1001
+ # checks whether the end keywords are aligned properly for `do` `end` blocks.
1002
+ Lint/BlockAlignment:
1003
+ # The value `start_of_block` means that the `end` should be aligned with line
1004
+ # where the `do` keyword appears.
1005
+ # The value `start_of_line` means it should be aligned with the whole
1006
+ # expression's starting line.
1007
+ # The value `either` means both are allowed.
1008
+ AlignWith: either
1009
+ SupportedStyles:
1010
+ - either
1011
+ - start_of_block
1012
+ - start_of_line
1013
+
1014
+ # Align ends correctly.
1015
+ Lint/EndAlignment:
1016
+ # The value `keyword` means that `end` should be aligned with the matching
1017
+ # keyword (if, while, etc.).
1018
+ # The value `variable` means that in assignments, `end` should be aligned
1019
+ # with the start of the variable on the left hand side of `=`. In all other
1020
+ # situations, `end` should still be aligned with the keyword.
1021
+ # The value `start_of_line` means that `end` should be aligned with the start
1022
+ # of the line which the matching keyword appears on.
1023
+ AlignWith: keyword
1024
+ SupportedStyles:
1025
+ - keyword
1026
+ - variable
1027
+ - start_of_line
1028
+ AutoCorrect: false
1029
+
1030
+ Lint/DefEndAlignment:
1031
+ # The value `def` means that `end` should be aligned with the def keyword.
1032
+ # The value `start_of_line` means that `end` should be aligned with method
1033
+ # calls like `private`, `public`, etc, if present in front of the `def`
1034
+ # keyword on the same line.
1035
+ AlignWith: start_of_line
1036
+ SupportedStyles:
1037
+ - start_of_line
1038
+ - def
1039
+ AutoCorrect: false
1040
+
1041
+ # Checks for unused block arguments
1042
+ Lint/UnusedBlockArgument:
1043
+ IgnoreEmptyBlocks: true
1044
+
1045
+ # Checks for unused method arguments.
1046
+ Lint/UnusedMethodArgument:
1047
+ AllowUnusedKeywordArguments: false
1048
+ IgnoreEmptyMethods: true
1049
+
1050
+ ##################### Performance ############################
1051
+
1052
+ Performance/RedundantMerge:
1053
+ # Max number of key-value pairs to consider an offense
1054
+ MaxKeyValuePairs: 2
1055
+
1056
+ ##################### Rails ##################################
1057
+
1058
+ Rails/ActionFilter:
1059
+ EnforcedStyle: action
1060
+ SupportedStyles:
1061
+ - action
1062
+ - filter
1063
+ Include:
1064
+ - app/controllers/**/*.rb
1065
+
1066
+ Rails/Date:
1067
+ # The value `strict` disallows usage of `Date.today`, `Date.current`,
1068
+ # `Date#to_time` etc.
1069
+ # The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc
1070
+ # (but not `Date.today`) which are overridden by ActiveSupport to handle current
1071
+ # time zone.
1072
+ EnforcedStyle: flexible
1073
+ SupportedStyles:
1074
+ - strict
1075
+ - flexible
1076
+
1077
+ Rails/FindBy:
1078
+ Include:
1079
+ - app/models/**/*.rb
1080
+
1081
+ Rails/FindEach:
1082
+ Include:
1083
+ - app/models/**/*.rb
1084
+
1085
+ Rails/HasAndBelongsToMany:
1086
+ Include:
1087
+ - app/models/**/*.rb
1088
+
1089
+ Rails/Output:
1090
+ Include:
1091
+ - app/**/*.rb
1092
+ - config/**/*.rb
1093
+ - db/**/*.rb
1094
+ - lib/**/*.rb
1095
+
1096
+ Rails/ReadWriteAttribute:
1097
+ Include:
1098
+ - app/models/**/*.rb
1099
+
1100
+ Rails/ScopeArgs:
1101
+ Include:
1102
+ - app/models/**/*.rb
1103
+
1104
+ Rails/TimeZone:
1105
+ # The value `strict` means that `Time` should be used with `zone`.
1106
+ # The value `flexible` allows usage of `in_time_zone` instead of `zone`.
1107
+ EnforcedStyle: flexible
1108
+ SupportedStyles:
1109
+ - strict
1110
+ - flexible
1111
+
1112
+ Rails/Validation:
1113
+ Include:
1114
+ - app/models/**/*.rb