Skip to content

Commit 89aa3f8

Browse files
committed
Layout/SpaceInsidePercentLiteralDelimiters
This commit enables the Rubocop Layout/SpaceInsidePercentLiteralDelimiters cop and addresses all offenses.
1 parent e298c24 commit 89aa3f8

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ I18n/GetText/DecorateStringFormattingUsingPercent:
2222
I18n/RailsI18n/DecorateString:
2323
Enabled: false
2424

25-
# This cop supports safe auto-correction (--auto-correct).
26-
Layout/SpaceInsidePercentLiteralDelimiters:
27-
Exclude:
28-
- 'ext/windows/service/daemon.rb'
29-
- 'lib/puppet/interface/documentation.rb'
30-
- 'lib/puppet/pops/parser/slurp_support.rb'
31-
3225
# This cop supports safe auto-correction (--auto-correct).
3326
Layout/SpaceInsideRangeLiteral:
3427
Exclude:

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/interface/documentation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def build_synopsis(face, action = nil, arguments = nil)
7979

8080
options.each do |option|
8181
option = get_option(option)
82-
wrap = option.required? ? %w{ < > } : %w{ [ ] }
82+
wrap = option.required? ? %w{< >} : %w{[ ]}
8383

8484
s.group(0, *wrap) do
8585
option.optparse.each do |item|
@@ -96,7 +96,7 @@ def build_synopsis(face, action = nil, arguments = nil)
9696
end
9797

9898
display_global_options.sort.each do |option|
99-
wrap = %w{ [ ] }
99+
wrap = %w{[ ]}
100100
s.group(0, *wrap) do
101101
type = Puppet.settings.setting(option).default
102102
type ||= Puppet.settings.setting(option).type.to_s.upcase

lib/puppet/pops/parser/slurp_support.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ module SlurpSupport
1919
# unquoted, no escapes
2020
SLURP_UQNE_PATTERN = /(\$\{?|\z)/m
2121
SLURP_ALL_PATTERN = /.*(\z)/m
22-
SQ_ESCAPES = %w{ \\ ' }
23-
DQ_ESCAPES = %w{ \\ $ ' " r n t s u} + ["\r\n", "\n"]
24-
UQ_ESCAPES = %w{ \\ $ r n t s u} + ["\r\n", "\n"]
22+
SQ_ESCAPES = %w{\\ '}
23+
DQ_ESCAPES = %w{\\ $ ' " r n t s u} + ["\r\n", "\n"]
24+
UQ_ESCAPES = %w{\\ $ r n t s u} + ["\r\n", "\n"]
2525

2626
def slurp_sqstring
2727
# skip the leading '

0 commit comments

Comments
 (0)