cookstyle 7.14.2 → 7.15.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/cookstyle.yml +9 -0
- data/config/disable_all.yml +8 -0
- data/config/upstream.yml +70 -29
- data/lib/cookstyle/version.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/policyfile_community_source.rb +53 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f116bfdcd0e284199c7b8b88cee62d6996fc1d73a9121cee6bb0680d5caffdc
|
4
|
+
data.tar.gz: b6ec8250e505bc20e30188f50981f90f5d866520ce533f3c7feb35f40fd860be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28c7d62c93b33ca7fc885a02cf17b87a1ea51a296e656aedf509d48215de59701aae1edc063ecf21d9287a94d7bc0c4464ca19ecb32de985e4ab15305e286528
|
7
|
+
data.tar.gz: bc7811af3489dc73ee1fa0d2e2934cdb321ca0486386ccd24f190bd19e914f1da7c896c40ea6f8390181c580a19218cb8c368c336c3ec1ed015b256cbadc9764
|
data/config/cookstyle.yml
CHANGED
@@ -1206,8 +1206,17 @@ Chef/Deprecations/ResourceWithoutUnifiedTrue:
|
|
1206
1206
|
Include:
|
1207
1207
|
- '**/resources/*.rb'
|
1208
1208
|
Exclude:
|
1209
|
+
- '**/resources/_*.rb'
|
1209
1210
|
- '**/spec/**/*.rb'
|
1210
1211
|
|
1212
|
+
Chef/Deprecations/PolicyfileCommunitySource:
|
1213
|
+
Description: The Policyfile source of `:community` has been replaced with `:supermarket`
|
1214
|
+
StyleGuide: 'chef_deprecations_policyfilecommunitysource'
|
1215
|
+
Enabled: true
|
1216
|
+
VersionAdded: '7.15.0'
|
1217
|
+
Include:
|
1218
|
+
- '**/Policyfile.rb'
|
1219
|
+
|
1211
1220
|
###############################
|
1212
1221
|
# Chef/Modernize: Cleaning up legacy code and using new built-in resources
|
1213
1222
|
###############################
|
data/config/disable_all.yml
CHANGED
@@ -123,6 +123,8 @@ Layout/LeadingCommentSpace:
|
|
123
123
|
Enabled: false
|
124
124
|
Layout/LeadingEmptyLines:
|
125
125
|
Enabled: false
|
126
|
+
Layout/LineEndStringConcatenationIndentation:
|
127
|
+
Enabled: false
|
126
128
|
Layout/LineLength:
|
127
129
|
Enabled: false
|
128
130
|
Layout/MultilineArrayBraceLayout:
|
@@ -487,6 +489,8 @@ Naming/HeredocDelimiterCase:
|
|
487
489
|
Enabled: false
|
488
490
|
Naming/HeredocDelimiterNaming:
|
489
491
|
Enabled: false
|
492
|
+
Naming/InclusiveLanguage:
|
493
|
+
Enabled: false
|
490
494
|
Naming/MemoizedInstanceVariableName:
|
491
495
|
Enabled: false
|
492
496
|
Naming/MethodName:
|
@@ -943,3 +947,7 @@ Security/Open:
|
|
943
947
|
Enabled: false
|
944
948
|
Security/YAMLLoad:
|
945
949
|
Enabled: false
|
950
|
+
InSpec/Deprecations/AttributeDefault:
|
951
|
+
Enabled: false
|
952
|
+
InSpec/Deprecations/AttributeHelper:
|
953
|
+
Enabled: false
|
data/config/upstream.yml
CHANGED
@@ -270,8 +270,8 @@ Layout/AccessModifierIndentation:
|
|
270
270
|
SupportedStyles:
|
271
271
|
- outdent
|
272
272
|
- indent
|
273
|
-
# By default
|
274
|
-
#
|
273
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
274
|
+
# but it can be overridden by setting this parameter.
|
275
275
|
IndentationWidth: ~
|
276
276
|
|
277
277
|
Layout/ArgumentAlignment:
|
@@ -299,8 +299,8 @@ Layout/ArgumentAlignment:
|
|
299
299
|
SupportedStyles:
|
300
300
|
- with_first_argument
|
301
301
|
- with_fixed_indentation
|
302
|
-
# By default
|
303
|
-
#
|
302
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
303
|
+
# but it can be overridden by setting this parameter.
|
304
304
|
IndentationWidth: ~
|
305
305
|
|
306
306
|
Layout/ArrayAlignment:
|
@@ -328,8 +328,8 @@ Layout/ArrayAlignment:
|
|
328
328
|
SupportedStyles:
|
329
329
|
- with_first_element
|
330
330
|
- with_fixed_indentation
|
331
|
-
# By default
|
332
|
-
#
|
331
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
332
|
+
# but it can be overridden by setting this parameter.
|
333
333
|
IndentationWidth: ~
|
334
334
|
|
335
335
|
Layout/AssignmentIndentation:
|
@@ -339,8 +339,8 @@ Layout/AssignmentIndentation:
|
|
339
339
|
Enabled: true
|
340
340
|
VersionAdded: '0.49'
|
341
341
|
VersionChanged: '0.77'
|
342
|
-
# By default
|
343
|
-
#
|
342
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
343
|
+
# but it can be overridden by setting this parameter.
|
344
344
|
IndentationWidth: ~
|
345
345
|
|
346
346
|
Layout/BeginEndAlignment:
|
@@ -387,9 +387,9 @@ Layout/CaseIndentation:
|
|
387
387
|
- case
|
388
388
|
- end
|
389
389
|
IndentOneStep: false
|
390
|
-
# By default
|
391
|
-
#
|
392
|
-
# This only matters if `IndentOneStep` is `true
|
390
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
391
|
+
# but it can be overridden by setting this parameter.
|
392
|
+
# This only matters if `IndentOneStep` is `true`.
|
393
393
|
IndentationWidth: ~
|
394
394
|
|
395
395
|
Layout/ClassStructure:
|
@@ -666,8 +666,8 @@ Layout/FirstArgumentIndentation:
|
|
666
666
|
# Same as `special_for_inner_method_call` except that the special rule only
|
667
667
|
# applies if the outer method call encloses its arguments in parentheses.
|
668
668
|
- special_for_inner_method_call_in_parentheses
|
669
|
-
# By default
|
670
|
-
#
|
669
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
670
|
+
# but it can be overridden by setting this parameter.
|
671
671
|
IndentationWidth: ~
|
672
672
|
|
673
673
|
Layout/FirstArrayElementIndentation:
|
@@ -693,8 +693,8 @@ Layout/FirstArrayElementIndentation:
|
|
693
693
|
- special_inside_parentheses
|
694
694
|
- consistent
|
695
695
|
- align_brackets
|
696
|
-
# By default
|
697
|
-
#
|
696
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
697
|
+
# but it can be overridden by setting this parameter.
|
698
698
|
IndentationWidth: ~
|
699
699
|
|
700
700
|
Layout/FirstArrayElementLineBreak:
|
@@ -725,8 +725,8 @@ Layout/FirstHashElementIndentation:
|
|
725
725
|
- special_inside_parentheses
|
726
726
|
- consistent
|
727
727
|
- align_braces
|
728
|
-
# By default
|
729
|
-
#
|
728
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
729
|
+
# but it can be overridden by setting this parameter.
|
730
730
|
IndentationWidth: ~
|
731
731
|
|
732
732
|
Layout/FirstHashElementLineBreak:
|
@@ -761,8 +761,8 @@ Layout/FirstParameterIndentation:
|
|
761
761
|
SupportedStyles:
|
762
762
|
- consistent
|
763
763
|
- align_parentheses
|
764
|
-
# By default
|
765
|
-
#
|
764
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
765
|
+
# but it can be overridden by setting this parameter.
|
766
766
|
IndentationWidth: ~
|
767
767
|
|
768
768
|
Layout/HashAlignment:
|
@@ -883,8 +883,8 @@ Layout/IndentationStyle:
|
|
883
883
|
Enabled: true
|
884
884
|
VersionAdded: '0.49'
|
885
885
|
VersionChanged: '0.82'
|
886
|
-
# By default
|
887
|
-
#
|
886
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
887
|
+
# but it can be overridden by setting this parameter.
|
888
888
|
# It is used during auto-correction to determine how many spaces should
|
889
889
|
# replace each tab.
|
890
890
|
IndentationWidth: ~
|
@@ -923,6 +923,20 @@ Layout/LeadingEmptyLines:
|
|
923
923
|
VersionAdded: '0.57'
|
924
924
|
VersionChanged: '0.77'
|
925
925
|
|
926
|
+
Layout/LineEndStringConcatenationIndentation:
|
927
|
+
Description: >-
|
928
|
+
Checks the indentation of the next line after a line that
|
929
|
+
ends with a string literal and a backslash.
|
930
|
+
Enabled: pending
|
931
|
+
VersionAdded: '1.18'
|
932
|
+
EnforcedStyle: aligned
|
933
|
+
SupportedStyles:
|
934
|
+
- aligned
|
935
|
+
- indented
|
936
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
937
|
+
# but it can be overridden by setting this parameter.
|
938
|
+
IndentationWidth: ~
|
939
|
+
|
926
940
|
Layout/LineLength:
|
927
941
|
Description: 'Checks that line length does not exceed the configured limit.'
|
928
942
|
StyleGuide: '#max-line-length'
|
@@ -1053,8 +1067,8 @@ Layout/MultilineMethodCallIndentation:
|
|
1053
1067
|
- aligned
|
1054
1068
|
- indented
|
1055
1069
|
- indented_relative_to_receiver
|
1056
|
-
# By default
|
1057
|
-
#
|
1070
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1071
|
+
# but it can be overridden by setting this parameter.
|
1058
1072
|
IndentationWidth: ~
|
1059
1073
|
|
1060
1074
|
Layout/MultilineMethodDefinitionBraceLayout:
|
@@ -1083,8 +1097,8 @@ Layout/MultilineOperationIndentation:
|
|
1083
1097
|
SupportedStyles:
|
1084
1098
|
- aligned
|
1085
1099
|
- indented
|
1086
|
-
# By default
|
1087
|
-
#
|
1100
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1101
|
+
# but it can be overridden by setting this parameter.
|
1088
1102
|
IndentationWidth: ~
|
1089
1103
|
|
1090
1104
|
Layout/ParameterAlignment:
|
@@ -1112,8 +1126,8 @@ Layout/ParameterAlignment:
|
|
1112
1126
|
SupportedStyles:
|
1113
1127
|
- with_first_parameter
|
1114
1128
|
- with_fixed_indentation
|
1115
|
-
# By default
|
1116
|
-
#
|
1129
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1130
|
+
# but it can be overridden by setting this parameter.
|
1117
1131
|
IndentationWidth: ~
|
1118
1132
|
|
1119
1133
|
Layout/RedundantLineBreak:
|
@@ -1795,7 +1809,7 @@ Lint/MissingCopEnableDirective:
|
|
1795
1809
|
Lint/MissingSuper:
|
1796
1810
|
Description: >-
|
1797
1811
|
This cop checks for the presence of constructors and lifecycle callbacks
|
1798
|
-
without calls to `super
|
1812
|
+
without calls to `super`.
|
1799
1813
|
Enabled: true
|
1800
1814
|
VersionAdded: '0.89'
|
1801
1815
|
VersionChanged: '1.4'
|
@@ -2520,6 +2534,31 @@ Naming/HeredocDelimiterNaming:
|
|
2520
2534
|
ForbiddenDelimiters:
|
2521
2535
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
2522
2536
|
|
2537
|
+
Naming/InclusiveLanguage:
|
2538
|
+
Description: 'Recommend the use of inclusive language instead of problematic terms.'
|
2539
|
+
Enabled: pending
|
2540
|
+
VersionAdded: '1.18'
|
2541
|
+
CheckIdentifiers: true
|
2542
|
+
CheckConstants: true
|
2543
|
+
CheckVariables: true
|
2544
|
+
CheckStrings: false
|
2545
|
+
CheckSymbols: true
|
2546
|
+
CheckComments: true
|
2547
|
+
CheckFilepaths: true
|
2548
|
+
FlaggedTerms:
|
2549
|
+
whitelist:
|
2550
|
+
Regex: !ruby/regexp '/white[-_\s]?list/'
|
2551
|
+
Suggestions:
|
2552
|
+
- allowlist
|
2553
|
+
- permit
|
2554
|
+
blacklist:
|
2555
|
+
Regex: !ruby/regexp '/black[-_\s]?list/'
|
2556
|
+
Suggestions:
|
2557
|
+
- denylist
|
2558
|
+
- block
|
2559
|
+
slave:
|
2560
|
+
Suggestions: ['replica', 'secondary', 'follower']
|
2561
|
+
|
2523
2562
|
Naming/MemoizedInstanceVariableName:
|
2524
2563
|
Description: >-
|
2525
2564
|
Memoized method name should match memo instance variable name.
|
@@ -3111,6 +3150,7 @@ Style/CommentAnnotation:
|
|
3111
3150
|
- HACK
|
3112
3151
|
- REVIEW
|
3113
3152
|
- NOTE
|
3153
|
+
RequireColon: true
|
3114
3154
|
|
3115
3155
|
Style/CommentedKeyword:
|
3116
3156
|
Description: 'Do not place comments on the same line as certain keywords.'
|
@@ -4576,7 +4616,8 @@ Style/StringConcatenation:
|
|
4576
4616
|
Enabled: true
|
4577
4617
|
Safe: false
|
4578
4618
|
VersionAdded: '0.89'
|
4579
|
-
VersionChanged: '1.
|
4619
|
+
VersionChanged: '1.18'
|
4620
|
+
Mode: aggressive
|
4580
4621
|
|
4581
4622
|
Style/StringHashKeys:
|
4582
4623
|
Description: 'Prefer symbols instead of strings as hash keys.'
|
data/lib/cookstyle/version.rb
CHANGED
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
#
|
3
|
+
# Copyright:: 2021, Chef Software, Inc.
|
4
|
+
# Author:: Tim Smith (<tsmith@chef.io>)
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
module RuboCop
|
19
|
+
module Cop
|
20
|
+
module Chef
|
21
|
+
module Deprecations
|
22
|
+
# The Policyfile source of `:community` has been replaced with `:supermarket`
|
23
|
+
#
|
24
|
+
# @example
|
25
|
+
#
|
26
|
+
# #### incorrect
|
27
|
+
# default_source :community
|
28
|
+
#
|
29
|
+
# #### correct
|
30
|
+
# default_source :supermarket
|
31
|
+
#
|
32
|
+
class PolicyfileCommunitySource < Base
|
33
|
+
extend AutoCorrector
|
34
|
+
|
35
|
+
MSG = 'The Policyfile source of `:community` has been replaced with `:supermarket`.'
|
36
|
+
RESTRICT_ON_SEND = [:default_source].freeze
|
37
|
+
|
38
|
+
def_node_matcher :community_source?, <<-PATTERN
|
39
|
+
(send nil? :default_source (:sym :community))
|
40
|
+
PATTERN
|
41
|
+
|
42
|
+
def on_send(node)
|
43
|
+
community_source?(node) do
|
44
|
+
add_offense(node, message: MSG, severity: :warning) do |corrector|
|
45
|
+
corrector.replace(node, 'default_source :supermarket')
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cookstyle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom May
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-07-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubocop
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.
|
20
|
+
version: 1.18.4
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1.
|
27
|
+
version: 1.18.4
|
28
28
|
description:
|
29
29
|
email:
|
30
30
|
- thom@chef.io
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb
|
135
135
|
- lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb
|
136
136
|
- lib/rubocop/cop/chef/deprecation/poise_archive.rb
|
137
|
+
- lib/rubocop/cop/chef/deprecation/policyfile_community_source.rb
|
137
138
|
- lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb
|
138
139
|
- lib/rubocop/cop/chef/deprecation/require_recipe.rb
|
139
140
|
- lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb
|