generators_rails 0.0.1

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