cookstyle 7.26.1 → 7.27.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: fe0113118edcb59c64b2a176b5f4dc9e4880cedda9cdced9257bdf58901f7ad3
4
- data.tar.gz: a0124092a6e81ef8062d6ef14e7deb18cd517ca44d26b03efbc28e6f367be220
3
+ metadata.gz: 897bcf0f8e234120fb9cfcb1077210e70fbe23e1fb82bde3d7eac7a549eee3ec
4
+ data.tar.gz: 15a3664f0d54c8b1c4404d4c21d000d328090fc73280ee888819b8d6f1a8625b
5
5
  SHA512:
6
- metadata.gz: a2be0d6a18f5e3db8a572d2561af13504b7cc752eca1e8fbd9d9d6a443a1d327c6110c93b5541f4c4df98469524f7715c6695bbe41c3489f5459590e194e1cf6
7
- data.tar.gz: 24e0423ffdab5c801ebb640332f8cb9156f8069dfc4798b2130ca059d01e9f0b5e7962b422c857e66c303e00ec8054d22275afbb0acf6a2b3e792866de0a7322
6
+ metadata.gz: 7d8ea69d16659e4fdb8c13a33cffd486321f44b9040d308702f3018c4ab4372becd941701bbf21127d6bd5db3b35b235a9295d12a2c7276a33b17e41a2066366
7
+ data.tar.gz: afcf222bfddc0bdc6816b0221beb4a975f9d215e36a809a32af45ea1ccd1dbda2c31eb5ebbd5f2fbd9e253b4dce84ed8ad6c5a43cf105f77626f8b48a07af228
data/config/cookstyle.yml CHANGED
@@ -506,6 +506,14 @@ Chef/Correctness/MetadataMissingVersion:
506
506
  Include:
507
507
  - '**/metadata.rb'
508
508
 
509
+ Chef/Correctness/InvalidCookbookName:
510
+ Description: Cookbook names should not contain invalid characters such as periods.
511
+ StyleGuide: 'chef_correctness_invalidcookbookname'
512
+ Enabled: true
513
+ VersionAdded: '7.27'
514
+ Include:
515
+ - '**/metadata.rb'
516
+
509
517
  ###############################
510
518
  # Chef/Sharing: Issues that prevent sharing code with other teams or with the Chef community in general
511
519
  ###############################
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Cookstyle
3
- VERSION = "7.26.1" # rubocop: disable Style/StringLiterals
3
+ VERSION = "7.27.0" # rubocop: disable Style/StringLiterals
4
4
  RUBOCOP_VERSION = '1.24.1'
5
5
  end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # Copyright:: 2022, 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 Correctness
22
+ # Cookbook names should not contain invalid characters such as periods.
23
+ #
24
+ # @example
25
+ #
26
+ # #### incorrect
27
+ # name 'foo.bar'
28
+ #
29
+ # #### correct
30
+ # name 'foo_bar'
31
+ #
32
+ class InvalidCookbookName < Base
33
+ RESTRICT_ON_SEND = [:name].freeze
34
+ MSG = 'Cookbook names should not contain invalid characters such as periods.'
35
+
36
+ def_node_matcher :has_name?, '(send nil? :name $str)'
37
+
38
+ def on_send(node)
39
+ has_name?(node) do |val|
40
+ add_offense(node, message: MSG, severity: :refactor) if val.value.include?('.')
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ 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.26.1
4
+ version: 7.27.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-12-31 00:00:00.000000000 Z
12
+ date: 2022-01-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop
@@ -55,6 +55,7 @@ files:
55
55
  - lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb
56
56
  - lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb
57
57
  - lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb
58
+ - lib/rubocop/cop/chef/correctness/invalid_cookbook_name.rb
58
59
  - lib/rubocop/cop/chef/correctness/invalid_default_action.rb
59
60
  - lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb
60
61
  - lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb