chefstyle 0.1.0 → 0.3.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.
- checksums.yaml +4 -4
- data/README.md +23 -4
- data/config/chefstyle.yml +355 -0
- data/config/disable_all.yml +85 -25
- data/config/disabled.yml +40 -6
- data/config/enabled.yml +170 -24
- data/config/upstream.yml +175 -21
- data/lib/chefstyle/version.rb +2 -2
- metadata +5 -5
data/config/upstream.yml
CHANGED
@@ -27,9 +27,8 @@ AllCops:
|
|
27
27
|
- '**/Vagabondfile'
|
28
28
|
Exclude:
|
29
29
|
- 'vendor/**/*'
|
30
|
-
#
|
31
|
-
|
32
|
-
RunRailsCops: false
|
30
|
+
# Default formatter will be used if no -f/--format option is given.
|
31
|
+
DefaultFormatter: progress
|
33
32
|
# Cop names are not displayed in offense messages by default. Change behavior
|
34
33
|
# by overriding DisplayCopNames, or by giving the -D/--display-cop-names
|
35
34
|
# option.
|
@@ -39,7 +38,7 @@ AllCops:
|
|
39
38
|
# -S/--display-style-guide option.
|
40
39
|
DisplayStyleGuide: false
|
41
40
|
# Extra details are not displayed in offense messages by default. Change
|
42
|
-
#
|
41
|
+
# behavior by overriding ExtraDetails, or by giving the
|
43
42
|
# -E/--extra-details option.
|
44
43
|
ExtraDetails: false
|
45
44
|
# Additional cops that do not reference a style guide rule may be enabled by
|
@@ -64,6 +63,9 @@ AllCops:
|
|
64
63
|
# which is "/tmp" on Unix-like systems, but could be something else on other
|
65
64
|
# systems.
|
66
65
|
CacheRootDirectory: /tmp
|
66
|
+
# What version of the Ruby interpreter is the inspected code intended to
|
67
|
+
# run on? (If there is more than one, set this to the lowest version.)
|
68
|
+
TargetRubyVersion: 2.0
|
67
69
|
|
68
70
|
# Indent private/protected/public as deep as method definitions
|
69
71
|
Style/AccessModifierIndentation:
|
@@ -71,6 +73,15 @@ Style/AccessModifierIndentation:
|
|
71
73
|
SupportedStyles:
|
72
74
|
- outdent
|
73
75
|
- indent
|
76
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
77
|
+
# But it can be overridden by setting this parameter
|
78
|
+
IndentationWidth: ~
|
79
|
+
|
80
|
+
Style/Alias:
|
81
|
+
EnforcedStyle: prefer_alias
|
82
|
+
SupportedStyles:
|
83
|
+
- prefer_alias
|
84
|
+
- prefer_alias_method
|
74
85
|
|
75
86
|
# Align the elements of a hash literal if they span more than one line.
|
76
87
|
Style/AlignHash:
|
@@ -263,6 +274,10 @@ Style/CaseIndentation:
|
|
263
274
|
- case
|
264
275
|
- end
|
265
276
|
IndentOneStep: false
|
277
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
278
|
+
# But it can be overridden by setting this parameter
|
279
|
+
# This only matters if IndentOneStep is true
|
280
|
+
IndentationWidth: ~
|
266
281
|
|
267
282
|
Style/ClassAndModuleChildren:
|
268
283
|
# Checks the style of children definitions at classes and modules.
|
@@ -408,11 +423,27 @@ Style/ExtraSpacing:
|
|
408
423
|
# things with the previous or next line, not counting empty lines or comment
|
409
424
|
# lines.
|
410
425
|
AllowForAlignment: true
|
426
|
+
# When true, forces the alignment of = in assignments on consecutive lines.
|
427
|
+
ForceEqualSignAlignment: false
|
411
428
|
|
412
429
|
Style/FileName:
|
413
430
|
# File names listed in AllCops:Include are excluded by default. Add extra
|
414
431
|
# excludes here.
|
415
432
|
Exclude: []
|
433
|
+
# When true, requires that each source file should define a class or module
|
434
|
+
# with a name which matches the file name (converted to ... case).
|
435
|
+
# It further expects it to be nested inside modules which match the names
|
436
|
+
# of subdirectories in its path.
|
437
|
+
ExpectMatchingDefinition: false
|
438
|
+
# If non-nil, expect all source file names to match the following regex.
|
439
|
+
# Only the file name itself is matched, not the entire file path.
|
440
|
+
# Use anchors as necessary if you want to match the entire name rather than
|
441
|
+
# just a part of it.
|
442
|
+
Regex: ~
|
443
|
+
# With `IgnoreExecutableScripts` set to `true`, this cop does not
|
444
|
+
# report offending filenames for executable scripts (i.e. source
|
445
|
+
# files with a shebang in the first line).
|
446
|
+
IgnoreExecutableScripts: true
|
416
447
|
|
417
448
|
Style/FirstParameterIndentation:
|
418
449
|
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
@@ -428,6 +459,9 @@ Style/FirstParameterIndentation:
|
|
428
459
|
# Same as special_for_inner_method_call except that the special rule only
|
429
460
|
# applies if the outer method call encloses its arguments in parentheses.
|
430
461
|
- special_for_inner_method_call_in_parentheses
|
462
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
463
|
+
# But it can be overridden by setting this parameter
|
464
|
+
IndentationWidth: ~
|
431
465
|
|
432
466
|
# Checks use of for or each in multiline loops.
|
433
467
|
Style/For:
|
@@ -444,6 +478,18 @@ Style/FormatString:
|
|
444
478
|
- sprintf
|
445
479
|
- percent
|
446
480
|
|
481
|
+
Style/FrozenStringLiteralComment:
|
482
|
+
EnforcedStyle: when_needed
|
483
|
+
SupportedStyles:
|
484
|
+
# `when_needed` will add the frozen string literal comment to files
|
485
|
+
# only when the `TargetRubyVersion` is set to 2.3+.
|
486
|
+
- when_needed
|
487
|
+
# `always` will always add the frozen string literal comment to a file
|
488
|
+
# regardless of the Ruby version or if `freeze` or `<<` are called on a
|
489
|
+
# string literal. If you run code against multiple versions of Ruby, it is
|
490
|
+
# possible that this will create errors in Ruby 2.3.0+.
|
491
|
+
- always
|
492
|
+
|
447
493
|
# Built-in global variables are allowed by default.
|
448
494
|
Style/GlobalVars:
|
449
495
|
AllowedVariables: []
|
@@ -481,20 +527,55 @@ Style/IndentationWidth:
|
|
481
527
|
# Number of spaces for each indentation level.
|
482
528
|
Width: 2
|
483
529
|
|
530
|
+
# Checks the indentation of the first element in an array literal.
|
531
|
+
Style/IndentArray:
|
532
|
+
# The value `special_inside_parentheses` means that array literals with
|
533
|
+
# brackets that have their opening bracket on the same line as a surrounding
|
534
|
+
# opening round parenthesis, shall have their first element indented relative
|
535
|
+
# to the first position inside the parenthesis.
|
536
|
+
#
|
537
|
+
# The value `consistent` means that the indentation of the first element shall
|
538
|
+
# always be relative to the first position of the line where the opening
|
539
|
+
# bracket is.
|
540
|
+
#
|
541
|
+
# The value `align_brackets` means that the indentation of the first element
|
542
|
+
# shall always be relative to the position of the opening bracket.
|
543
|
+
EnforcedStyle: special_inside_parentheses
|
544
|
+
SupportedStyles:
|
545
|
+
- special_inside_parentheses
|
546
|
+
- consistent
|
547
|
+
- align_brackets
|
548
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
549
|
+
# But it can be overridden by setting this parameter
|
550
|
+
IndentationWidth: ~
|
551
|
+
|
552
|
+
# Checks the indentation of assignment RHS, when on a different line from LHS
|
553
|
+
Style/IndentAssignment:
|
554
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
555
|
+
# But it can be overridden by setting this parameter
|
556
|
+
IndentationWidth: ~
|
557
|
+
|
484
558
|
# Checks the indentation of the first key in a hash literal.
|
485
559
|
Style/IndentHash:
|
486
560
|
# The value `special_inside_parentheses` means that hash literals with braces
|
487
561
|
# that have their opening brace on the same line as a surrounding opening
|
488
562
|
# round parenthesis, shall have their first key indented relative to the
|
489
563
|
# first position inside the parenthesis.
|
564
|
+
#
|
490
565
|
# The value `consistent` means that the indentation of the first key shall
|
491
566
|
# always be relative to the first position of the line where the opening
|
492
567
|
# brace is.
|
568
|
+
#
|
569
|
+
# The value `align_braces` means that the indentation of the first key shall
|
570
|
+
# always be relative to the position of the opening brace.
|
493
571
|
EnforcedStyle: special_inside_parentheses
|
494
572
|
SupportedStyles:
|
495
573
|
- special_inside_parentheses
|
496
574
|
- consistent
|
497
575
|
- align_braces
|
576
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
577
|
+
# But it can be overridden by setting this parameter
|
578
|
+
IndentationWidth: ~
|
498
579
|
|
499
580
|
Style/LambdaCall:
|
500
581
|
EnforcedStyle: call
|
@@ -536,11 +617,41 @@ Style/MethodName:
|
|
536
617
|
- snake_case
|
537
618
|
- camelCase
|
538
619
|
|
620
|
+
Style/MultilineAssignmentLayout:
|
621
|
+
# The types of assignments which are subject to this rule.
|
622
|
+
SupportedTypes:
|
623
|
+
- block
|
624
|
+
- case
|
625
|
+
- class
|
626
|
+
- if
|
627
|
+
- kwbegin
|
628
|
+
- module
|
629
|
+
EnforcedStyle: new_line
|
630
|
+
SupportedStyles:
|
631
|
+
# Ensures that the assignment operator and the rhs are on the same line for
|
632
|
+
# the set of supported types.
|
633
|
+
- same_line
|
634
|
+
# Ensures that the assignment operator and the rhs are on separate lines
|
635
|
+
# for the set of supported types.
|
636
|
+
- new_line
|
637
|
+
|
638
|
+
Style/MultilineMethodCallIndentation:
|
639
|
+
EnforcedStyle: aligned
|
640
|
+
SupportedStyles:
|
641
|
+
- aligned
|
642
|
+
- indented
|
643
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
644
|
+
# But it can be overridden by setting this parameter
|
645
|
+
IndentationWidth: ~
|
646
|
+
|
539
647
|
Style/MultilineOperationIndentation:
|
540
648
|
EnforcedStyle: aligned
|
541
649
|
SupportedStyles:
|
542
650
|
- aligned
|
543
651
|
- indented
|
652
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
653
|
+
# But it can be overridden by setting this parameter
|
654
|
+
IndentationWidth: ~
|
544
655
|
|
545
656
|
Style/NumericLiterals:
|
546
657
|
MinDigits: 5
|
@@ -621,7 +732,7 @@ Style/Semicolon:
|
|
621
732
|
AllowAsExpressionSeparator: false
|
622
733
|
|
623
734
|
Style/SignalException:
|
624
|
-
EnforcedStyle:
|
735
|
+
EnforcedStyle: only_raise
|
625
736
|
SupportedStyles:
|
626
737
|
- only_raise
|
627
738
|
- only_fail
|
@@ -639,6 +750,18 @@ Style/SingleLineBlockParams:
|
|
639
750
|
Style/SingleLineMethods:
|
640
751
|
AllowIfMethodIsEmpty: true
|
641
752
|
|
753
|
+
Style/SpaceBeforeFirstArg:
|
754
|
+
# When true, allows most uses of extra spacing if the intent is to align
|
755
|
+
# things with the previous or next line, not counting empty lines or comment
|
756
|
+
# lines.
|
757
|
+
AllowForAlignment: true
|
758
|
+
|
759
|
+
Style/SpecialGlobalVars:
|
760
|
+
EnforcedStyle: use_english_names
|
761
|
+
SupportedStyles:
|
762
|
+
- use_perl_names
|
763
|
+
- use_english_names
|
764
|
+
|
642
765
|
Style/StabbyLambdaParentheses:
|
643
766
|
EnforcedStyle: require_parentheses
|
644
767
|
SupportedStyles:
|
@@ -650,6 +773,9 @@ Style/StringLiterals:
|
|
650
773
|
SupportedStyles:
|
651
774
|
- single_quotes
|
652
775
|
- double_quotes
|
776
|
+
# If true, strings which span multiple lines using \ for continuation must
|
777
|
+
# use the same type of quotes on each line.
|
778
|
+
ConsistentQuotesInMultiline: false
|
653
779
|
|
654
780
|
Style/StringLiteralsInInterpolation:
|
655
781
|
EnforcedStyle: single_quotes
|
@@ -680,9 +806,10 @@ Style/SpaceAroundEqualsInParameterDefault:
|
|
680
806
|
- no_space
|
681
807
|
|
682
808
|
Style/SpaceAroundOperators:
|
683
|
-
|
684
|
-
|
685
|
-
|
809
|
+
# When true, allows most uses of extra spacing if the intent is to align
|
810
|
+
# with an operator on the previous or next line, not counting empty lines
|
811
|
+
# or comment lines.
|
812
|
+
AllowForAlignment: true
|
686
813
|
|
687
814
|
Style/SpaceBeforeBlockBraces:
|
688
815
|
EnforcedStyle: space
|
@@ -713,6 +840,12 @@ Style/SpaceInsideStringInterpolation:
|
|
713
840
|
- space
|
714
841
|
- no_space
|
715
842
|
|
843
|
+
Style/SymbolArray:
|
844
|
+
EnforcedStyle: percent
|
845
|
+
SupportedStyles:
|
846
|
+
- percent
|
847
|
+
- brackets
|
848
|
+
|
716
849
|
Style/SymbolProc:
|
717
850
|
# A list of method names to be ignored by the check.
|
718
851
|
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
@@ -725,11 +858,22 @@ Style/TrailingBlankLines:
|
|
725
858
|
- final_newline
|
726
859
|
- final_blank_line
|
727
860
|
|
728
|
-
Style/
|
729
|
-
# If
|
730
|
-
#
|
731
|
-
# If
|
732
|
-
#
|
861
|
+
Style/TrailingCommaInArguments:
|
862
|
+
# If `comma`, the cop requires a comma after the last argument, but only for
|
863
|
+
# parenthesized method calls where each argument is on its own line.
|
864
|
+
# If `consistent_comma`, the cop requires a comma after the last argument,
|
865
|
+
# for all parenthesized method calls with arguments.
|
866
|
+
EnforcedStyleForMultiline: no_comma
|
867
|
+
SupportedStyles:
|
868
|
+
- comma
|
869
|
+
- consistent_comma
|
870
|
+
- no_comma
|
871
|
+
|
872
|
+
Style/TrailingCommaInLiteral:
|
873
|
+
# If `comma`, the cop requires a comma after the last item in an array or
|
874
|
+
# hash, but only when each item is on its own line.
|
875
|
+
# If `consistent_comma`, the cop requires a comma after the last item of all
|
876
|
+
# non-empty array and hash literals.
|
733
877
|
EnforcedStyleForMultiline: no_comma
|
734
878
|
SupportedStyles:
|
735
879
|
- comma
|
@@ -788,9 +932,13 @@ Style/WhileUntilModifier:
|
|
788
932
|
MaxLineLength: 80
|
789
933
|
|
790
934
|
Style/WordArray:
|
935
|
+
EnforcedStyle: percent
|
936
|
+
SupportedStyles:
|
937
|
+
- percent
|
938
|
+
- brackets
|
791
939
|
MinSize: 0
|
792
940
|
# The regular expression WordRegex decides what is considered a word.
|
793
|
-
WordRegex: !ruby/regexp '/\A[\p{Word}]+\z/'
|
941
|
+
WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
|
794
942
|
|
795
943
|
##################### Metrics ##################################
|
796
944
|
|
@@ -817,7 +965,8 @@ Metrics/CyclomaticComplexity:
|
|
817
965
|
Metrics/LineLength:
|
818
966
|
Max: 80
|
819
967
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
820
|
-
#
|
968
|
+
# containing a URI to be longer than Max.
|
969
|
+
AllowHeredoc: true
|
821
970
|
AllowURI: true
|
822
971
|
URISchemes:
|
823
972
|
- http
|
@@ -847,10 +996,13 @@ Lint/EndAlignment:
|
|
847
996
|
# The value `variable` means that in assignments, `end` should be aligned
|
848
997
|
# with the start of the variable on the left hand side of `=`. In all other
|
849
998
|
# situations, `end` should still be aligned with the keyword.
|
999
|
+
# The value `start_of_line` means that `end` should be aligned with the start
|
1000
|
+
# of the line which the matching keyword appears on.
|
850
1001
|
AlignWith: keyword
|
851
1002
|
SupportedStyles:
|
852
1003
|
- keyword
|
853
1004
|
- variable
|
1005
|
+
- start_of_line
|
854
1006
|
AutoCorrect: false
|
855
1007
|
|
856
1008
|
Lint/DefEndAlignment:
|
@@ -868,11 +1020,17 @@ Lint/DefEndAlignment:
|
|
868
1020
|
Lint/UnusedBlockArgument:
|
869
1021
|
IgnoreEmptyBlocks: true
|
870
1022
|
|
871
|
-
# Checks for unused method arguments.
|
1023
|
+
# Checks for unused method arguments.
|
872
1024
|
Lint/UnusedMethodArgument:
|
873
1025
|
AllowUnusedKeywordArguments: false
|
874
1026
|
IgnoreEmptyMethods: true
|
875
1027
|
|
1028
|
+
##################### Performance ############################
|
1029
|
+
|
1030
|
+
Performance/RedundantMerge:
|
1031
|
+
# Max number of key-value pairs to consider an offense
|
1032
|
+
MaxKeyValuePairs: 2
|
1033
|
+
|
876
1034
|
##################### Rails ##################################
|
877
1035
|
|
878
1036
|
Rails/ActionFilter:
|
@@ -887,17 +1045,13 @@ Rails/Date:
|
|
887
1045
|
# The value `strict` disallows usage of `Date.today`, `Date.current`,
|
888
1046
|
# `Date#to_time` etc.
|
889
1047
|
# The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc
|
890
|
-
# (but not `Date.today`) which are
|
1048
|
+
# (but not `Date.today`) which are overridden by ActiveSupport to handle current
|
891
1049
|
# time zone.
|
892
1050
|
EnforcedStyle: flexible
|
893
1051
|
SupportedStyles:
|
894
1052
|
- strict
|
895
1053
|
- flexible
|
896
1054
|
|
897
|
-
Rails/DefaultScope:
|
898
|
-
Include:
|
899
|
-
- app/models/**/*.rb
|
900
|
-
|
901
1055
|
Rails/FindBy:
|
902
1056
|
Include:
|
903
1057
|
- app/models/**/*.rb
|
data/lib/chefstyle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chefstyle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom May
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.37.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.37.2
|
69
69
|
description:
|
70
70
|
email:
|
71
71
|
- thom@chef.io
|
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
requirements: []
|
113
113
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
114
|
+
rubygems_version: 2.5.2
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
117
|
summary: Rubocop configuration for Chef's ruby projects
|