Skip to content

Commit b3cc155

Browse files
authored
fix(cookstyle): Run cookstyle on the codebase (#45)
Signed-off-by: Dan Webb <dan.webb@damacus.io>
1 parent 8d22c7e commit b3cc155

17 files changed

+42
-43
lines changed

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"recommendations": [
33
"chef-software.chef",
4-
"rebornix.ruby",
54
"editorconfig.editorconfig"
65
]
76
}

libraries/install.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ def default_kea_install_packages
7272

7373
case node['platform_family']
7474
when 'amazon', 'fedora', 'rhel'
75-
if version >= 1.6 && version <= 2.2
75+
if version.between?(1.6, 2.2)
7676
%w(isc-kea isc-kea-devel isc-kea-hooks isc-kea-libs isc-kea-shell)
7777
else
7878
%w(isc-kea isc-kea-admin isc-kea-common isc-kea-ctrl-agent isc-kea-devel isc-kea-dhcp-ddns isc-kea-dhcp4 isc-kea-dhcp6 isc-kea-doc isc-kea-hooks isc-kea-perfdhcp)
7979
end
8080
when 'debian'
81-
if version >= 1.6 && version <= 2.2
81+
if version.between?(1.6, 2.2)
8282
%w(isc-kea-admin isc-kea-common isc-kea-ctrl-agent isc-kea-dev isc-kea-dhcp-ddns-server isc-kea-dhcp4-server isc-kea-dhcp6-server isc-kea-doc)
8383
else
8484
%w(isc-kea isc-kea-ctrl-agent isc-kea-dev isc-kea-perfdhcp)

resources/config_dhcp4.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ def auto_accumulator_options_override
4747

4848
property :ddns_replace_client_name, [String, Symbol],
4949
equal_to: %w(never always when-present when-not-present),
50-
coerce: proc { |p| p.to_s }
50+
coerce: proc(&:to_s)
5151

5252
property :ddns_qualifying_suffix, String
5353

5454
property :ddns_send_updates, [true, false]
5555

5656
property :ddns_ttl_percent, [Float, Integer, String],
57-
coerce: proc { |p| p.to_f }
57+
coerce: proc(&:to_f)
5858

5959
property :ddns_ttl, Integer
6060

@@ -68,7 +68,7 @@ def auto_accumulator_options_override
6868

6969
property :ddns_conflict_resolution_mode, [String, Symbol],
7070
equal_to: %w(check-with-dhcid no-check-with-dhcid check-exists-with-dhcid no-check-without-dhcid),
71-
coerce: proc { |p| p.to_s }
71+
coerce: proc(&:to_s)
7272

7373
property :decline_probation_period, Integer
7474

resources/config_dhcp4_interfaces.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def auto_accumulator_options_override
3131

3232
property :dhcp_socket_type, [String, Symbol],
3333
equal_to: %w(raw udp),
34-
coerce: proc { |p| p.to_s }
34+
coerce: proc(&:to_s)
3535

3636
property :outbound_interface, [String, Symbol],
3737
equal_to: %w(use-routing same-as-inbound),
38-
coerce: proc { |p| p.to_s }
38+
coerce: proc(&:to_s)
3939

4040
property :re_detect, [true, false]

resources/config_dhcp4_sanity_checks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def auto_accumulator_options_override
3030

3131
property :lease_checks, [String, Symbol],
3232
equal_to: %w(none warn fix fix-del del),
33-
coerce: proc { |p| p.to_s }
33+
coerce: proc(&:to_s)

resources/config_dhcp6.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ def auto_accumulator_options_override
4545

4646
property :ddns_replace_client_name, [String, Symbol],
4747
equal_to: %w(never always when-present when-not-present),
48-
coerce: proc { |p| p.to_s }
48+
coerce: proc(&:to_s)
4949

5050
property :ddns_qualifying_suffix, String
5151

5252
property :ddns_send_updates, [true, false]
5353

5454
property :ddns_ttl_percent, [Float, Integer, String],
55-
coerce: proc { |p| p.to_f }
55+
coerce: proc(&:to_f)
5656

5757
property :ddns_ttl, Integer
5858

@@ -66,7 +66,7 @@ def auto_accumulator_options_override
6666

6767
property :ddns_conflict_resolution_mode, [String, Symbol],
6868
equal_to: %w(check-with-dhcid no-check-with-dhcid check-exists-with-dhcid no-check-without-dhcid),
69-
coerce: proc { |p| p.to_s }
69+
coerce: proc(&:to_s)
7070

7171
property :decline_probation_period, Integer
7272

resources/config_dhcp6_sanity_checks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def auto_accumulator_options_override
3030

3131
property :lease_checks, [String, Symbol],
3232
equal_to: %w(none warn fix fix-del del),
33-
coerce: proc { |p| p.to_s }
33+
coerce: proc(&:to_s)

resources/config_dhcp_ddns_tsig_key.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def auto_accumulator_options_override
4141

4242
property :algorithm, String,
4343
equal_to: %w(HMAC-MD5 HMAC-SHA1 HMAC-SHA224 HMAC-SHA256 HMAC-SHA386 HMAC-SHA512),
44-
coerce: proc { |p| p.upcase }
44+
coerce: proc(&:upcase)
4545

4646
property :digest_bits, Integer,
4747
sensitive: true

resources/partial/_config_auto_accumulator_kea.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ def auto_accumulator_options
159159
action :delete do
160160
case option_config_path_type
161161
when :array
162-
converge_by("Deleting configuration for #{new_resource.declared_type.to_s} #{new_resource.name}") do
162+
converge_by("Deleting configuration for #{new_resource.declared_type} #{new_resource.name}") do
163163
accumulator_config(action: :array_delete)
164164
end if config_file_config_present?
165165
when :array_contained
166-
converge_by("Deleting configuration for #{new_resource.declared_type.to_s} #{new_resource.name}") do
166+
converge_by("Deleting configuration for #{new_resource.declared_type} #{new_resource.name}") do
167167
accumulator_config(action: :key_delete_match_self, key: accumulator_config_path_containing_key)
168168
end if config_file_config_present?
169169
when :hash
@@ -181,7 +181,7 @@ def auto_accumulator_options
181181
diff_properties.each { |rp| accumulator_config(action: :delete, key: rp) }
182182
end unless diff_properties.empty?
183183
when :hash_contained
184-
converge_by("Deleting configuration for #{new_resource.declared_type.to_s} #{new_resource.name}") do
184+
converge_by("Deleting configuration for #{new_resource.declared_type} #{new_resource.name}") do
185185
accumulator_config(action: :delete, key: option_config_path_contained_key)
186186
end if config_file_config_present?
187187
else

resources/partial/_config_auto_accumulator_stork.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ def auto_accumulator_options
152152
action :delete do
153153
case option_config_path_type
154154
when :array
155-
converge_by("Deleting configuration for #{new_resource.declared_type.to_s} #{new_resource.name}") do
155+
converge_by("Deleting configuration for #{new_resource.declared_type} #{new_resource.name}") do
156156
accumulator_config(action: :array_delete_match, key: option_config_path_match_key, value: option_config_path_match_value)
157157
end if accumulator_config_array_present?
158158
when :array_contained
159-
converge_by("Deleting configuration for #{new_resource.declared_type.to_s} #{new_resource.name}") do
159+
converge_by("Deleting configuration for #{new_resource.declared_type} #{new_resource.name}") do
160160
accumulator_config(action: :key_delete_match, key: option_config_path_contained_key)
161161
end if accumulator_config_array_present?
162162
when :hash
@@ -179,7 +179,7 @@ def auto_accumulator_options
179179
diff_properties.each { |rp| accumulator_config(action: :delete, key: rp) }
180180
end unless diff_properties.empty?
181181
when :hash_contained
182-
converge_by("Deleting configuration for #{new_resource.declared_type.to_s} #{new_resource.name}") do
182+
converge_by("Deleting configuration for #{new_resource.declared_type} #{new_resource.name}") do
183183
accumulator_config(action: :delete, key: option_config_path_contained_key)
184184
end if accumulator_config_present?(option_config_path_contained_key)
185185
else

0 commit comments

Comments
 (0)