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 +4 -4
- data/config/cookstyle.yml +8 -0
- data/lib/cookstyle/version.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_cookbook_name.rb +47 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 897bcf0f8e234120fb9cfcb1077210e70fbe23e1fb82bde3d7eac7a549eee3ec
|
4
|
+
data.tar.gz: 15a3664f0d54c8b1c4404d4c21d000d328090fc73280ee888819b8d6f1a8625b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
###############################
|
data/lib/cookstyle/version.rb
CHANGED
@@ -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.
|
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:
|
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
|