graphql-pundit 0.1.0

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