Skip to content

Commit 4bdc8e2

Browse files
committed
(PUP-11993) Style/PercentLiteralDelimiters
This commit enables the Style/PercentLiteralDelimiters cop and fixes 121 autocorrectable offenses.
1 parent 9400561 commit 4bdc8e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+141
-146
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -640,11 +640,6 @@ Style/NumericPredicate:
640640
Style/OptionalBooleanParameter:
641641
Enabled: false
642642

643-
# This cop supports safe auto-correction (--auto-correct).
644-
# Configuration parameters: PreferredDelimiters.
645-
Style/PercentLiteralDelimiters:
646-
Enabled: false
647-
648643
# This cop supports safe auto-correction (--auto-correct).
649644
# Configuration parameters: EnforcedStyle.
650645
# SupportedStyles: lower_case_q, upper_case_q

ext/windows/service/daemon.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def report_windows_event(type, id, message)
161161

162162
def parse_runinterval(puppet_path)
163163
begin
164-
runinterval = %x{#{puppet_path} config --section agent --log_level notice print runinterval}.to_i
164+
runinterval = %x(#{puppet_path} config --section agent --log_level notice print runinterval).to_i
165165
if runinterval == 0
166166
runinterval = 1800
167167
log_err("Failed to determine runinterval, defaulting to #{runinterval} seconds")
@@ -176,7 +176,7 @@ def parse_runinterval(puppet_path)
176176

177177
def parse_log_level(puppet_path, cmdline_debug)
178178
begin
179-
loglevel = %x{#{puppet_path} config --section agent --log_level notice print log_level}.chomp
179+
loglevel = %x(#{puppet_path} config --section agent --log_level notice print log_level).chomp
180180
unless loglevel && respond_to?("log_#{loglevel}")
181181
loglevel = :notice
182182
log_err("Failed to determine loglevel, defaulting to #{loglevel}")

lib/puppet/application/filebucket.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def help
213213
def run_command
214214
@args = command_line.args
215215
command = args.shift
216-
return send(command) if %w{get backup restore diff list}.include? command
216+
return send(command) if %w[get backup restore diff list].include? command
217217

218218
help
219219
end

lib/puppet/face/help.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def all_application_summaries
194194
BLANK = "\n"
195195
def available_application_names_special_sort
196196
full_list = Puppet::Application.available_application_names
197-
a_list = full_list & %w{apply agent config help lookup module resource}
197+
a_list = full_list & %w[apply agent config help lookup module resource]
198198
a_list = a_list.sort
199199
also_ran = full_list - a_list
200200
also_ran = also_ran.sort
@@ -221,7 +221,7 @@ def horribly_extract_summary_from(appname)
221221
# private :horribly_extract_summary_from
222222

223223
def exclude_from_docs?(appname)
224-
%w{face_base indirection_base report status}.include? appname
224+
%w[face_base indirection_base report status].include? appname
225225
end
226226
# This should absolutely be a private method, but for some reason it appears
227227
# that you can't use the 'private' keyword inside of a Face definition.

lib/puppet/feature/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
Puppet.features.add(:ldap, :libs => ["ldap"])
2525

2626
# We have the Rdoc::Usage library.
27-
Puppet.features.add(:usage, :libs => %w{rdoc/ri/ri_paths rdoc/usage})
27+
Puppet.features.add(:usage, :libs => %w[rdoc/ri/ri_paths rdoc/usage])
2828

2929
# We have libshadow, useful for managing passwords.
3030
Puppet.features.add(:libshadow, :libs => ["shadow"])
@@ -36,7 +36,7 @@
3636
end
3737

3838
# We have lcs diff
39-
Puppet.features.add :diff, :libs => %w{diff/lcs diff/lcs/hunk}
39+
Puppet.features.add :diff, :libs => %w[diff/lcs diff/lcs/hunk]
4040

4141
# We have OpenSSL
4242
Puppet.features.add(:openssl, :libs => ["openssl"])

lib/puppet/feature/pe_license.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
require_relative '../../puppet/util/feature'
44

55
# Is the pe license library installed providing the ability to read licenses.
6-
Puppet.features.add(:pe_license, :libs => %{pe_license})
6+
Puppet.features.add(:pe_license, :libs => %(pe_license))

lib/puppet/feature/ssh.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
require_relative '../../puppet/util/feature'
44

5-
Puppet.features.add(:ssh, :libs => %{net/ssh})
5+
Puppet.features.add(:ssh, :libs => %(net/ssh))

lib/puppet/feature/zlib.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
# We want this to load if possible, but it's not automatically
66
# required.
7-
Puppet.features.add(:zlib, :libs => %{zlib})
7+
Puppet.features.add(:zlib, :libs => %(zlib))

lib/puppet/http/proxy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def self.no_proxy?(dest)
5656
# If this no_proxy entry specifies a port, we want to match it against
5757
# the destination port. Otherwise just match hosts.
5858
if port
59-
no_proxy_regex = %r(#{host}:#{port}$)
59+
no_proxy_regex = %r{#{host}:#{port}$}
6060
dest_string = "#{dest.host}:#{dest.port}"
6161
else
62-
no_proxy_regex = %r(#{host}$)
62+
no_proxy_regex = %r{#{host}$}
6363
dest_string = "#{dest.host}"
6464
end
6565

lib/puppet/indirector/catalog/store_configs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
require_relative '../../../puppet/resource/catalog'
55

66
class Puppet::Resource::Catalog::StoreConfigs < Puppet::Indirector::StoreConfigs
7-
desc %q{Part of the "storeconfigs" feature. Should not be directly set by end users.}
7+
desc %q(Part of the "storeconfigs" feature. Should not be directly set by end users.)
88
end

0 commit comments

Comments
 (0)