cookstyle 2.1.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +30 -0
- data/README.md +6 -4
- data/config/cookstyle.yml +92 -5
- data/config/cookstyle_base.yml +18 -22
- data/config/disable_all.yml +166 -32
- data/config/disabled.yml +24 -15
- data/config/enabled.yml +1223 -908
- data/config/upstream.yml +404 -168
- data/lib/cookstyle/version.rb +2 -2
- metadata +5 -5
data/config/upstream.yml
CHANGED
@@ -9,8 +9,11 @@ inherit_from:
|
|
9
9
|
AllCops:
|
10
10
|
# Include common Ruby source files.
|
11
11
|
Include:
|
12
|
+
- '**/*.arb'
|
13
|
+
- '**/*.axlsx'
|
12
14
|
- '**/*.builder'
|
13
15
|
- '**/*.fcgi'
|
16
|
+
- '**/*.gemfile'
|
14
17
|
- '**/*.gemspec'
|
15
18
|
- '**/*.god'
|
16
19
|
- '**/*.jb'
|
@@ -55,13 +58,15 @@ AllCops:
|
|
55
58
|
- '**/Vagabondfile'
|
56
59
|
- '**/Vagrantfile'
|
57
60
|
Exclude:
|
61
|
+
- 'node_modules/**/*'
|
58
62
|
- 'vendor/**/*'
|
63
|
+
- '.git/**/*'
|
59
64
|
# Default formatter will be used if no `-f/--format` option is given.
|
60
65
|
DefaultFormatter: progress
|
61
|
-
# Cop names are
|
62
|
-
# by overriding DisplayCopNames, or by giving the
|
66
|
+
# Cop names are displayed in offense messages by default. Change behavior
|
67
|
+
# by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
|
63
68
|
# option.
|
64
|
-
DisplayCopNames:
|
69
|
+
DisplayCopNames: true
|
65
70
|
# Style guide URLs are not displayed in offense messages by default. Change
|
66
71
|
# behavior by overriding `DisplayStyleGuide`, or by giving the
|
67
72
|
# `-S/--display-style-guide` option.
|
@@ -110,11 +115,24 @@ AllCops:
|
|
110
115
|
AllowSymlinksInCacheRootDirectory: false
|
111
116
|
# What MRI version of the Ruby interpreter is the inspected code intended to
|
112
117
|
# run on? (If there is more than one, set this to the lowest version.)
|
113
|
-
# If a value is specified for TargetRubyVersion then it is used.
|
114
|
-
#
|
115
|
-
#
|
118
|
+
# If a value is specified for TargetRubyVersion then it is used. Acceptable
|
119
|
+
# values are specificed as a float (i.e. 2.5); the teeny version of Ruby
|
120
|
+
# should not be included. If the project specifies a Ruby version in the
|
121
|
+
# .ruby-version file, Gemfile or gems.rb file, RuboCop will try to determine
|
122
|
+
# the desired version of Ruby by inspecting the .ruby-version file first,
|
123
|
+
# followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
|
124
|
+
# is specified in the Gemfile or gems.rb file, RuboCop reads the final value
|
125
|
+
# from the lock file.) If the Ruby version is still unresolved, RuboCop will
|
126
|
+
# use the oldest officially supported Ruby version (currently Ruby 2.1).
|
116
127
|
TargetRubyVersion: ~
|
117
|
-
|
128
|
+
# What version of Rails is the inspected code using? If a value is specified
|
129
|
+
# for TargetRailsVersion then it is used. Acceptable values are specificed
|
130
|
+
# as a float (i.e. 5.1); the patch version of Rails should not be included.
|
131
|
+
# If TargetRailsVersion is not set, RuboCop will parse the Gemfile.lock or
|
132
|
+
# gems.locked file to find the version of Rails that has been bound to the
|
133
|
+
# application. If neither of those files exist, RuboCop will use Rails 5.0
|
134
|
+
# as the default.
|
135
|
+
TargetRailsVersion: ~
|
118
136
|
|
119
137
|
#################### Layout ###########################
|
120
138
|
|
@@ -222,6 +240,19 @@ Layout/AlignParameters:
|
|
222
240
|
# But it can be overridden by setting this parameter
|
223
241
|
IndentationWidth: ~
|
224
242
|
|
243
|
+
# checks whether the end keywords are aligned properly for `do` `end` blocks.
|
244
|
+
Layout/BlockAlignment:
|
245
|
+
# The value `start_of_block` means that the `end` should be aligned with line
|
246
|
+
# where the `do` keyword appears.
|
247
|
+
# The value `start_of_line` means it should be aligned with the whole
|
248
|
+
# expression's starting line.
|
249
|
+
# The value `either` means both are allowed.
|
250
|
+
EnforcedStyleAlignWith: either
|
251
|
+
SupportedStylesAlignWith:
|
252
|
+
- either
|
253
|
+
- start_of_block
|
254
|
+
- start_of_line
|
255
|
+
|
225
256
|
# Indentation of `when`.
|
226
257
|
Layout/CaseIndentation:
|
227
258
|
EnforcedStyle: case
|
@@ -234,6 +265,18 @@ Layout/CaseIndentation:
|
|
234
265
|
# This only matters if `IndentOneStep` is `true`
|
235
266
|
IndentationWidth: ~
|
236
267
|
|
268
|
+
Layout/DefEndAlignment:
|
269
|
+
# The value `def` means that `end` should be aligned with the def keyword.
|
270
|
+
# The value `start_of_line` means that `end` should be aligned with method
|
271
|
+
# calls like `private`, `public`, etc, if present in front of the `def`
|
272
|
+
# keyword on the same line.
|
273
|
+
EnforcedStyleAlignWith: start_of_line
|
274
|
+
SupportedStylesAlignWith:
|
275
|
+
- start_of_line
|
276
|
+
- def
|
277
|
+
AutoCorrect: false
|
278
|
+
Severity: warning
|
279
|
+
|
237
280
|
# Multi-line method chaining should be done with leading dots.
|
238
281
|
Layout/DotPosition:
|
239
282
|
EnforcedStyle: leading
|
@@ -241,6 +284,10 @@ Layout/DotPosition:
|
|
241
284
|
- leading
|
242
285
|
- trailing
|
243
286
|
|
287
|
+
Layout/EmptyComment:
|
288
|
+
AllowBorderComment: true
|
289
|
+
AllowMarginComment: true
|
290
|
+
|
244
291
|
# Use empty lines between defs.
|
245
292
|
Layout/EmptyLineBetweenDefs:
|
246
293
|
# If `true`, this parameter means that single line method definitions don't
|
@@ -262,6 +309,8 @@ Layout/EmptyLinesAroundClassBody:
|
|
262
309
|
- empty_lines_except_namespace
|
263
310
|
- empty_lines_special
|
264
311
|
- no_empty_lines
|
312
|
+
- beginning_only
|
313
|
+
- ending_only
|
265
314
|
|
266
315
|
Layout/EmptyLinesAroundModuleBody:
|
267
316
|
EnforcedStyle: no_empty_lines
|
@@ -271,6 +320,23 @@ Layout/EmptyLinesAroundModuleBody:
|
|
271
320
|
- empty_lines_special
|
272
321
|
- no_empty_lines
|
273
322
|
|
323
|
+
# Align ends correctly.
|
324
|
+
Layout/EndAlignment:
|
325
|
+
# The value `keyword` means that `end` should be aligned with the matching
|
326
|
+
# keyword (`if`, `while`, etc.).
|
327
|
+
# The value `variable` means that in assignments, `end` should be aligned
|
328
|
+
# with the start of the variable on the left hand side of `=`. In all other
|
329
|
+
# situations, `end` should still be aligned with the keyword.
|
330
|
+
# The value `start_of_line` means that `end` should be aligned with the start
|
331
|
+
# of the line which the matching keyword appears on.
|
332
|
+
EnforcedStyleAlignWith: keyword
|
333
|
+
SupportedStylesAlignWith:
|
334
|
+
- keyword
|
335
|
+
- variable
|
336
|
+
- start_of_line
|
337
|
+
AutoCorrect: false
|
338
|
+
Severity: warning
|
339
|
+
|
274
340
|
Layout/EndOfLine:
|
275
341
|
# The `native` style means that CR+LF (Carriage Return + Line Feed) is
|
276
342
|
# enforced on Windows, and LF is enforced on other platforms. The other styles
|
@@ -489,6 +555,10 @@ Layout/SpaceBeforeBlockBraces:
|
|
489
555
|
SupportedStyles:
|
490
556
|
- space
|
491
557
|
- no_space
|
558
|
+
EnforcedStyleForEmptyBraces: space
|
559
|
+
SupportedStylesForEmptyBraces:
|
560
|
+
- space
|
561
|
+
- no_space
|
492
562
|
|
493
563
|
Layout/SpaceBeforeFirstArg:
|
494
564
|
# When `true`, allows most uses of extra spacing if the intent is to align
|
@@ -496,6 +566,19 @@ Layout/SpaceBeforeFirstArg:
|
|
496
566
|
# lines.
|
497
567
|
AllowForAlignment: true
|
498
568
|
|
569
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
570
|
+
EnforcedStyle: no_space
|
571
|
+
SupportedStyles:
|
572
|
+
- space
|
573
|
+
- no_space
|
574
|
+
# 'compact' normally requires a space inside the brackets, with the exception
|
575
|
+
# that successive left brackets or right brackets are collapsed together
|
576
|
+
- compact
|
577
|
+
EnforcedStyleForEmptyBrackets: no_space
|
578
|
+
SupportedStylesForEmptyBrackets:
|
579
|
+
- space
|
580
|
+
- no_space
|
581
|
+
|
499
582
|
Layout/SpaceInsideBlockBraces:
|
500
583
|
EnforcedStyle: space
|
501
584
|
SupportedStyles:
|
@@ -521,18 +604,199 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
521
604
|
- space
|
522
605
|
- no_space
|
523
606
|
|
607
|
+
Layout/SpaceInsideParens:
|
608
|
+
EnforcedStyle: no_space
|
609
|
+
SupportedStyles:
|
610
|
+
- space
|
611
|
+
- no_space
|
612
|
+
|
613
|
+
Layout/SpaceInsideReferenceBrackets:
|
614
|
+
EnforcedStyle: no_space
|
615
|
+
SupportedStyles:
|
616
|
+
- space
|
617
|
+
- no_space
|
618
|
+
EnforcedStyleForEmptyBrackets: no_space
|
619
|
+
SupportedStylesForEmptyBrackets:
|
620
|
+
- space
|
621
|
+
- no_space
|
622
|
+
|
524
623
|
Layout/SpaceInsideStringInterpolation:
|
525
624
|
EnforcedStyle: no_space
|
526
625
|
SupportedStyles:
|
527
626
|
- space
|
528
627
|
- no_space
|
529
628
|
|
629
|
+
Layout/ClassStructure:
|
630
|
+
Categories:
|
631
|
+
module_inclusion:
|
632
|
+
- include
|
633
|
+
- prepend
|
634
|
+
- extend
|
635
|
+
ExpectedOrder:
|
636
|
+
- module_inclusion
|
637
|
+
- constants
|
638
|
+
- public_class_methods
|
639
|
+
- initializer
|
640
|
+
- public_methods
|
641
|
+
- protected_methods
|
642
|
+
- private_methods
|
643
|
+
|
644
|
+
Layout/Tab:
|
645
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
646
|
+
# But it can be overridden by setting this parameter
|
647
|
+
# It is used during auto-correction to determine how many spaces should
|
648
|
+
# replace each tab.
|
649
|
+
IndentationWidth: ~
|
650
|
+
|
530
651
|
Layout/TrailingBlankLines:
|
531
652
|
EnforcedStyle: final_newline
|
532
653
|
SupportedStyles:
|
533
654
|
- final_newline
|
534
655
|
- final_blank_line
|
535
656
|
|
657
|
+
Layout/TrailingWhitespace:
|
658
|
+
AllowInHeredoc: false
|
659
|
+
|
660
|
+
#################### Naming ##########################
|
661
|
+
|
662
|
+
Naming/FileName:
|
663
|
+
# File names listed in `AllCops:Include` are excluded by default. Add extra
|
664
|
+
# excludes here.
|
665
|
+
Exclude: []
|
666
|
+
# When `true`, requires that each source file should define a class or module
|
667
|
+
# with a name which matches the file name (converted to ... case).
|
668
|
+
# It further expects it to be nested inside modules which match the names
|
669
|
+
# of subdirectories in its path.
|
670
|
+
ExpectMatchingDefinition: false
|
671
|
+
# If non-`nil`, expect all source file names to match the following regex.
|
672
|
+
# Only the file name itself is matched, not the entire file path.
|
673
|
+
# Use anchors as necessary if you want to match the entire name rather than
|
674
|
+
# just a part of it.
|
675
|
+
Regex: ~
|
676
|
+
# With `IgnoreExecutableScripts` set to `true`, this cop does not
|
677
|
+
# report offending filenames for executable scripts (i.e. source
|
678
|
+
# files with a shebang in the first line).
|
679
|
+
IgnoreExecutableScripts: true
|
680
|
+
AllowedAcronyms:
|
681
|
+
- CLI
|
682
|
+
- DSL
|
683
|
+
- ACL
|
684
|
+
- API
|
685
|
+
- ASCII
|
686
|
+
- CPU
|
687
|
+
- CSS
|
688
|
+
- DNS
|
689
|
+
- EOF
|
690
|
+
- GUID
|
691
|
+
- HTML
|
692
|
+
- HTTP
|
693
|
+
- HTTPS
|
694
|
+
- ID
|
695
|
+
- IP
|
696
|
+
- JSON
|
697
|
+
- LHS
|
698
|
+
- QPS
|
699
|
+
- RAM
|
700
|
+
- RHS
|
701
|
+
- RPC
|
702
|
+
- SLA
|
703
|
+
- SMTP
|
704
|
+
- SQL
|
705
|
+
- SSH
|
706
|
+
- TCP
|
707
|
+
- TLS
|
708
|
+
- TTL
|
709
|
+
- UDP
|
710
|
+
- UI
|
711
|
+
- UID
|
712
|
+
- UUID
|
713
|
+
- URI
|
714
|
+
- URL
|
715
|
+
- UTF8
|
716
|
+
- VM
|
717
|
+
- XML
|
718
|
+
- XMPP
|
719
|
+
- XSRF
|
720
|
+
- XSS
|
721
|
+
|
722
|
+
Naming/HeredocDelimiterNaming:
|
723
|
+
Blacklist:
|
724
|
+
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
725
|
+
|
726
|
+
Naming/HeredocDelimiterCase:
|
727
|
+
EnforcedStyle: uppercase
|
728
|
+
SupportedStyles:
|
729
|
+
- lowercase
|
730
|
+
- uppercase
|
731
|
+
|
732
|
+
Naming/MethodName:
|
733
|
+
EnforcedStyle: snake_case
|
734
|
+
SupportedStyles:
|
735
|
+
- snake_case
|
736
|
+
- camelCase
|
737
|
+
|
738
|
+
Naming/PredicateName:
|
739
|
+
# Predicate name prefixes.
|
740
|
+
NamePrefix:
|
741
|
+
- is_
|
742
|
+
- has_
|
743
|
+
- have_
|
744
|
+
# Predicate name prefixes that should be removed.
|
745
|
+
NamePrefixBlacklist:
|
746
|
+
- is_
|
747
|
+
- has_
|
748
|
+
- have_
|
749
|
+
# Predicate names which, despite having a blacklisted prefix, or no `?`,
|
750
|
+
# should still be accepted
|
751
|
+
NameWhitelist:
|
752
|
+
- is_a?
|
753
|
+
# Method definition macros for dynamically generated methods.
|
754
|
+
MethodDefinitionMacros:
|
755
|
+
- define_method
|
756
|
+
- define_singleton_method
|
757
|
+
# Exclude Rspec specs because there is a strong convention to write spec
|
758
|
+
# helpers in the form of `have_something` or `be_something`.
|
759
|
+
Exclude:
|
760
|
+
- 'spec/**/*'
|
761
|
+
|
762
|
+
Naming/UncommunicativeBlockParamName:
|
763
|
+
# Parameter names may be equal to or greater than this value
|
764
|
+
MinNameLength: 1
|
765
|
+
AllowNamesEndingInNumbers: true
|
766
|
+
# Whitelisted names that will not register an offense
|
767
|
+
AllowedNames: []
|
768
|
+
# Blacklisted names that will register an offense
|
769
|
+
ForbiddenNames: []
|
770
|
+
|
771
|
+
Naming/UncommunicativeMethodParamName:
|
772
|
+
# Parameter names may be equal to or greater than this value
|
773
|
+
MinNameLength: 3
|
774
|
+
AllowNamesEndingInNumbers: true
|
775
|
+
# Whitelisted names that will not register an offense
|
776
|
+
AllowedNames:
|
777
|
+
- io
|
778
|
+
- id
|
779
|
+
- to
|
780
|
+
- by
|
781
|
+
- 'on'
|
782
|
+
- in
|
783
|
+
- at
|
784
|
+
# Blacklisted names that will register an offense
|
785
|
+
ForbiddenNames: []
|
786
|
+
|
787
|
+
Naming/VariableName:
|
788
|
+
EnforcedStyle: snake_case
|
789
|
+
SupportedStyles:
|
790
|
+
- snake_case
|
791
|
+
- camelCase
|
792
|
+
|
793
|
+
Naming/VariableNumber:
|
794
|
+
EnforcedStyle: normalcase
|
795
|
+
SupportedStyles:
|
796
|
+
- snake_case
|
797
|
+
- normalcase
|
798
|
+
- non_integer
|
799
|
+
|
536
800
|
#################### Style ###########################
|
537
801
|
|
538
802
|
Style/Alias:
|
@@ -549,6 +813,9 @@ Style/AndOr:
|
|
549
813
|
- always
|
550
814
|
- conditionals
|
551
815
|
|
816
|
+
Style/AsciiComments:
|
817
|
+
AllowedChars: []
|
818
|
+
|
552
819
|
# Checks if usage of `%()` or `%Q()` matches configuration.
|
553
820
|
Style/BarePercentLiterals:
|
554
821
|
EnforcedStyle: bare_percent
|
@@ -762,83 +1029,12 @@ Style/EmptyMethod:
|
|
762
1029
|
- compact
|
763
1030
|
- expanded
|
764
1031
|
|
765
|
-
# Checks whether the source file has a utf-8 encoding comment or not
|
766
|
-
# AutoCorrectEncodingComment must match the regex
|
767
|
-
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
768
|
-
Style/Encoding:
|
769
|
-
EnforcedStyle: never
|
770
|
-
SupportedStyles:
|
771
|
-
- when_needed
|
772
|
-
- always
|
773
|
-
- never
|
774
|
-
AutoCorrectEncodingComment: '# encoding: utf-8'
|
775
|
-
|
776
|
-
Style/FileName:
|
777
|
-
# File names listed in `AllCops:Include` are excluded by default. Add extra
|
778
|
-
# excludes here.
|
779
|
-
Exclude: []
|
780
|
-
# When `true`, requires that each source file should define a class or module
|
781
|
-
# with a name which matches the file name (converted to ... case).
|
782
|
-
# It further expects it to be nested inside modules which match the names
|
783
|
-
# of subdirectories in its path.
|
784
|
-
ExpectMatchingDefinition: false
|
785
|
-
# If non-`nil`, expect all source file names to match the following regex.
|
786
|
-
# Only the file name itself is matched, not the entire file path.
|
787
|
-
# Use anchors as necessary if you want to match the entire name rather than
|
788
|
-
# just a part of it.
|
789
|
-
Regex: ~
|
790
|
-
# With `IgnoreExecutableScripts` set to `true`, this cop does not
|
791
|
-
# report offending filenames for executable scripts (i.e. source
|
792
|
-
# files with a shebang in the first line).
|
793
|
-
IgnoreExecutableScripts: true
|
794
|
-
AllowedAcronyms:
|
795
|
-
- CLI
|
796
|
-
- DSL
|
797
|
-
- ACL
|
798
|
-
- API
|
799
|
-
- ASCII
|
800
|
-
- CPU
|
801
|
-
- CSS
|
802
|
-
- DNS
|
803
|
-
- EOF
|
804
|
-
- GUID
|
805
|
-
- HTML
|
806
|
-
- HTTP
|
807
|
-
- HTTPS
|
808
|
-
- ID
|
809
|
-
- IP
|
810
|
-
- JSON
|
811
|
-
- LHS
|
812
|
-
- QPS
|
813
|
-
- RAM
|
814
|
-
- RHS
|
815
|
-
- RPC
|
816
|
-
- SLA
|
817
|
-
- SMTP
|
818
|
-
- SQL
|
819
|
-
- SSH
|
820
|
-
- TCP
|
821
|
-
- TLS
|
822
|
-
- TTL
|
823
|
-
- UDP
|
824
|
-
- UI
|
825
|
-
- UID
|
826
|
-
- UUID
|
827
|
-
- URI
|
828
|
-
- URL
|
829
|
-
- UTF8
|
830
|
-
- VM
|
831
|
-
- XML
|
832
|
-
- XMPP
|
833
|
-
- XSRF
|
834
|
-
- XSS
|
835
|
-
|
836
1032
|
# Checks use of for or each in multiline loops.
|
837
1033
|
Style/For:
|
838
1034
|
EnforcedStyle: each
|
839
1035
|
SupportedStyles:
|
840
|
-
- for
|
841
1036
|
- each
|
1037
|
+
- for
|
842
1038
|
|
843
1039
|
# Enforce the method used for string formatting.
|
844
1040
|
Style/FormatString:
|
@@ -857,6 +1053,7 @@ Style/FormatStringToken:
|
|
857
1053
|
- annotated
|
858
1054
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
859
1055
|
- template
|
1056
|
+
- unannotated
|
860
1057
|
|
861
1058
|
Style/FrozenStringLiteralComment:
|
862
1059
|
EnforcedStyle: when_needed
|
@@ -898,11 +1095,7 @@ Style/HashSyntax:
|
|
898
1095
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
899
1096
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
900
1097
|
|
901
|
-
Style/IfUnlessModifier:
|
902
|
-
MaxLineLength: 80
|
903
|
-
|
904
1098
|
Style/InverseMethods:
|
905
|
-
Enabled: true
|
906
1099
|
# `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
|
907
1100
|
# The relationship of inverse methods only needs to be defined in one direction.
|
908
1101
|
# Keys and values both need to be defined as symbols.
|
@@ -940,6 +1133,9 @@ Style/MethodCallWithArgsParentheses:
|
|
940
1133
|
IgnoreMacros: true
|
941
1134
|
IgnoredMethods: []
|
942
1135
|
|
1136
|
+
Style/MethodCallWithoutArgsParentheses:
|
1137
|
+
IgnoredMethods: []
|
1138
|
+
|
943
1139
|
Style/MethodDefParentheses:
|
944
1140
|
EnforcedStyle: require_parentheses
|
945
1141
|
SupportedStyles:
|
@@ -947,11 +1143,15 @@ Style/MethodDefParentheses:
|
|
947
1143
|
- require_no_parentheses
|
948
1144
|
- require_no_parentheses_except_multiline
|
949
1145
|
|
950
|
-
Style/
|
951
|
-
EnforcedStyle:
|
1146
|
+
Style/MissingElse:
|
1147
|
+
EnforcedStyle: both
|
952
1148
|
SupportedStyles:
|
953
|
-
-
|
954
|
-
-
|
1149
|
+
# if - warn when an if expression is missing an else branch
|
1150
|
+
# case - warn when a case expression is missing an else branch
|
1151
|
+
# both - warn when an if or case expression is missing an else branch
|
1152
|
+
- if
|
1153
|
+
- case
|
1154
|
+
- both
|
955
1155
|
|
956
1156
|
# Checks the grouping of mixins (`include`, `extend`, `prepend`) in `class` and
|
957
1157
|
# `module` bodies.
|
@@ -985,6 +1185,26 @@ Style/NegatedIf:
|
|
985
1185
|
- prefix
|
986
1186
|
- postfix
|
987
1187
|
|
1188
|
+
Style/NestedParenthesizedCalls:
|
1189
|
+
Whitelist:
|
1190
|
+
- be
|
1191
|
+
- be_a
|
1192
|
+
- be_an
|
1193
|
+
- be_between
|
1194
|
+
- be_falsey
|
1195
|
+
- be_kind_of
|
1196
|
+
- be_instance_of
|
1197
|
+
- be_truthy
|
1198
|
+
- be_within
|
1199
|
+
- eq
|
1200
|
+
- eql
|
1201
|
+
- end_with
|
1202
|
+
- include
|
1203
|
+
- match
|
1204
|
+
- raise_error
|
1205
|
+
- respond_to
|
1206
|
+
- start_with
|
1207
|
+
|
988
1208
|
Style/Next:
|
989
1209
|
# With `always` all conditions at the end of an iteration needs to be
|
990
1210
|
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
@@ -1057,26 +1277,6 @@ Style/PercentQLiterals:
|
|
1057
1277
|
- lower_case_q # Use `%q` when possible, `%Q` when necessary
|
1058
1278
|
- upper_case_q # Always use `%Q`
|
1059
1279
|
|
1060
|
-
Style/PredicateName:
|
1061
|
-
# Predicate name prefixes.
|
1062
|
-
NamePrefix:
|
1063
|
-
- is_
|
1064
|
-
- has_
|
1065
|
-
- have_
|
1066
|
-
# Predicate name prefixes that should be removed.
|
1067
|
-
NamePrefixBlacklist:
|
1068
|
-
- is_
|
1069
|
-
- has_
|
1070
|
-
- have_
|
1071
|
-
# Predicate names which, despite having a blacklisted prefix, or no `?`,
|
1072
|
-
# should still be accepted
|
1073
|
-
NameWhitelist:
|
1074
|
-
- is_a?
|
1075
|
-
# Exclude Rspec specs because there is a strong convention to write spec
|
1076
|
-
# helpers in the form of `have_something` or `be_something`.
|
1077
|
-
Exclude:
|
1078
|
-
- 'spec/**/*'
|
1079
|
-
|
1080
1280
|
Style/PreferredHashMethods:
|
1081
1281
|
EnforcedStyle: short
|
1082
1282
|
SupportedStyles:
|
@@ -1107,10 +1307,29 @@ Style/RegexpLiteral:
|
|
1107
1307
|
# are found in the regexp string.
|
1108
1308
|
AllowInnerSlashes: false
|
1109
1309
|
|
1310
|
+
Style/RescueStandardError:
|
1311
|
+
EnforcedStyle: explicit
|
1312
|
+
# implicit: Do not include the error class, `rescue`
|
1313
|
+
# explicit: Require an error class `rescue StandardError`
|
1314
|
+
SupportedStyles:
|
1315
|
+
- implicit
|
1316
|
+
- explicit
|
1317
|
+
|
1318
|
+
Style/ReturnNil:
|
1319
|
+
EnforcedStyle: return
|
1320
|
+
SupportedStyles:
|
1321
|
+
- return
|
1322
|
+
- return_nil
|
1323
|
+
|
1110
1324
|
Style/SafeNavigation:
|
1111
1325
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
1112
1326
|
# to whatever it used to return.
|
1113
1327
|
ConvertCodeThatCanStartToReturnNil: false
|
1328
|
+
Whitelist:
|
1329
|
+
- present?
|
1330
|
+
- blank?
|
1331
|
+
- presence
|
1332
|
+
- try
|
1114
1333
|
|
1115
1334
|
Style/Semicolon:
|
1116
1335
|
# Allow `;` to separate several expressions on the same line.
|
@@ -1205,11 +1424,22 @@ Style/TrailingCommaInArguments:
|
|
1205
1424
|
- consistent_comma
|
1206
1425
|
- no_comma
|
1207
1426
|
|
1208
|
-
Style/
|
1209
|
-
# If `comma`, the cop requires a comma after the last item in an array
|
1210
|
-
#
|
1427
|
+
Style/TrailingCommaInArrayLiteral:
|
1428
|
+
# If `comma`, the cop requires a comma after the last item in an array,
|
1429
|
+
# but only when each item is on its own line.
|
1430
|
+
# If `consistent_comma`, the cop requires a comma after the last item of all
|
1431
|
+
# non-empty array literals.
|
1432
|
+
EnforcedStyleForMultiline: no_comma
|
1433
|
+
SupportedStylesForMultiline:
|
1434
|
+
- comma
|
1435
|
+
- consistent_comma
|
1436
|
+
- no_comma
|
1437
|
+
|
1438
|
+
Style/TrailingCommaInHashLiteral:
|
1439
|
+
# If `comma`, the cop requires a comma after the last item in a hash,
|
1440
|
+
# but only when each item is on its own line.
|
1211
1441
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
1212
|
-
# non-empty
|
1442
|
+
# non-empty hash literals.
|
1213
1443
|
EnforcedStyleForMultiline: no_comma
|
1214
1444
|
SupportedStylesForMultiline:
|
1215
1445
|
- comma
|
@@ -1258,22 +1488,6 @@ Style/TrivialAccessors:
|
|
1258
1488
|
- to_s
|
1259
1489
|
- to_sym
|
1260
1490
|
|
1261
|
-
Style/VariableName:
|
1262
|
-
EnforcedStyle: snake_case
|
1263
|
-
SupportedStyles:
|
1264
|
-
- snake_case
|
1265
|
-
- camelCase
|
1266
|
-
|
1267
|
-
Style/VariableNumber:
|
1268
|
-
EnforcedStyle: normalcase
|
1269
|
-
SupportedStyles:
|
1270
|
-
- snake_case
|
1271
|
-
- normalcase
|
1272
|
-
- non_integer
|
1273
|
-
|
1274
|
-
Style/WhileUntilModifier:
|
1275
|
-
MaxLineLength: 80
|
1276
|
-
|
1277
1491
|
# `WordArray` enforces how array literals of word-like strings should be expressed.
|
1278
1492
|
Style/WordArray:
|
1279
1493
|
EnforcedStyle: percent
|
@@ -1289,6 +1503,14 @@ Style/WordArray:
|
|
1289
1503
|
# The regular expression `WordRegex` decides what is considered a word.
|
1290
1504
|
WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
|
1291
1505
|
|
1506
|
+
Style/YodaCondition:
|
1507
|
+
EnforcedStyle: all_comparison_operators
|
1508
|
+
SupportedStyles:
|
1509
|
+
# check all comparison operators
|
1510
|
+
- all_comparison_operators
|
1511
|
+
# check only equality operators: `!=` and `==`
|
1512
|
+
- equality_operators_only
|
1513
|
+
|
1292
1514
|
#################### Metrics ###############################
|
1293
1515
|
|
1294
1516
|
Metrics/AbcSize:
|
@@ -1351,46 +1573,6 @@ Metrics/PerceivedComplexity:
|
|
1351
1573
|
Lint/AssignmentInCondition:
|
1352
1574
|
AllowSafeAssignment: true
|
1353
1575
|
|
1354
|
-
# checks whether the end keywords are aligned properly for `do` `end` blocks.
|
1355
|
-
Lint/BlockAlignment:
|
1356
|
-
# The value `start_of_block` means that the `end` should be aligned with line
|
1357
|
-
# where the `do` keyword appears.
|
1358
|
-
# The value `start_of_line` means it should be aligned with the whole
|
1359
|
-
# expression's starting line.
|
1360
|
-
# The value `either` means both are allowed.
|
1361
|
-
EnforcedStyleAlignWith: either
|
1362
|
-
SupportedStylesAlignWith:
|
1363
|
-
- either
|
1364
|
-
- start_of_block
|
1365
|
-
- start_of_line
|
1366
|
-
|
1367
|
-
Lint/DefEndAlignment:
|
1368
|
-
# The value `def` means that `end` should be aligned with the def keyword.
|
1369
|
-
# The value `start_of_line` means that `end` should be aligned with method
|
1370
|
-
# calls like `private`, `public`, etc, if present in front of the `def`
|
1371
|
-
# keyword on the same line.
|
1372
|
-
EnforcedStyleAlignWith: start_of_line
|
1373
|
-
SupportedStylesAlignWith:
|
1374
|
-
- start_of_line
|
1375
|
-
- def
|
1376
|
-
AutoCorrect: false
|
1377
|
-
|
1378
|
-
# Align ends correctly.
|
1379
|
-
Lint/EndAlignment:
|
1380
|
-
# The value `keyword` means that `end` should be aligned with the matching
|
1381
|
-
# keyword (`if`, `while`, etc.).
|
1382
|
-
# The value `variable` means that in assignments, `end` should be aligned
|
1383
|
-
# with the start of the variable on the left hand side of `=`. In all other
|
1384
|
-
# situations, `end` should still be aligned with the keyword.
|
1385
|
-
# The value `start_of_line` means that `end` should be aligned with the start
|
1386
|
-
# of the line which the matching keyword appears on.
|
1387
|
-
EnforcedStyleAlignWith: keyword
|
1388
|
-
SupportedStylesAlignWith:
|
1389
|
-
- keyword
|
1390
|
-
- variable
|
1391
|
-
- start_of_line
|
1392
|
-
AutoCorrect: false
|
1393
|
-
|
1394
1576
|
Lint/InheritException:
|
1395
1577
|
# The default base class in favour of `Exception`.
|
1396
1578
|
EnforcedStyle: runtime_error
|
@@ -1398,6 +1580,16 @@ Lint/InheritException:
|
|
1398
1580
|
- runtime_error
|
1399
1581
|
- standard_error
|
1400
1582
|
|
1583
|
+
Lint/MissingCopEnableDirective:
|
1584
|
+
# Maximum number of consecutive lines the cop can be disabled for.
|
1585
|
+
# 0 allows only single-line disables
|
1586
|
+
# 1 would mean the maximum allowed is the following:
|
1587
|
+
# # rubocop:disable SomeCop
|
1588
|
+
# a = 1
|
1589
|
+
# # rubocop:enable SomeCop
|
1590
|
+
# .inf for any size
|
1591
|
+
MaximumRangeSize: .inf
|
1592
|
+
|
1401
1593
|
Lint/SafeNavigationChain:
|
1402
1594
|
Whitelist:
|
1403
1595
|
- present?
|
@@ -1405,6 +1597,10 @@ Lint/SafeNavigationChain:
|
|
1405
1597
|
- presence
|
1406
1598
|
- try
|
1407
1599
|
|
1600
|
+
# Checks for shadowed arguments
|
1601
|
+
Lint/ShadowedArgument:
|
1602
|
+
IgnoreImplicitReferences: false
|
1603
|
+
|
1408
1604
|
# Checks for unused block arguments
|
1409
1605
|
Lint/UnusedBlockArgument:
|
1410
1606
|
IgnoreEmptyBlocks: true
|
@@ -1415,6 +1611,9 @@ Lint/UnusedMethodArgument:
|
|
1415
1611
|
AllowUnusedKeywordArguments: false
|
1416
1612
|
IgnoreEmptyMethods: true
|
1417
1613
|
|
1614
|
+
Lint/Void:
|
1615
|
+
CheckForMethodsWithNoSideEffects: false
|
1616
|
+
|
1418
1617
|
#################### Performance ###########################
|
1419
1618
|
|
1420
1619
|
Performance/DoubleStartEndWith:
|
@@ -1436,6 +1635,10 @@ Rails/ActionFilter:
|
|
1436
1635
|
Include:
|
1437
1636
|
- app/controllers/**/*.rb
|
1438
1637
|
|
1638
|
+
Rails/CreateTableWithTimestamps:
|
1639
|
+
Include:
|
1640
|
+
- db/migrate/*.rb
|
1641
|
+
|
1439
1642
|
Rails/Date:
|
1440
1643
|
# The value `strict` disallows usage of `Date.today`, `Date.current`,
|
1441
1644
|
# `Date#to_time` etc.
|
@@ -1447,6 +1650,12 @@ Rails/Date:
|
|
1447
1650
|
- strict
|
1448
1651
|
- flexible
|
1449
1652
|
|
1653
|
+
Rails/Delegate:
|
1654
|
+
# When set to true, using the target object as a prefix of the
|
1655
|
+
# method name without using the `delegate` method will be a
|
1656
|
+
# violation. When set to false, this case is legal.
|
1657
|
+
EnforceForPrefixed: true
|
1658
|
+
|
1450
1659
|
Rails/DynamicFindBy:
|
1451
1660
|
Whitelist:
|
1452
1661
|
- find_by_sql
|
@@ -1475,6 +1684,24 @@ Rails/HasAndBelongsToMany:
|
|
1475
1684
|
Include:
|
1476
1685
|
- app/models/**/*.rb
|
1477
1686
|
|
1687
|
+
Rails/HasManyOrHasOneDependent:
|
1688
|
+
Include:
|
1689
|
+
- app/models/**/*.rb
|
1690
|
+
|
1691
|
+
Rails/HttpStatus:
|
1692
|
+
EnforcedStyle: symbolic
|
1693
|
+
SupportedStyles:
|
1694
|
+
- numeric
|
1695
|
+
- symbolic
|
1696
|
+
|
1697
|
+
Rails/InverseOf:
|
1698
|
+
Include:
|
1699
|
+
- app/models/**/*.rb
|
1700
|
+
|
1701
|
+
Rails/LexicallyScopedActionFilter:
|
1702
|
+
Include:
|
1703
|
+
- app/controllers/**/*.rb
|
1704
|
+
|
1478
1705
|
Rails/NotNullColumn:
|
1479
1706
|
Include:
|
1480
1707
|
- db/migrate/*.rb
|
@@ -1502,7 +1729,7 @@ Rails/ReversibleMigration:
|
|
1502
1729
|
|
1503
1730
|
Rails/SafeNavigation:
|
1504
1731
|
# This will convert usages of `try` to use safe navigation as well as `try!`.
|
1505
|
-
# `try` and `try!` work
|
1732
|
+
# `try` and `try!` work slightly differently. `try!` and safe navigation will
|
1506
1733
|
# both raise a `NoMethodError` if the receiver of the method call does not
|
1507
1734
|
# implement the intended method. `try` will not raise an exception for this.
|
1508
1735
|
ConvertTry: false
|
@@ -1526,6 +1753,12 @@ Rails/UniqBeforePluck:
|
|
1526
1753
|
- aggressive
|
1527
1754
|
AutoCorrect: false
|
1528
1755
|
|
1756
|
+
Rails/UnknownEnv:
|
1757
|
+
Environments:
|
1758
|
+
- development
|
1759
|
+
- test
|
1760
|
+
- production
|
1761
|
+
|
1529
1762
|
Rails/SkipsModelValidations:
|
1530
1763
|
Blacklist:
|
1531
1764
|
- decrement!
|
@@ -1546,3 +1779,6 @@ Rails/Validation:
|
|
1546
1779
|
|
1547
1780
|
Bundler/OrderedGems:
|
1548
1781
|
TreatCommentsAsGroupSeparators: true
|
1782
|
+
|
1783
|
+
Gemspec/OrderedDependencies:
|
1784
|
+
TreatCommentsAsGroupSeparators: true
|