cookstyle 7.14.2 → 7.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fb8828f5ea858d36d8aece2ac5de3e469e04fcd86301ebb2fa86aeffd2ec9bc
4
- data.tar.gz: 4b1101bab8a823c1a161478dbb1503e9c7cca0d340a33c07aecef0f6c15efdff
3
+ metadata.gz: 9e7636105260988af89327c7e9c5dc27b668fd307fed9000cfe2749780358a23
4
+ data.tar.gz: 13c4a79ce3721f3f9116ef7f440b8d207cb1c2b0f2d34f9999305cfa0dc68eea
5
5
  SHA512:
6
- metadata.gz: 7308b900c24d494ec617f001a3b83ee3f9491fb38de29ee7491c67c3c58605ba21c43c81419567ddd5b150674221c243ceec1faa075ab3744c2e426097f09624
7
- data.tar.gz: 3ba724acde273762b7073740e84f19b8d439d20f73ec73e237fd4cefc5dc7c65d84d7b4d62992d56aedca825e924f32063e6557811401f0e0740de6dc4b80e5f
6
+ metadata.gz: bc5b985e7d9355b6e8d7029e590e019649ccbca37c41510cc9a57fc46c533af38e1cb0e022bc412dfcc0f3039a6a6da32f793cac9b496bfea70f937a5cbe7113
7
+ data.tar.gz: 826b7a3f355935d55ef2fb6636a815f2bebfe35b1ecb9a43038e2d164dff6d9f7d35c39ebc72961ea85c90e02b3d5312e052986213914d45d855f4e1857f08ef
data/config/cookstyle.yml CHANGED
@@ -1208,6 +1208,14 @@ Chef/Deprecations/ResourceWithoutUnifiedTrue:
1208
1208
  Exclude:
1209
1209
  - '**/spec/**/*.rb'
1210
1210
 
1211
+ Chef/Deprecations/PolicyfileCommunitySource:
1212
+ Description: The Policyfile source of `:community` has been replaced with `:supermarket`
1213
+ StyleGuide: 'chef_deprecations_policyfilecommunitysource'
1214
+ Enabled: true
1215
+ VersionAdded: '7.15.0'
1216
+ Include:
1217
+ - '**/Policyfile.rb'
1218
+
1211
1219
  ###############################
1212
1220
  # Chef/Modernize: Cleaning up legacy code and using new built-in resources
1213
1221
  ###############################
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Cookstyle
3
- VERSION = "7.14.2" # rubocop: disable Style/StringLiterals
3
+ VERSION = "7.15.0" # rubocop: disable Style/StringLiterals
4
4
  RUBOCOP_VERSION = '1.17.0'
5
5
  end
@@ -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.14.2
4
+ version: 7.15.0
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-06-23 00:00:00.000000000 Z
12
+ date: 2021-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -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