cookstyle 6.15.5 → 6.15.9
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/Gemfile +0 -1
- data/lib/cookstyle/version.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +6 -5
- data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +6 -10
- data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +3 -3
- data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3e49171ce1ae18a21ed120dc5dcb5a19c0fa1923c4d0d34118c4315836a37043
|
|
4
|
+
data.tar.gz: 77f7addb5541cb43836938196ba8fdfeebcbb75d10b940172e3a194652dc1c3b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 52f6de8476deb4a8c0d01fb9d2258894baf9d27f3a4f0a9672f8dc7c35e1ba19ae6e0010c7f1096b6ae4004a16c784fc80351083904c7e13f6f38c7fda794b7c
|
|
7
|
+
data.tar.gz: '0858305d54b66ec0b2d831377577efd5d609c64ccbec89c77c9f2acb41548f271d6d72cc00cc2c3a9a9db2439d7c503169d076e223e9f8f8460c7c9173e0c77a'
|
data/Gemfile
CHANGED
data/lib/cookstyle/version.rb
CHANGED
|
@@ -65,25 +65,26 @@ module RuboCop
|
|
|
65
65
|
'opensuse' => {
|
|
66
66
|
'< 14' => true,
|
|
67
67
|
'~> 42.0' => true,
|
|
68
|
+
'= 15.0' => '15',
|
|
68
69
|
},
|
|
69
70
|
'debian' => {
|
|
70
71
|
'< 8' => true,
|
|
71
|
-
'> 8.0, < 8.
|
|
72
|
-
'> 9.0, < 9.
|
|
72
|
+
'> 8.0, < 8.11' => '8',
|
|
73
|
+
'> 9.0, < 9.11' => '9',
|
|
73
74
|
},
|
|
74
75
|
'centos' => {
|
|
75
76
|
'< 6.0' => true,
|
|
76
|
-
'~> 6.0, < 6.
|
|
77
|
+
'~> 6.0, < 6.10' => '6',
|
|
77
78
|
'~> 7.0, < 7.6 ' => '7',
|
|
78
79
|
},
|
|
79
80
|
'redhat' => {
|
|
80
81
|
'< 6.0' => true,
|
|
81
|
-
'~> 6.0, < 6.
|
|
82
|
+
'~> 6.0, < 6.10' => '6',
|
|
82
83
|
'~> 7.0, < 7.6' => '7',
|
|
83
84
|
},
|
|
84
85
|
'oracle' => {
|
|
85
86
|
'< 6.0' => true,
|
|
86
|
-
'~> 6.0, < 6.
|
|
87
|
+
'~> 6.0, < 6.10' => '6',
|
|
87
88
|
'~> 7.0, < 7.6 ' => '7',
|
|
88
89
|
},
|
|
89
90
|
}.freeze
|
|
@@ -32,8 +32,8 @@ module RuboCop
|
|
|
32
32
|
# shell_out!('hostnamectl status', returns: [0, 1])
|
|
33
33
|
# shell_out('hostnamectl status', returns: [0, 1])
|
|
34
34
|
#
|
|
35
|
-
class Ruby27KeywordArgumentWarnings <
|
|
36
|
-
|
|
35
|
+
class Ruby27KeywordArgumentWarnings < Base
|
|
36
|
+
extend RuboCop::Cop::AutoCorrector
|
|
37
37
|
|
|
38
38
|
MSG = 'Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.'
|
|
39
39
|
|
|
@@ -43,14 +43,10 @@ module RuboCop
|
|
|
43
43
|
|
|
44
44
|
def on_send(node)
|
|
45
45
|
positional_shellout?(node) do |h|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def autocorrect(node)
|
|
51
|
-
lambda do |corrector|
|
|
52
|
-
# @todo when we drop ruby 2.4 support we can convert this to just delete_prefix delete_suffix
|
|
53
|
-
corrector.replace(node.loc.expression, node.loc.expression.source.gsub(/^{/, '').gsub(/}$/, ''))
|
|
46
|
+
next unless h.braces?
|
|
47
|
+
add_offense(h.loc.expression, message: MSG, severity: :refactor) do |corrector|
|
|
48
|
+
corrector.replace(h.loc.expression, h.loc.expression.source[1..-2])
|
|
49
|
+
end
|
|
54
50
|
end
|
|
55
51
|
end
|
|
56
52
|
end
|
|
@@ -29,7 +29,7 @@ module RuboCop
|
|
|
29
29
|
# # good
|
|
30
30
|
# property :foo, String, description: "Set the important thing to..."
|
|
31
31
|
#
|
|
32
|
-
class IncludePropertyDescriptions <
|
|
32
|
+
class IncludePropertyDescriptions < Base
|
|
33
33
|
extend TargetChefVersion
|
|
34
34
|
|
|
35
35
|
minimum_target_chef_version '13.9'
|
|
@@ -40,11 +40,11 @@ module RuboCop
|
|
|
40
40
|
def_node_matcher :property?, '(send nil? :property (sym _) ...)'
|
|
41
41
|
|
|
42
42
|
# hash that contains description in any order (that's the <> bit)
|
|
43
|
-
def_node_search :description_hash
|
|
43
|
+
def_node_search :description_hash?, '(hash <(pair (sym :description) ...) ...>)'
|
|
44
44
|
|
|
45
45
|
def on_send(node)
|
|
46
46
|
property?(node) do
|
|
47
|
-
add_offense(node
|
|
47
|
+
add_offense(node.loc.expression, message: MSG, severity: :refactor) unless description_hash?(node)
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
end
|
|
@@ -44,7 +44,7 @@ module RuboCop
|
|
|
44
44
|
add_offense(nil, location: range, message: MSG, severity: :refactor) unless resource_description(processed_source.ast).any?
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
-
def_node_search :resource_description, '(send nil? :description
|
|
47
|
+
def_node_search :resource_description, '(send nil? :description ...)'
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
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: 6.15.
|
|
4
|
+
version: 6.15.9
|
|
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: 2020-08-
|
|
12
|
+
date: 2020-08-24 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rubocop
|