strict_machine-rails 0.1.2

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