micro-rb 0.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rubocop.yml +1399 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +5 -0
  7. data/CODE_OF_CONDUCT.md +74 -0
  8. data/Gemfile +11 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +204 -0
  11. data/Rakefile +12 -0
  12. data/bin/console +16 -0
  13. data/bin/microrb +7 -0
  14. data/bin/setup +8 -0
  15. data/lib/micro/cli.rb +69 -0
  16. data/lib/micro/configuration.rb +34 -0
  17. data/lib/micro/examples/proto/sum.proto +12 -0
  18. data/lib/micro/examples/proto/sum_pb.rb +21 -0
  19. data/lib/micro/examples/sum.rb +22 -0
  20. data/lib/micro/handler.rb +63 -0
  21. data/lib/micro/handler_manager.rb +60 -0
  22. data/lib/micro/handlers/debug.rb +26 -0
  23. data/lib/micro/project_generator.rb +75 -0
  24. data/lib/micro/proto/debug.proto +10 -0
  25. data/lib/micro/proto/debug_pb.rb +19 -0
  26. data/lib/micro/servers/error.rb +58 -0
  27. data/lib/micro/servers/web.rb +162 -0
  28. data/lib/micro/sidecar/base.rb +26 -0
  29. data/lib/micro/sidecar/call.rb +18 -0
  30. data/lib/micro/sidecar/register.rb +18 -0
  31. data/lib/micro/version.rb +6 -0
  32. data/lib/micro-rb.rb +4 -0
  33. data/lib/microrb.rb +25 -0
  34. data/micro-rb.gemspec +37 -0
  35. data/registry.png +0 -0
  36. data/sum.png +0 -0
  37. data/templates/Dockerfile +3 -0
  38. data/templates/Gemfile +18 -0
  39. data/templates/LICENSE +21 -0
  40. data/templates/README.md +17 -0
  41. data/templates/Rakefile +9 -0
  42. data/templates/bin/app +17 -0
  43. data/templates/lib/app/handlers/example_handler.rb +16 -0
  44. data/templates/lib/app/proto/sum.proto +12 -0
  45. data/templates/lib/app/proto/sum_pb.rb +21 -0
  46. data/templates/lib/app/version.rb +4 -0
  47. data/templates/lib/app.rb +14 -0
  48. data/templates/test/app_test.rb +11 -0
  49. data/templates/test/test_helper.rb +9 -0
  50. metadata +277 -0
data/.rubocop.yml ADDED
@@ -0,0 +1,1399 @@
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
+ #inherit_from:
5
+ # - enabled.yml
6
+ # - disabled.yml
7
+
8
+ # Common configuration.
9
+ AllCops:
10
+ # Include common Ruby source files.
11
+ Include:
12
+ - '**/*.gemspec'
13
+ - '**/*.podspec'
14
+ - '**/*.jbuilder'
15
+ - '**/*.rake'
16
+ - '**/*.opal'
17
+ - '**/config.ru'
18
+ - '**/Gemfile'
19
+ - '**/Rakefile'
20
+ - '**/Capfile'
21
+ - '**/Guardfile'
22
+ - '**/Podfile'
23
+ - '**/Thorfile'
24
+ - '**/Vagrantfile'
25
+ - '**/Berksfile'
26
+ - '**/Cheffile'
27
+ - '**/Vagabondfile'
28
+ - '**/Fastfile'
29
+ - '**/*Fastfile'
30
+ Exclude:
31
+ - 'vendor/**/*'
32
+ - 'micro-rb.gemspec'
33
+ - 'templates/**/*'
34
+ - 'lib/micro/proto/**/*'
35
+ - 'test/**/*'
36
+ - 'lib/micro/examples/proto/**/*'
37
+
38
+ # Default formatter will be used if no `-f/--format` option is given.
39
+ DefaultFormatter: progress
40
+ # Cop names are not displayed in offense messages by default. Change behavior
41
+ # by overriding DisplayCopNames, or by giving the `-D/--display-cop-names`
42
+ # option.
43
+ DisplayCopNames: false
44
+ # Style guide URLs are not displayed in offense messages by default. Change
45
+ # behavior by overriding `DisplayStyleGuide`, or by giving the
46
+ # `-S/--display-style-guide` option.
47
+ DisplayStyleGuide: false
48
+ # When specifying style guide URLs, any paths and/or fragments will be
49
+ # evaluated relative to the base URL.
50
+ StyleGuideBaseURL: https://github.com/bbatsov/ruby-style-guide
51
+ # Extra details are not displayed in offense messages by default. Change
52
+ # behavior by overriding ExtraDetails, or by giving the
53
+ # `-E/--extra-details` option.
54
+ ExtraDetails: false
55
+ # Additional cops that do not reference a style guide rule may be enabled by
56
+ # default. Change behavior by overriding `StyleGuideCopsOnly`, or by giving
57
+ # the `--only-guide-cops` option.
58
+ StyleGuideCopsOnly: false
59
+ # All cops except the ones in disabled.yml are enabled by default. Change
60
+ # this behavior by overriding either `DisabledByDefault` or `EnabledByDefault`.
61
+ # When `DisabledByDefault` is `true`, all cops in the default configuration
62
+ # are disabled, and only cops in user configuration are enabled. This makes
63
+ # cops opt-in instead of opt-out. Note that when `DisabledByDefault` is `true`,
64
+ # cops in user configuration will be enabled even if they don't set the
65
+ # Enabled parameter.
66
+ # When `EnabledByDefault` is `true`, all cops, even those in disabled.yml,
67
+ # are enabled by default. Cops can still be disabled in user configuration.
68
+ # Note that it is invalid to set both EnabledByDefault and DisabledByDefault
69
+ # to true in the same configuration.
70
+ EnabledByDefault: false
71
+ DisabledByDefault: false
72
+ # Enables the result cache if `true`. Can be overridden by the `--cache` command
73
+ # line option.
74
+ UseCache: true
75
+ # Threshold for how many files can be stored in the result cache before some
76
+ # of the files are automatically removed.
77
+ MaxFilesInCache: 20000
78
+ # The cache will be stored in "rubocop_cache" under this directory. The name
79
+ # "/tmp" is special and will be converted to the system temporary directory,
80
+ # which is "/tmp" on Unix-like systems, but could be something else on other
81
+ # systems.
82
+ CacheRootDirectory: /tmp
83
+ # The default cache root directory is /tmp, which on most systems is
84
+ # writable by any system user. This means that it is possible for a
85
+ # malicious user to anticipate the location of Rubocop's cache directory,
86
+ # and create a symlink in its place that could cause Rubocop to overwrite
87
+ # unintended files, or read malicious input. If you are certain that your
88
+ # cache location is secure from this kind of attack, and wish to use a
89
+ # symlinked cache location, set this value to "true".
90
+ AllowSymlinksInCacheRootDirectory: false
91
+ # What MRI version of the Ruby interpreter is the inspected code intended to
92
+ # run on? (If there is more than one, set this to the lowest version.)
93
+ # If a value is specified for TargetRubyVersion then it is used.
94
+ # Else if .ruby-version exists and it contains an MRI version it is used.
95
+ # Otherwise we fallback to the oldest officially supported Ruby version (2.1).
96
+ TargetRubyVersion: ~
97
+ TargetRailsVersion: 5.0
98
+
99
+ # Indent private/protected/public as deep as method definitions
100
+ Style/AccessModifierIndentation:
101
+ EnforcedStyle: indent
102
+ SupportedStyles:
103
+ - outdent
104
+ - indent
105
+ # By default, the indentation width from Style/IndentationWidth is used
106
+ # But it can be overridden by setting this parameter
107
+ IndentationWidth: ~
108
+
109
+ Style/Alias:
110
+ EnforcedStyle: prefer_alias
111
+ SupportedStyles:
112
+ - prefer_alias
113
+ - prefer_alias_method
114
+
115
+ # Align the elements of a hash literal if they span more than one line.
116
+ Style/AlignHash:
117
+ # Alignment of entries using hash rocket as separator. Valid values are:
118
+ #
119
+ # key - left alignment of keys
120
+ # 'a' => 2
121
+ # 'bb' => 3
122
+ # separator - alignment of hash rockets, keys are right aligned
123
+ # 'a' => 2
124
+ # 'bb' => 3
125
+ # table - left alignment of keys, hash rockets, and values
126
+ # 'a' => 2
127
+ # 'bb' => 3
128
+ EnforcedHashRocketStyle: key
129
+ SupportedHashRocketStyles:
130
+ - key
131
+ - separator
132
+ - table
133
+ # Alignment of entries using colon as separator. Valid values are:
134
+ #
135
+ # key - left alignment of keys
136
+ # a: 0
137
+ # bb: 1
138
+ # separator - alignment of colons, keys are right aligned
139
+ # a: 0
140
+ # bb: 1
141
+ # table - left alignment of keys and values
142
+ # a: 0
143
+ # bb: 1
144
+ EnforcedColonStyle: key
145
+ SupportedColonStyles:
146
+ - key
147
+ - separator
148
+ - table
149
+ # Select whether hashes that are the last argument in a method call should be
150
+ # inspected? Valid values are:
151
+ #
152
+ # always_inspect - Inspect both implicit and explicit hashes.
153
+ # Registers an offense for:
154
+ # function(a: 1,
155
+ # b: 2)
156
+ # Registers an offense for:
157
+ # function({a: 1,
158
+ # b: 2})
159
+ # always_ignore - Ignore both implicit and explicit hashes.
160
+ # Accepts:
161
+ # function(a: 1,
162
+ # b: 2)
163
+ # Accepts:
164
+ # function({a: 1,
165
+ # b: 2})
166
+ # ignore_implicit - Ignore only implicit hashes.
167
+ # Accepts:
168
+ # function(a: 1,
169
+ # b: 2)
170
+ # Registers an offense for:
171
+ # function({a: 1,
172
+ # b: 2})
173
+ # ignore_explicit - Ignore only explicit hashes.
174
+ # Accepts:
175
+ # function({a: 1,
176
+ # b: 2})
177
+ # Registers an offense for:
178
+ # function(a: 1,
179
+ # b: 2)
180
+ EnforcedLastArgumentHashStyle: always_inspect
181
+ SupportedLastArgumentHashStyles:
182
+ - always_inspect
183
+ - always_ignore
184
+ - ignore_implicit
185
+ - ignore_explicit
186
+
187
+ Style/AlignParameters:
188
+ # Alignment of parameters in multi-line method calls.
189
+ #
190
+ # The `with_first_parameter` style aligns the following lines along the same
191
+ # column as the first parameter.
192
+ #
193
+ # method_call(a,
194
+ # b)
195
+ #
196
+ # The `with_fixed_indentation` style aligns the following lines with one
197
+ # level of indentation relative to the start of the line with the method call.
198
+ #
199
+ # method_call(a,
200
+ # b)
201
+ EnforcedStyle: with_first_parameter
202
+ SupportedStyles:
203
+ - with_first_parameter
204
+ - with_fixed_indentation
205
+ # By default, the indentation width from Style/IndentationWidth is used
206
+ # But it can be overridden by setting this parameter
207
+ IndentationWidth: ~
208
+
209
+ Style/AndOr:
210
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
211
+ # or completely (always).
212
+ EnforcedStyle: always
213
+ SupportedStyles:
214
+ - always
215
+ - conditionals
216
+
217
+
218
+ # Checks if usage of `%()` or `%Q()` matches configuration.
219
+ Style/BarePercentLiterals:
220
+ EnforcedStyle: bare_percent
221
+ SupportedStyles:
222
+ - percent_q
223
+ - bare_percent
224
+
225
+ Style/BlockDelimiters:
226
+ EnforcedStyle: line_count_based
227
+ SupportedStyles:
228
+ # The `line_count_based` style enforces braces around single line blocks and
229
+ # do..end around multi-line blocks.
230
+ - line_count_based
231
+ # The `semantic` style enforces braces around functional blocks, where the
232
+ # primary purpose of the block is to return a value and do..end for
233
+ # procedural blocks, where the primary purpose of the block is its
234
+ # side-effects.
235
+ #
236
+ # This looks at the usage of a block's method to determine its type (e.g. is
237
+ # the result of a `map` assigned to a variable or passed to another
238
+ # method) but exceptions are permitted in the `ProceduralMethods`,
239
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
240
+ - semantic
241
+ # The `braces_for_chaining` style enforces braces around single line blocks
242
+ # and do..end around multi-line blocks, except for multi-line blocks whose
243
+ # return value is being chained with another method (in which case braces
244
+ # are enforced).
245
+ - braces_for_chaining
246
+ ProceduralMethods:
247
+ # Methods that are known to be procedural in nature but look functional from
248
+ # their usage, e.g.
249
+ #
250
+ # time = Benchmark.realtime do
251
+ # foo.bar
252
+ # end
253
+ #
254
+ # Here, the return value of the block is discarded but the return value of
255
+ # `Benchmark.realtime` is used.
256
+ - benchmark
257
+ - bm
258
+ - bmbm
259
+ - create
260
+ - each_with_object
261
+ - measure
262
+ - new
263
+ - realtime
264
+ - tap
265
+ - with_object
266
+ FunctionalMethods:
267
+ # Methods that are known to be functional in nature but look procedural from
268
+ # their usage, e.g.
269
+ #
270
+ # let(:foo) { Foo.new }
271
+ #
272
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
273
+ # doesn't appear to be used from the return value of `let`.
274
+ - let
275
+ - let!
276
+ - subject
277
+ - watch
278
+ IgnoredMethods:
279
+ # Methods that can be either procedural or functional and cannot be
280
+ # categorised from their usage alone, e.g.
281
+ #
282
+ # foo = lambda do |x|
283
+ # puts "Hello, #{x}"
284
+ # end
285
+ #
286
+ # foo = lambda do |x|
287
+ # x * 100
288
+ # end
289
+ #
290
+ # Here, it is impossible to tell from the return value of `lambda` whether
291
+ # the inner block's return value is significant.
292
+ - lambda
293
+ - proc
294
+ - it
295
+
296
+ Style/BracesAroundHashParameters:
297
+ EnforcedStyle: no_braces
298
+ SupportedStyles:
299
+ # The `braces` style enforces braces around all method parameters that are
300
+ # hashes.
301
+ - braces
302
+ # The `no_braces` style checks that the last parameter doesn't have braces
303
+ # around it.
304
+ - no_braces
305
+ # The `context_dependent` style checks that the last parameter doesn't have
306
+ # braces around it, but requires braces if the second to last parameter is
307
+ # also a hash literal.
308
+ - context_dependent
309
+
310
+ # Indentation of `when`.
311
+ Style/CaseIndentation:
312
+ EnforcedStyle: case
313
+ SupportedStyles:
314
+ - case
315
+ - end
316
+ IndentOneStep: false
317
+ # By default, the indentation width from `Style/IndentationWidth` is used.
318
+ # But it can be overridden by setting this parameter.
319
+ # This only matters if `IndentOneStep` is `true`
320
+ IndentationWidth: ~
321
+
322
+ Style/ClassAndModuleChildren:
323
+ # Checks the style of children definitions at classes and modules.
324
+ #
325
+ # Basically there are two different styles:
326
+ #
327
+ # `nested` - have each child on a separate line
328
+ # class Foo
329
+ # class Bar
330
+ # end
331
+ # end
332
+ #
333
+ # `compact` - combine definitions as much as possible
334
+ # class Foo::Bar
335
+ # end
336
+ #
337
+ # The compact style is only forced, for classes or modules with one child.
338
+ EnforcedStyle: nested
339
+ SupportedStyles:
340
+ - nested
341
+ - compact
342
+
343
+ Style/ClassCheck:
344
+ EnforcedStyle: is_a?
345
+ SupportedStyles:
346
+ - is_a?
347
+ - kind_of?
348
+
349
+ # Align with the style guide.
350
+ Style/CollectionMethods:
351
+ # Mapping from undesired method to desired_method
352
+ # e.g. to use `detect` over `find`:
353
+ #
354
+ # CollectionMethods:
355
+ # PreferredMethods:
356
+ # find: detect
357
+ PreferredMethods:
358
+ collect: 'map'
359
+ collect!: 'map!'
360
+ inject: 'reduce'
361
+ detect: 'find'
362
+ find_all: 'select'
363
+
364
+ # Use '`' or '%x' around command literals.
365
+ Style/CommandLiteral:
366
+ EnforcedStyle: backticks
367
+ # backticks: Always use backticks.
368
+ # percent_x: Always use `%x`.
369
+ # mixed: Use backticks on single-line commands, and `%x` on multi-line commands.
370
+ SupportedStyles:
371
+ - backticks
372
+ - percent_x
373
+ - mixed
374
+ # If `false`, the cop will always recommend using `%x` if one or more backticks
375
+ # are found in the command string.
376
+ AllowInnerBackticks: false
377
+
378
+ # Checks formatting of special comments
379
+ Style/CommentAnnotation:
380
+ Keywords:
381
+ - TODO
382
+ - FIXME
383
+ - OPTIMIZE
384
+ - HACK
385
+ - REVIEW
386
+
387
+ Style/ConditionalAssignment:
388
+ EnforcedStyle: assign_to_condition
389
+ SupportedStyles:
390
+ - assign_to_condition
391
+ - assign_inside_condition
392
+ # When configured to `assign_to_condition`, `SingleLineConditionsOnly`
393
+ # will only register an offense when all branches of a condition are
394
+ # a single line.
395
+ # When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
396
+ # will only register an offense for assignment to a condition that has
397
+ # at least one multiline branch.
398
+ SingleLineConditionsOnly: true
399
+ IncludeTernaryExpressions: true
400
+
401
+ # Checks that you have put a copyright in a comment before any code.
402
+ #
403
+ # You can override the default Notice in your .rubocop.yml file.
404
+ #
405
+ # In order to use autocorrect, you must supply a value for the
406
+ # `AutocorrectNotice` key that matches the regexp Notice. A blank
407
+ # `AutocorrectNotice` will cause an error during autocorrect.
408
+ #
409
+ # Autocorrect will add a copyright notice in a comment at the top
410
+ # of the file immediately after any shebang or encoding comments.
411
+ #
412
+ # Example rubocop.yml:
413
+ #
414
+ # Style/Copyright:
415
+ # Enabled: true
416
+ # Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
417
+ # AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
418
+ #
419
+ Style/Copyright:
420
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
421
+ AutocorrectNotice: ''
422
+
423
+ Style/DocumentationMethod:
424
+ RequireForNonPublicMethods: false
425
+
426
+ # Multi-line method chaining should be done with leading dots.
427
+ Style/DotPosition:
428
+ EnforcedStyle: leading
429
+ SupportedStyles:
430
+ - leading
431
+ - trailing
432
+
433
+ # Warn on empty else statements
434
+ # empty - warn only on empty `else`
435
+ # nil - warn on `else` with nil in it
436
+ # both - warn on empty `else` and `else` with `nil` in it
437
+ Style/EmptyElse:
438
+ EnforcedStyle: both
439
+ SupportedStyles:
440
+ - empty
441
+ - nil
442
+ - both
443
+
444
+ # Use empty lines between defs.
445
+ Style/EmptyLineBetweenDefs:
446
+ # If `true`, this parameter means that single line method definitions don't
447
+ # need an empty line between them.
448
+ AllowAdjacentOneLineDefs: false
449
+ # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
450
+ NumberOfEmptyLines: 1
451
+
452
+ Style/EmptyLinesAroundBlockBody:
453
+ EnforcedStyle: no_empty_lines
454
+ SupportedStyles:
455
+ - empty_lines
456
+ - no_empty_lines
457
+
458
+ Style/EmptyLinesAroundClassBody:
459
+ EnforcedStyle: no_empty_lines
460
+ SupportedStyles:
461
+ - empty_lines
462
+ - empty_lines_except_namespace
463
+ - empty_lines_special
464
+ - no_empty_lines
465
+
466
+ Style/EmptyLinesAroundModuleBody:
467
+ EnforcedStyle: no_empty_lines
468
+ SupportedStyles:
469
+ - empty_lines
470
+ - empty_lines_except_namespace
471
+ - empty_lines_special
472
+ - no_empty_lines
473
+
474
+ Style/EmptyMethod:
475
+ EnforcedStyle: compact
476
+ SupportedStyles:
477
+ - compact
478
+ - expanded
479
+
480
+ # Checks whether the source file has a utf-8 encoding comment or not
481
+ # AutoCorrectEncodingComment must match the regex
482
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
483
+ Style/Encoding:
484
+ EnforcedStyle: never
485
+ SupportedStyles:
486
+ - when_needed
487
+ - always
488
+ - never
489
+ AutoCorrectEncodingComment: '# encoding: utf-8'
490
+
491
+ Style/EndOfLine:
492
+ # The `native` style means that CR+LF (Carriage Return + Line Feed) is
493
+ # enforced on Windows, and LF is enforced on other platforms. The other styles
494
+ # mean LF and CR+LF, respectively.
495
+ EnforcedStyle: native
496
+ SupportedStyles:
497
+ - native
498
+ - lf
499
+ - crlf
500
+
501
+ Style/ExtraSpacing:
502
+ # When true, allows most uses of extra spacing if the intent is to align
503
+ # things with the previous or next line, not counting empty lines or comment
504
+ # lines.
505
+ AllowForAlignment: true
506
+ # When true, forces the alignment of `=` in assignments on consecutive lines.
507
+ ForceEqualSignAlignment: false
508
+
509
+ Style/FileName:
510
+ # File names listed in `AllCops:Include` are excluded by default. Add extra
511
+ # excludes here.
512
+ Exclude: ['lib/micro-rb.rb']
513
+ # When `true`, requires that each source file should define a class or module
514
+ # with a name which matches the file name (converted to ... case).
515
+ # It further expects it to be nested inside modules which match the names
516
+ # of subdirectories in its path.
517
+ ExpectMatchingDefinition: false
518
+ # If non-`nil`, expect all source file names to match the following regex.
519
+ # Only the file name itself is matched, not the entire file path.
520
+ # Use anchors as necessary if you want to match the entire name rather than
521
+ # just a part of it.
522
+ Regex: ~
523
+ # With `IgnoreExecutableScripts` set to `true`, this cop does not
524
+ # report offending filenames for executable scripts (i.e. source
525
+ # files with a shebang in the first line).
526
+ IgnoreExecutableScripts: true
527
+ AllowedAcronyms:
528
+ - CLI
529
+ - DSL
530
+ - ACL
531
+ - API
532
+ - ASCII
533
+ - CPU
534
+ - CSS
535
+ - DNS
536
+ - EOF
537
+ - GUID
538
+ - HTML
539
+ - HTTP
540
+ - HTTPS
541
+ - ID
542
+ - IP
543
+ - JSON
544
+ - LHS
545
+ - QPS
546
+ - RAM
547
+ - RHS
548
+ - RPC
549
+ - SLA
550
+ - SMTP
551
+ - SQL
552
+ - SSH
553
+ - TCP
554
+ - TLS
555
+ - TTL
556
+ - UDP
557
+ - UI
558
+ - UID
559
+ - UUID
560
+ - URI
561
+ - URL
562
+ - UTF8
563
+ - VM
564
+ - XML
565
+ - XMPP
566
+ - XSRF
567
+ - XSS
568
+
569
+ Style/FirstParameterIndentation:
570
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
571
+ SupportedStyles:
572
+ # The first parameter should always be indented one step more than the
573
+ # preceding line.
574
+ - consistent
575
+ # The first parameter should normally be indented one step more than the
576
+ # preceding line, but if it's a parameter for a method call that is itself
577
+ # a parameter in a method call, then the inner parameter should be indented
578
+ # relative to the inner method.
579
+ - special_for_inner_method_call
580
+ # Same as `special_for_inner_method_call` except that the special rule only
581
+ # applies if the outer method call encloses its arguments in parentheses.
582
+ - special_for_inner_method_call_in_parentheses
583
+ # By default, the indentation width from `Style/IndentationWidth` is used
584
+ # But it can be overridden by setting this parameter
585
+ IndentationWidth: ~
586
+
587
+ # Checks use of for or each in multiline loops.
588
+ Style/For:
589
+ EnforcedStyle: each
590
+ SupportedStyles:
591
+ - for
592
+ - each
593
+
594
+ # Enforce the method used for string formatting.
595
+ Style/FormatString:
596
+ EnforcedStyle: format
597
+ SupportedStyles:
598
+ - format
599
+ - sprintf
600
+ - percent
601
+
602
+ Style/FrozenStringLiteralComment:
603
+ EnforcedStyle: when_needed
604
+ SupportedStyles:
605
+ # `when_needed` will add the frozen string literal comment to files
606
+ # only when the `TargetRubyVersion` is set to 2.3+.
607
+ - when_needed
608
+ # `always` will always add the frozen string literal comment to a file
609
+ # regardless of the Ruby version or if `freeze` or `<<` are called on a
610
+ # string literal. If you run code against multiple versions of Ruby, it is
611
+ # possible that this will create errors in Ruby 2.3.0+.
612
+ - always
613
+ # `never` will enforce that the frozen string literal comment does not
614
+ # exist in a file.
615
+ - never
616
+
617
+ # Built-in global variables are allowed by default.
618
+ Style/GlobalVars:
619
+ AllowedVariables: []
620
+
621
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
622
+ # needs to have to trigger this cop
623
+ Style/GuardClause:
624
+ MinBodyLength: 1
625
+
626
+ Style/HashSyntax:
627
+ EnforcedStyle: ruby19
628
+ SupportedStyles:
629
+ # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
630
+ - ruby19
631
+ # checks for hash rocket syntax for all hashes
632
+ - hash_rockets
633
+ # forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
634
+ - no_mixed_keys
635
+ # enforces both ruby19 and no_mixed_keys styles
636
+ - ruby19_no_mixed_keys
637
+ # Force hashes that have a symbol value to use hash rockets
638
+ UseHashRocketsWithSymbolValues: false
639
+ # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
640
+ PreferHashRocketsForNonAlnumEndingSymbols: false
641
+
642
+ Style/IfUnlessModifier:
643
+ MaxLineLength: 80
644
+
645
+ Style/IndentationConsistency:
646
+ # The difference between `rails` and `normal` is that the `rails` style
647
+ # prescribes that in classes and modules the `protected` and `private`
648
+ # modifier keywords shall be indented the same as public methods and that
649
+ # protected and private members shall be indented one step more than the
650
+ # modifiers. Other than that, both styles mean that entities on the same
651
+ # logical depth shall have the same indentation.
652
+ EnforcedStyle: normal
653
+ SupportedStyles:
654
+ - normal
655
+ - rails
656
+
657
+ Style/IndentationWidth:
658
+ # Number of spaces for each indentation level.
659
+ Width: 2
660
+ IgnoredPatterns: []
661
+
662
+ # Checks the indentation of the first element in an array literal.
663
+ Style/IndentArray:
664
+ # The value `special_inside_parentheses` means that array literals with
665
+ # brackets that have their opening bracket on the same line as a surrounding
666
+ # opening round parenthesis, shall have their first element indented relative
667
+ # to the first position inside the parenthesis.
668
+ #
669
+ # The value `consistent` means that the indentation of the first element shall
670
+ # always be relative to the first position of the line where the opening
671
+ # bracket is.
672
+ #
673
+ # The value `align_brackets` means that the indentation of the first element
674
+ # shall always be relative to the position of the opening bracket.
675
+ EnforcedStyle: special_inside_parentheses
676
+ SupportedStyles:
677
+ - special_inside_parentheses
678
+ - consistent
679
+ - align_brackets
680
+ # By default, the indentation width from `Style/IndentationWidth` is used
681
+ # But it can be overridden by setting this parameter
682
+ IndentationWidth: ~
683
+
684
+ # Checks the indentation of assignment RHS, when on a different line from LHS
685
+ Style/IndentAssignment:
686
+ # By default, the indentation width from `Style/IndentationWidth` is used
687
+ # But it can be overridden by setting this parameter
688
+ IndentationWidth: ~
689
+
690
+ # Checks the indentation of the first key in a hash literal.
691
+ Style/IndentHash:
692
+ # The value `special_inside_parentheses` means that hash literals with braces
693
+ # that have their opening brace on the same line as a surrounding opening
694
+ # round parenthesis, shall have their first key indented relative to the
695
+ # first position inside the parenthesis.
696
+ #
697
+ # The value `consistent` means that the indentation of the first key shall
698
+ # always be relative to the first position of the line where the opening
699
+ # brace is.
700
+ #
701
+ # The value `align_braces` means that the indentation of the first key shall
702
+ # always be relative to the position of the opening brace.
703
+ EnforcedStyle: special_inside_parentheses
704
+ SupportedStyles:
705
+ - special_inside_parentheses
706
+ - consistent
707
+ - align_braces
708
+ # By default, the indentation width from `Style/IndentationWidth` is used
709
+ # But it can be overridden by setting this parameter
710
+ IndentationWidth: ~
711
+
712
+ Style/IndentHeredoc:
713
+ EnforcedStyle: auto_detection
714
+ SupportedStyles:
715
+ - auto_detection
716
+ - squiggly
717
+ - active_support
718
+ - powerpack
719
+ - unindent
720
+
721
+ Style/InverseMethods:
722
+ Enabled: true
723
+ # `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
724
+ # The relationship of inverse methods only needs to be defined in one direction.
725
+ # Keys and values both need to be defined as symbols.
726
+ InverseMethods:
727
+ :any?: :none?
728
+ :even?: :odd?
729
+ :==: :!=
730
+ :=~: :!~
731
+ :<: :>=
732
+ :>: :<=
733
+ # `ActiveSupport` defines some common inverse methods. They are listed below,
734
+ # and not enabled by default.
735
+ #:present?: :blank?,
736
+ #:include?: :exclude?
737
+ # `InverseBlocks` are methods that are inverted by inverting the return
738
+ # of the block that is passed to the method
739
+ InverseBlocks:
740
+ :select: :reject
741
+ :select!: :reject!
742
+
743
+ Style/Lambda:
744
+ EnforcedStyle: line_count_dependent
745
+ SupportedStyles:
746
+ - line_count_dependent
747
+ - lambda
748
+ - literal
749
+
750
+ Style/SpaceInLambdaLiteral:
751
+ EnforcedStyle: require_no_space
752
+ SupportedStyles:
753
+ - require_no_space
754
+ - require_space
755
+
756
+ Style/LambdaCall:
757
+ EnforcedStyle: call
758
+ SupportedStyles:
759
+ - call
760
+ - braces
761
+
762
+ Style/MethodCallWithArgsParentheses:
763
+ IgnoreMacros: true
764
+ IgnoredMethods: []
765
+
766
+ Style/MethodDefParentheses:
767
+ EnforcedStyle: require_parentheses
768
+ SupportedStyles:
769
+ - require_parentheses
770
+ - require_no_parentheses
771
+ - require_no_parentheses_except_multiline
772
+
773
+ Style/MethodName:
774
+ EnforcedStyle: snake_case
775
+ SupportedStyles:
776
+ - snake_case
777
+ - camelCase
778
+
779
+ # Checks the grouping of mixins (`include`, `extend`, `prepend`) in `class` and
780
+ # `module` bodies.
781
+ Style/MixinGrouping:
782
+ EnforcedStyle: separated
783
+ SupportedStyles:
784
+ # separated: each mixed in module goes in a separate statement.
785
+ # grouped: mixed in modules are grouped into a single statement.
786
+ - separated
787
+ - grouped
788
+
789
+ Style/ModuleFunction:
790
+ EnforcedStyle: module_function
791
+ SupportedStyles:
792
+ - module_function
793
+ - extend_self
794
+
795
+ Style/MultilineArrayBraceLayout:
796
+ EnforcedStyle: symmetrical
797
+ SupportedStyles:
798
+ # symmetrical: closing brace is positioned in same way as opening brace
799
+ # new_line: closing brace is always on a new line
800
+ # same_line: closing brace is always on the same line as last element
801
+ - symmetrical
802
+ - new_line
803
+ - same_line
804
+
805
+ Style/MultilineAssignmentLayout:
806
+ # The types of assignments which are subject to this rule.
807
+ SupportedTypes:
808
+ - block
809
+ - case
810
+ - class
811
+ - if
812
+ - kwbegin
813
+ - module
814
+ EnforcedStyle: new_line
815
+ SupportedStyles:
816
+ # Ensures that the assignment operator and the rhs are on the same line for
817
+ # the set of supported types.
818
+ - same_line
819
+ # Ensures that the assignment operator and the rhs are on separate lines
820
+ # for the set of supported types.
821
+ - new_line
822
+
823
+ Style/MultilineHashBraceLayout:
824
+ EnforcedStyle: symmetrical
825
+ SupportedStyles:
826
+ # symmetrical: closing brace is positioned in same way as opening brace
827
+ # new_line: closing brace is always on a new line
828
+ # same_line: closing brace is always on same line as last element
829
+ - symmetrical
830
+ - new_line
831
+ - same_line
832
+
833
+ Style/MultilineMemoization:
834
+ EnforcedStyle: keyword
835
+ SupportedStyles:
836
+ - keyword
837
+ - braces
838
+
839
+ Style/MultilineMethodCallBraceLayout:
840
+ EnforcedStyle: symmetrical
841
+ SupportedStyles:
842
+ # symmetrical: closing brace is positioned in same way as opening brace
843
+ # new_line: closing brace is always on a new line
844
+ # same_line: closing brace is always on the same line as last argument
845
+ - symmetrical
846
+ - new_line
847
+ - same_line
848
+
849
+ Style/MultilineMethodCallIndentation:
850
+ EnforcedStyle: aligned
851
+ SupportedStyles:
852
+ - aligned
853
+ - indented
854
+ - indented_relative_to_receiver
855
+ # By default, the indentation width from Style/IndentationWidth is used
856
+ # But it can be overridden by setting this parameter
857
+ IndentationWidth: ~
858
+
859
+ Style/MultilineMethodDefinitionBraceLayout:
860
+ EnforcedStyle: symmetrical
861
+ SupportedStyles:
862
+ # symmetrical: closing brace is positioned in same way as opening brace
863
+ # new_line: closing brace is always on a new line
864
+ # same_line: closing brace is always on the same line as last parameter
865
+ - symmetrical
866
+ - new_line
867
+ - same_line
868
+
869
+ Style/MultilineOperationIndentation:
870
+ EnforcedStyle: aligned
871
+ SupportedStyles:
872
+ - aligned
873
+ - indented
874
+ # By default, the indentation width from `Style/IndentationWidth` is used
875
+ # But it can be overridden by setting this parameter
876
+ IndentationWidth: ~
877
+
878
+ Style/NegatedIf:
879
+ EnforcedStyle: both
880
+ SupportedStyles:
881
+ # both: prefix and postfix negated `if` should both use `unless`
882
+ # prefix: only use `unless` for negated `if` statements positioned before the body of the statement
883
+ # postfix: only use `unless` for negated `if` statements positioned after the body of the statement
884
+ - both
885
+ - prefix
886
+ - postfix
887
+
888
+ Style/Next:
889
+ # With `always` all conditions at the end of an iteration needs to be
890
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
891
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
892
+ EnforcedStyle: skip_modifier_ifs
893
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
894
+ # needs to have to trigger this cop
895
+ MinBodyLength: 3
896
+ SupportedStyles:
897
+ - skip_modifier_ifs
898
+ - always
899
+
900
+ Style/NonNilCheck:
901
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
902
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
903
+ # **usually** OK, but might change behavior.
904
+ #
905
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
906
+ # offenses for `!x.nil?` and does no changes that might change behavior.
907
+ IncludeSemanticChanges: false
908
+
909
+ Style/NumericLiterals:
910
+ MinDigits: 5
911
+ Strict: false
912
+
913
+ Style/NumericLiteralPrefix:
914
+ EnforcedOctalStyle: zero_with_o
915
+ SupportedOctalStyles:
916
+ - zero_with_o
917
+ - zero_only
918
+
919
+ Style/NumericPredicate:
920
+ EnforcedStyle: predicate
921
+ SupportedStyles:
922
+ - predicate
923
+ - comparison
924
+ # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
925
+ # false positives.
926
+ Exclude:
927
+ - 'spec/**/*'
928
+
929
+ Style/OptionHash:
930
+ # A list of parameter names that will be flagged by this cop.
931
+ SuspiciousParamNames:
932
+ - options
933
+ - opts
934
+ - args
935
+ - params
936
+ - parameters
937
+
938
+ # Allow safe assignment in conditions.
939
+ Style/ParenthesesAroundCondition:
940
+ AllowSafeAssignment: true
941
+
942
+ Style/PercentLiteralDelimiters:
943
+ # Specify the default preferred delimiter for all types with the 'default' key
944
+ # Override individual delimiters (even with default specified) by specifying
945
+ # an individual key
946
+ PreferredDelimiters:
947
+ default: ()
948
+ '%i': '[]'
949
+ '%I': '[]'
950
+ '%r': '{}'
951
+ '%w': '[]'
952
+ '%W': '[]'
953
+
954
+ Style/PercentQLiterals:
955
+ EnforcedStyle: lower_case_q
956
+ SupportedStyles:
957
+ - lower_case_q # Use `%q` when possible, `%Q` when necessary
958
+ - upper_case_q # Always use `%Q`
959
+
960
+ Style/PredicateName:
961
+ # Predicate name prefixes.
962
+ NamePrefix:
963
+ - is_
964
+ - has_
965
+ - have_
966
+ # Predicate name prefixes that should be removed.
967
+ NamePrefixBlacklist:
968
+ - is_
969
+ - has_
970
+ - have_
971
+ # Predicate names which, despite having a blacklisted prefix, or no `?`,
972
+ # should still be accepted
973
+ NameWhitelist:
974
+ - is_a?
975
+ # Exclude Rspec specs because there is a strong convetion to write spec
976
+ # helpers in the form of `have_something` or `be_something`.
977
+ Exclude:
978
+ - 'spec/**/*'
979
+
980
+ Style/PreferredHashMethods:
981
+ EnforcedStyle: short
982
+ SupportedStyles:
983
+ - short
984
+ - verbose
985
+
986
+ Style/RaiseArgs:
987
+ EnforcedStyle: exploded
988
+ SupportedStyles:
989
+ - compact # raise Exception.new(msg)
990
+ - exploded # raise Exception, msg
991
+
992
+ Style/RedundantReturn:
993
+ # When `true` allows code like `return x, y`.
994
+ AllowMultipleReturnValues: false
995
+
996
+ # Use `/` or `%r` around regular expressions.
997
+ Style/RegexpLiteral:
998
+ EnforcedStyle: slashes
999
+ # slashes: Always use slashes.
1000
+ # percent_r: Always use `%r`.
1001
+ # mixed: Use slashes on single-line regexes, and `%r` on multi-line regexes.
1002
+ SupportedStyles:
1003
+ - slashes
1004
+ - percent_r
1005
+ - mixed
1006
+ # If `false`, the cop will always recommend using `%r` if one or more slashes
1007
+ # are found in the regexp string.
1008
+ AllowInnerSlashes: false
1009
+
1010
+ Style/SafeNavigation:
1011
+ # Safe navigation may cause a statement to start returning `nil` in addition
1012
+ # to whatever it used to return.
1013
+ ConvertCodeThatCanStartToReturnNil: false
1014
+
1015
+ Style/Semicolon:
1016
+ # Allow `;` to separate several expressions on the same line.
1017
+ AllowAsExpressionSeparator: false
1018
+
1019
+ Style/SignalException:
1020
+ EnforcedStyle: only_raise
1021
+ SupportedStyles:
1022
+ - only_raise
1023
+ - only_fail
1024
+ - semantic
1025
+
1026
+ Style/SingleLineBlockParams:
1027
+ Methods:
1028
+ - reduce:
1029
+ - acc
1030
+ - elem
1031
+ - inject:
1032
+ - acc
1033
+ - elem
1034
+
1035
+ Style/SingleLineMethods:
1036
+ AllowIfMethodIsEmpty: true
1037
+
1038
+ Style/SpaceAroundBlockParameters:
1039
+ EnforcedStyleInsidePipes: no_space
1040
+ SupportedStylesInsidePipes:
1041
+ - space
1042
+ - no_space
1043
+
1044
+ Style/SpaceAroundEqualsInParameterDefault:
1045
+ EnforcedStyle: space
1046
+ SupportedStyles:
1047
+ - space
1048
+ - no_space
1049
+
1050
+ Style/SpaceAroundOperators:
1051
+ # When `true`, allows most uses of extra spacing if the intent is to align
1052
+ # with an operator on the previous or next line, not counting empty lines
1053
+ # or comment lines.
1054
+ AllowForAlignment: true
1055
+
1056
+ Style/SpaceBeforeBlockBraces:
1057
+ EnforcedStyle: space
1058
+ SupportedStyles:
1059
+ - space
1060
+ - no_space
1061
+
1062
+ Style/SpaceBeforeFirstArg:
1063
+ # When `true`, allows most uses of extra spacing if the intent is to align
1064
+ # things with the previous or next line, not counting empty lines or comment
1065
+ # lines.
1066
+ AllowForAlignment: true
1067
+
1068
+ Style/SpaceInsideBlockBraces:
1069
+ EnforcedStyle: space
1070
+ SupportedStyles:
1071
+ - space
1072
+ - no_space
1073
+ EnforcedStyleForEmptyBraces: no_space
1074
+ SupportedStylesForEmptyBraces:
1075
+ - space
1076
+ - no_space
1077
+ # Space between `{` and `|`. Overrides `EnforcedStyle` if there is a conflict.
1078
+ SpaceBeforeBlockParameters: true
1079
+
1080
+ Style/SpaceInsideHashLiteralBraces:
1081
+ EnforcedStyle: space
1082
+ SupportedStyles:
1083
+ - space
1084
+ - no_space
1085
+ # 'compact' normally requires a space inside hash braces, with the exception
1086
+ # that successive left braces or right braces are collapsed together
1087
+ - compact
1088
+ EnforcedStyleForEmptyBraces: no_space
1089
+ SupportedStylesForEmptyBraces:
1090
+ - space
1091
+ - no_space
1092
+
1093
+ Style/SpaceInsideStringInterpolation:
1094
+ EnforcedStyle: no_space
1095
+ SupportedStyles:
1096
+ - space
1097
+ - no_space
1098
+
1099
+ Style/SpecialGlobalVars:
1100
+ EnforcedStyle: use_english_names
1101
+ SupportedStyles:
1102
+ - use_perl_names
1103
+ - use_english_names
1104
+
1105
+ Style/StabbyLambdaParentheses:
1106
+ EnforcedStyle: require_parentheses
1107
+ SupportedStyles:
1108
+ - require_parentheses
1109
+ - require_no_parentheses
1110
+
1111
+ Style/StringLiterals:
1112
+ EnforcedStyle: single_quotes
1113
+ SupportedStyles:
1114
+ - single_quotes
1115
+ - double_quotes
1116
+ # If `true`, strings which span multiple lines using `\` for continuation must
1117
+ # use the same type of quotes on each line.
1118
+ ConsistentQuotesInMultiline: false
1119
+
1120
+ Style/StringLiteralsInInterpolation:
1121
+ EnforcedStyle: single_quotes
1122
+ SupportedStyles:
1123
+ - single_quotes
1124
+ - double_quotes
1125
+
1126
+ Style/StringMethods:
1127
+ # Mapping from undesired method to desired_method
1128
+ # e.g. to use `to_sym` over `intern`:
1129
+ #
1130
+ # StringMethods:
1131
+ # PreferredMethods:
1132
+ # intern: to_sym
1133
+ PreferredMethods:
1134
+ intern: to_sym
1135
+
1136
+ Style/SymbolArray:
1137
+ EnforcedStyle: percent
1138
+ SupportedStyles:
1139
+ - percent
1140
+ - brackets
1141
+
1142
+ Style/SymbolProc:
1143
+ # A list of method names to be ignored by the check.
1144
+ # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
1145
+ IgnoredMethods:
1146
+ - respond_to
1147
+ - define_method
1148
+
1149
+ Style/TernaryParentheses:
1150
+ EnforcedStyle: require_no_parentheses
1151
+ SupportedStyles:
1152
+ - require_parentheses
1153
+ - require_no_parentheses
1154
+ - require_parentheses_when_complex
1155
+ AllowSafeAssignment: true
1156
+
1157
+ Style/TrailingBlankLines:
1158
+ EnforcedStyle: final_newline
1159
+ SupportedStyles:
1160
+ - final_newline
1161
+ - final_blank_line
1162
+
1163
+ Style/TrailingCommaInArguments:
1164
+ # If `comma`, the cop requires a comma after the last argument, but only for
1165
+ # parenthesized method calls where each argument is on its own line.
1166
+ # If `consistent_comma`, the cop requires a comma after the last argument,
1167
+ # for all parenthesized method calls with arguments.
1168
+ EnforcedStyleForMultiline: no_comma
1169
+ SupportedStylesForMultiline:
1170
+ - comma
1171
+ - consistent_comma
1172
+ - no_comma
1173
+
1174
+ Style/TrailingCommaInLiteral:
1175
+ # If `comma`, the cop requires a comma after the last item in an array or
1176
+ # hash, but only when each item is on its own line.
1177
+ # If `consistent_comma`, the cop requires a comma after the last item of all
1178
+ # non-empty array and hash literals.
1179
+ EnforcedStyleForMultiline: no_comma
1180
+ SupportedStylesForMultiline:
1181
+ - comma
1182
+ - consistent_comma
1183
+ - no_comma
1184
+
1185
+ # `TrivialAccessors` requires exact name matches and doesn't allow
1186
+ # predicated methods by default.
1187
+ Style/TrivialAccessors:
1188
+ # When set to `false` the cop will suggest the use of accessor methods
1189
+ # in situations like:
1190
+ #
1191
+ # def name
1192
+ # @other_name
1193
+ # end
1194
+ #
1195
+ # This way you can uncover "hidden" attributes in your code.
1196
+ ExactNameMatch: true
1197
+ AllowPredicates: true
1198
+ # Allows trivial writers that don't end in an equal sign. e.g.
1199
+ #
1200
+ # def on_exception(action)
1201
+ # @on_exception=action
1202
+ # end
1203
+ # on_exception :restart
1204
+ #
1205
+ # Commonly used in DSLs
1206
+ AllowDSLWriters: false
1207
+ IgnoreClassMethods: false
1208
+ Whitelist:
1209
+ - to_ary
1210
+ - to_a
1211
+ - to_c
1212
+ - to_enum
1213
+ - to_h
1214
+ - to_hash
1215
+ - to_i
1216
+ - to_int
1217
+ - to_io
1218
+ - to_open
1219
+ - to_path
1220
+ - to_proc
1221
+ - to_r
1222
+ - to_regexp
1223
+ - to_str
1224
+ - to_s
1225
+ - to_sym
1226
+
1227
+ Style/VariableName:
1228
+ EnforcedStyle: snake_case
1229
+ SupportedStyles:
1230
+ - snake_case
1231
+ - camelCase
1232
+
1233
+ Style/VariableNumber:
1234
+ EnforcedStyle: normalcase
1235
+ SupportedStyles:
1236
+ - snake_case
1237
+ - normalcase
1238
+ - non_integer
1239
+
1240
+ Style/WhileUntilModifier:
1241
+ MaxLineLength: 80
1242
+
1243
+ # `WordArray` enforces how array literals of word-like strings should be expressed.
1244
+ Style/WordArray:
1245
+ EnforcedStyle: percent
1246
+ SupportedStyles:
1247
+ # percent style: %w(word1 word2)
1248
+ - percent
1249
+ # bracket style: ['word1', 'word2']
1250
+ - brackets
1251
+ # The `MinSize` option causes the `WordArray` rule to be ignored for arrays
1252
+ # smaller than a certain size. The rule is only applied to arrays
1253
+ # whose element count is greater than or equal to `MinSize`.
1254
+ MinSize: 0
1255
+ # The regular expression `WordRegex` decides what is considered a word.
1256
+ WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
1257
+
1258
+ #################### Metrics ###############################
1259
+
1260
+ Metrics/AbcSize:
1261
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
1262
+ # a Float.
1263
+ Max: 35
1264
+
1265
+ Metrics/BlockLength:
1266
+ CountComments: false # count full line comments?
1267
+ Max: 40
1268
+ ExcludedMethods: []
1269
+
1270
+ Metrics/BlockNesting:
1271
+ CountBlocks: false
1272
+ Max: 3
1273
+
1274
+ Metrics/ClassLength:
1275
+ CountComments: false # count full line comments?
1276
+ Max: 120
1277
+
1278
+ # Avoid complex methods.
1279
+ Metrics/CyclomaticComplexity:
1280
+ Max: 6
1281
+
1282
+ Metrics/LineLength:
1283
+ Max: 120
1284
+ # To make it possible to copy or click on URIs in the code, we allow lines
1285
+ # containing a URI to be longer than Max.
1286
+ AllowHeredoc: true
1287
+ AllowURI: true
1288
+ URISchemes:
1289
+ - http
1290
+ - https
1291
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
1292
+ # directives like '# rubocop: enable ...' when calculating a line's length.
1293
+ IgnoreCopDirectives: false
1294
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
1295
+ # elements. Strings will be converted to Regexp objects. A line that matches
1296
+ # any regular expression listed in this option will be ignored by LineLength.
1297
+ IgnoredPatterns: []
1298
+
1299
+ Metrics/MethodLength:
1300
+ CountComments: false # count full line comments?
1301
+ Max: 20
1302
+
1303
+ Metrics/ModuleLength:
1304
+ CountComments: false # count full line comments?
1305
+ Max: 100
1306
+
1307
+ Metrics/ParameterLists:
1308
+ Max: 5
1309
+ CountKeywordArgs: true
1310
+
1311
+ Metrics/PerceivedComplexity:
1312
+ Max: 7
1313
+
1314
+ #################### Lint ##################################
1315
+
1316
+ # Allow safe assignment in conditions.
1317
+ Lint/AssignmentInCondition:
1318
+ AllowSafeAssignment: true
1319
+
1320
+ # checks whether the end keywords are aligned properly for `do` `end` blocks.
1321
+ Lint/BlockAlignment:
1322
+ # The value `start_of_block` means that the `end` should be aligned with line
1323
+ # where the `do` keyword appears.
1324
+ # The value `start_of_line` means it should be aligned with the whole
1325
+ # expression's starting line.
1326
+ # The value `either` means both are allowed.
1327
+ EnforcedStyleAlignWith: either
1328
+ SupportedStylesAlignWith:
1329
+ - either
1330
+ - start_of_block
1331
+ - start_of_line
1332
+
1333
+ Lint/DefEndAlignment:
1334
+ # The value `def` means that `end` should be aligned with the def keyword.
1335
+ # The value `start_of_line` means that `end` should be aligned with method
1336
+ # calls like `private`, `public`, etc, if present in front of the `def`
1337
+ # keyword on the same line.
1338
+ EnforcedStyleAlignWith: start_of_line
1339
+ SupportedStylesAlignWith:
1340
+ - start_of_line
1341
+ - def
1342
+ AutoCorrect: false
1343
+
1344
+ # Align ends correctly.
1345
+ Lint/EndAlignment:
1346
+ # The value `keyword` means that `end` should be aligned with the matching
1347
+ # keyword (`if`, `while`, etc.).
1348
+ # The value `variable` means that in assignments, `end` should be aligned
1349
+ # with the start of the variable on the left hand side of `=`. In all other
1350
+ # situations, `end` should still be aligned with the keyword.
1351
+ # The value `start_of_line` means that `end` should be aligned with the start
1352
+ # of the line which the matching keyword appears on.
1353
+ EnforcedStyleAlignWith: keyword
1354
+ SupportedStylesAlignWith:
1355
+ - keyword
1356
+ - variable
1357
+ - start_of_line
1358
+ AutoCorrect: false
1359
+
1360
+ Lint/InheritException:
1361
+ # The default base class in favour of `Exception`.
1362
+ EnforcedStyle: runtime_error
1363
+ SupportedStyles:
1364
+ - runtime_error
1365
+ - standard_error
1366
+
1367
+ Lint/SafeNavigationChain:
1368
+ Whitelist:
1369
+ - present?
1370
+ - blank?
1371
+ - presence
1372
+ - try
1373
+
1374
+ # Checks for unused block arguments
1375
+ Lint/UnusedBlockArgument:
1376
+ IgnoreEmptyBlocks: true
1377
+ AllowUnusedKeywordArguments: false
1378
+
1379
+ # Checks for unused method arguments.
1380
+ Lint/UnusedMethodArgument:
1381
+ AllowUnusedKeywordArguments: true
1382
+ IgnoreEmptyMethods: true
1383
+
1384
+ #################### Performance ###########################
1385
+
1386
+ Performance/DoubleStartEndWith:
1387
+ # Used to check for `starts_with?` and `ends_with?`.
1388
+ # These methods are defined by `ActiveSupport`.
1389
+ IncludeActiveSupportAliases: false
1390
+
1391
+ Performance/RedundantMerge:
1392
+ # Max number of key-value pairs to consider an offense
1393
+ MaxKeyValuePairs: 2
1394
+
1395
+ Bundler/OrderedGems:
1396
+ TreatCommentsAsGroupSeparators: true
1397
+
1398
+ Documentation:
1399
+ Enabled: false