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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91b883b4825831ec4a6cd167377859fa83bf1eea994b1b0dfa85d28dcdd998e9
4
- data.tar.gz: fe4e2c83dc76b6b6713e7f6b1ad3e50f869708eda0bf22eeb1b68a43bd5c7762
3
+ metadata.gz: 3e49171ce1ae18a21ed120dc5dcb5a19c0fa1923c4d0d34118c4315836a37043
4
+ data.tar.gz: 77f7addb5541cb43836938196ba8fdfeebcbb75d10b940172e3a194652dc1c3b
5
5
  SHA512:
6
- metadata.gz: 330ed487b5946aba1b6b532e5ab79a0875007acd9052f7637e5a275a4db02c4cd39dfab066c981b6f14c8d24fd30b66cbd8b2b23d578232ce58176d7cc3ff11c
7
- data.tar.gz: db1991f9e874b4fbb154e0334b09a7fcbe4062bb5207d4b3c1a3f169c4365ab8caf17fec699ca914a792be5ddab56a41207a657bdf7b919634008d1263a698d6
6
+ metadata.gz: 52f6de8476deb4a8c0d01fb9d2258894baf9d27f3a4f0a9672f8dc7c35e1ba19ae6e0010c7f1096b6ae4004a16c784fc80351083904c7e13f6f38c7fda794b7c
7
+ data.tar.gz: '0858305d54b66ec0b2d831377577efd5d609c64ccbec89c77c9f2acb41548f271d6d72cc00cc2c3a9a9db2439d7c503169d076e223e9f8f8460c7c9173e0c77a'
data/Gemfile CHANGED
@@ -27,5 +27,4 @@ group :development do
27
27
  gem 'concord'
28
28
  gem 'rake'
29
29
  gem 'rspec', '>= 3.4'
30
- gem 'simplecov'
31
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Cookstyle
3
- VERSION = "6.15.5" # rubocop: disable Style/StringLiterals
3
+ VERSION = "6.15.9" # rubocop: disable Style/StringLiterals
4
4
  RUBOCOP_VERSION = '0.89.1'
5
5
  end
@@ -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.10' => '8',
72
- '> 9.0, < 9.9' => '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.8' => '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.8' => '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.8' => '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 < Cop
36
- include RuboCop::Chef::CookbookHelpers
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
- add_offense(h, location: :expression, message: MSG, severity: :refactor) if h.braces?
47
- end
48
- end
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 < Cop
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, '(hash <(pair (sym :description) ...) ...>)'
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, location: :expression, message: MSG, severity: :refactor) unless description_hash(processed_source.ast).any?
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 str ...)'
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.5
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-13 00:00:00.000000000 Z
12
+ date: 2020-08-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubocop