Skip to content

Commit 9afd00d

Browse files
(PUP-11767) Fix LineEndConcatenation violations and remove from todo list
1 parent bdee6bd commit 9afd00d

File tree

7 files changed

+32
-42
lines changed

7 files changed

+32
-42
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -534,16 +534,6 @@ Style/InverseMethods:
534534
- 'lib/puppet/reference/providers.rb'
535535
- 'lib/puppet/type/file.rb'
536536

537-
# This cop supports safe auto-correction (--auto-correct).
538-
Style/LineEndConcatenation:
539-
Exclude:
540-
- 'lib/puppet/functions.rb'
541-
- 'lib/puppet/module.rb'
542-
- 'lib/puppet/network/http/api.rb'
543-
- 'lib/puppet/provider/user/directoryservice.rb'
544-
- 'lib/puppet/util/windows/file.rb'
545-
- 'lib/puppet/util/windows/process.rb'
546-
547537
# This cop supports safe auto-correction (--auto-correct).
548538
# Configuration parameters: IgnoredMethods.
549539
Style/MethodCallWithoutArgsParentheses:

lib/puppet/functions.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -635,20 +635,20 @@ def type(assignment_string)
635635
rb_location = rb_location.gsub(/:in.*$/, '')
636636
# Create a meaningful location for parse errors - show both what went wrong with the parsing
637637
# and in which ruby file it was found.
638-
raise ArgumentError, _("Parsing of 'type \"%{assignment_string}\"' failed with message: <%{message}>.\n" +
639-
"Called from <%{ruby_file_location}>") % {
640-
assignment_string: assignment_string,
641-
message: e.message,
642-
ruby_file_location: rb_location
643-
}
638+
raise ArgumentError, _("Parsing of 'type \"%{assignment_string}\"' failed with message: <%{message}>.\n" \
639+
"Called from <%{ruby_file_location}>") % {
640+
assignment_string: assignment_string,
641+
message: e.message,
642+
ruby_file_location: rb_location
643+
}
644644
end
645645
unless result.body.is_a?(Puppet::Pops::Model::TypeAlias)
646646
rb_location = rb_location.gsub(/:in.*$/, '')
647-
raise ArgumentError, _("Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'.\n" +
648-
"Called from <%{ruby_file_location}>") % {
649-
assignment_string: assignment_string,
650-
ruby_file_location: rb_location
651-
}
647+
raise ArgumentError, _("Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'.\n" \
648+
"Called from <%{ruby_file_location}>") % {
649+
assignment_string: assignment_string,
650+
ruby_file_location: rb_location
651+
}
652652
end
653653
@local_types << result.body
654654
end

lib/puppet/module.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def wanted_manifests_from(pattern)
465465
relative_pattern = Puppet::FileSystem::PathPattern.relative(extended)
466466
rescue Puppet::FileSystem::PathPattern::InvalidPattern => error
467467
raise Puppet::Module::InvalidFilePattern.new(
468-
"The pattern \"#{pattern}\" to find manifests in the module \"#{name}\" " +
468+
"The pattern \"#{pattern}\" to find manifests in the module \"#{name}\" " \
469469
"is invalid and potentially unsafe.", error
470470
)
471471
end

lib/puppet/network/http/api.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ def self.not_found_upgrade
1515
Puppet::Network::HTTP::Route
1616
.path(/.*/)
1717
.any(lambda do |_req, _res|
18-
raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("Error: Invalid URL - Puppet expects requests that conform to the " +
19-
"/puppet and /puppet-ca APIs.\n\n" +
20-
"Note that Puppet 3 agents aren't compatible with this version; if you're " +
21-
"running Puppet 3, you must either upgrade your agents to match the server " +
22-
"or point them to a server running Puppet 3.\n\n" +
23-
"Server Info:\n" +
24-
" Puppet version: #{Puppet.version}\n" +
25-
" Supported /puppet API versions: #{Puppet::Network::HTTP::SERVER_URL_VERSIONS}\n",
18+
raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("Error: Invalid URL - Puppet expects requests that conform to the " \
19+
"/puppet and /puppet-ca APIs.\n\n" \
20+
"Note that Puppet 3 agents aren't compatible with this version; if you're " \
21+
"running Puppet 3, you must either upgrade your agents to match the server " \
22+
"or point them to a server running Puppet 3.\n\n" \
23+
"Server Info:\n" \
24+
" Puppet version: #{Puppet.version}\n" \
25+
" Supported /puppet API versions: #{Puppet::Network::HTTP::SERVER_URL_VERSIONS}\n",
2626
Puppet::Network::HTTP::Issues::HANDLER_NOT_FOUND)
2727
end)
2828
end

lib/puppet/provider/user/directoryservice.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,14 +458,14 @@ def salt=(value)
458458
begin
459459
dscl '.', '-change', "/Users/#{resource.name}", self.class.ns_to_ds_attribute_map[setter_method.intern], @property_hash[setter_method.intern], value
460460
rescue Puppet::ExecutionFailure => e
461-
raise Puppet::Error, "Cannot set the #{setter_method} value of '#{value}' for user " +
461+
raise Puppet::Error, "Cannot set the #{setter_method} value of '#{value}' for user " \
462462
"#{@resource.name} due to the following error: #{e.inspect}", e.backtrace
463463
end
464464
else
465465
begin
466466
dscl '.', '-create', "/Users/#{resource.name}", self.class.ns_to_ds_attribute_map[setter_method.intern], value
467467
rescue Puppet::ExecutionFailure => e
468-
raise Puppet::Error, "Cannot set the #{setter_method} value of '#{value}' for user " +
468+
raise Puppet::Error, "Cannot set the #{setter_method} value of '#{value}' for user " \
469469
"#{@resource.name} due to the following error: #{e.inspect}", e.backtrace
470470
end
471471
end

lib/puppet/util/windows/file.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ def self.create_file(file_name, desired_access, share_mode, security_attributes,
138138
return result unless result == INVALID_HANDLE_VALUE
139139

140140
raise Puppet::Util::Windows::Error.new(
141-
"CreateFile(#{file_name}, #{desired_access.to_s(8)}, #{share_mode.to_s(8)}, " +
142-
"#{security_attributes}, #{creation_disposition.to_s(8)}, " +
143-
"#{flags_and_attributes.to_s(8)}, #{template_file_handle})"
141+
"CreateFile(#{file_name}, #{desired_access.to_s(8)}, #{share_mode.to_s(8)}, " \
142+
"#{security_attributes}, #{creation_disposition.to_s(8)}, " \
143+
"#{flags_and_attributes.to_s(8)}, #{template_file_handle})"
144144
)
145145
end
146146

@@ -158,8 +158,8 @@ def self.get_reparse_point_data(handle, &block)
158158
when IO_REPARSE_TAG_NFS
159159
raise Puppet::Util::Windows::Error.new("Retrieving NFS reparse point data is unsupported")
160160
else
161-
raise Puppet::Util::Windows::Error.new("DeviceIoControl(#{handle}, " +
162-
"FSCTL_GET_REPARSE_POINT) returned unknown tag 0x#{reparse_tag.to_s(16).upcase}")
161+
raise Puppet::Util::Windows::Error.new("DeviceIoControl(#{handle}, " \
162+
"FSCTL_GET_REPARSE_POINT) returned unknown tag 0x#{reparse_tag.to_s(16).upcase}")
163163
end
164164

165165
yield buffer_type.new(reparse_data_buffer_ptr)
@@ -200,8 +200,8 @@ def self.device_io_control(handle, io_control_code, in_buffer = nil, out_buffer
200200

201201
if result == FFI::WIN32_FALSE
202202
raise Puppet::Util::Windows::Error.new(
203-
"DeviceIoControl(#{handle}, #{io_control_code}, " +
204-
"#{in_buffer}, #{in_buffer ? in_buffer.size : ''}, " +
203+
"DeviceIoControl(#{handle}, #{io_control_code}, " \
204+
"#{in_buffer}, #{in_buffer ? in_buffer.size : ''}, " \
205205
"#{out_buffer}, #{out_buffer ? out_buffer.size : ''}"
206206
)
207207
end

lib/puppet/util/windows/process.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def get_process_image_name_by_pid(pid)
138138
result = QueryFullProcessImageNameW(phandle, use_win32_path_format, exe_name_ptr, exe_name_length_ptr)
139139
if result == FFI::WIN32_FALSE
140140
raise Puppet::Util::Windows::Error.new(
141-
"QueryFullProcessImageNameW(phandle, #{use_win32_path_format}, " +
141+
"QueryFullProcessImageNameW(phandle, #{use_win32_path_format}, " \
142142
"exe_name_ptr, #{max_chars}"
143143
)
144144
end
@@ -193,8 +193,8 @@ def get_token_information(token_handle, token_information, &block)
193193

194194
if result == FFI::WIN32_FALSE
195195
raise Puppet::Util::Windows::Error.new(
196-
"GetTokenInformation(#{token_handle}, #{token_information}, #{token_information_buf}, " +
197-
"#{return_length}, #{return_length_ptr})"
196+
"GetTokenInformation(#{token_handle}, #{token_information}, #{token_information_buf}, " \
197+
"#{return_length}, #{return_length_ptr})"
198198
)
199199
end
200200

0 commit comments

Comments
 (0)