Skip to content

Commit

Permalink
Switch to default RuboCop LineContinuationLeadingSpace style
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Sep 1, 2024
1 parent db96963 commit 8e1715b
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 43 deletions.
4 changes: 0 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ Gemspec/DevelopmentDependencies:
Gemspec/RequireMFA:
Enabled: false

# Spaces in strings with line continuations go at the beginning of the line.
Layout/LineContinuationLeadingSpace:
EnforcedStyle: leading

# Assume the programmer knows how bracketed block syntax works
Lint/AmbiguousBlockAssociation:
Enabled: false
Expand Down
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w[--format progress]
end

Cucumber::Rake::Task.new('cucumber:wip', 'Run Cucumber features' \
' which are "WORK IN PROGRESS" and' \
' are allowed to fail') do |t|
Cucumber::Rake::Task.new('cucumber:wip', 'Run Cucumber features ' \
'which are "WORK IN PROGRESS" and ' \
'are allowed to fail') do |t|
t.cucumber_opts = %w[--tags @wip:3 --wip]
end

Expand Down
30 changes: 15 additions & 15 deletions lib/aruba/api/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,18 @@ def cd(dir, &block)
#
def expand_path(file_name, dir_string = nil)
unless file_name.is_a?(String) && !file_name.empty?
message = "Filename #{file_name} needs to be a string." \
' It cannot be nil or empty either.' \
" Please use `expand_path('.')` if you want" \
' the current directory to be expanded.'
message = "Filename #{file_name} needs to be a string. " \
'It cannot be nil or empty either. ' \
"Please use `expand_path('.')` if you want " \
'the current directory to be expanded.'

raise ArgumentError, message
end

unless Aruba.platform.directory? File.join(aruba.config.root_directory,
aruba.config.working_directory)
raise "Aruba's working directory does not exist." \
' Maybe you forgot to run `setup_aruba` before using its API.'
raise "Aruba's working directory does not exist. " \
'Maybe you forgot to run `setup_aruba` before using its API.'
end

prefix = file_name[0]
Expand All @@ -169,10 +169,10 @@ def expand_path(file_name, dir_string = nil)
.map { |p| format('"%s"', p) }.join(', ')

raise ArgumentError,
"Fixture \"#{rest}\" does not exist" \
" in fixtures directory \"#{aruba.fixtures_directory}\"." \
' This was the one we found first on your system from all possible' \
" candidates: #{aruba_fixture_candidates}."
"Fixture \"#{rest}\" does not exist " \
"in fixtures directory \"#{aruba.fixtures_directory}\". " \
'This was the one we found first on your system from all possible ' \
"candidates: #{aruba_fixture_candidates}."
end

path
Expand All @@ -194,11 +194,11 @@ def expand_path(file_name, dir_string = nil)
caller_location = caller_locations(1, 1).first
caller_file_line = "#{caller_location.path}:#{caller_location.lineno}"
message =
"Aruba's `expand_path` method was called with an absolute path" \
" at #{caller_file_line}, which is not recommended." \
" The path passed was '#{file_name}'." \
' Change the call to pass a relative path or set' \
' `config.allow_absolute_paths = true` to silence this warning'
"Aruba's `expand_path` method was called with an absolute path " \
"at #{caller_file_line}, which is not recommended. " \
"The path passed was '#{file_name}'. " \
'Change the call to pass a relative path or set ' \
'`config.allow_absolute_paths = true` to silence this warning'
raise UserError, message
end
file_name
Expand Down
4 changes: 2 additions & 2 deletions lib/aruba/matchers/command/be_successfully_executed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
end

failure_message do |_actual|
"Expected `#{@actual}` to succeed" \
' but got non-zero exit status and the following output:' \
"Expected `#{@actual}` to succeed " \
'but got non-zero exit status and the following output:' \
"\n\n#{@old_actual.output}\n"
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/aruba/matchers/command/have_output_size.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
match do |actual|
if actual.respond_to? :size
Aruba.platform.deprecated \
'Application of the have_output_size matcher to a string is deprecated.' \
' Apply the matcher directly to the process object instead'
'Application of the have_output_size matcher to a string is deprecated. ' \
'Apply the matcher directly to the process object instead'
actual_size = actual.size
elsif actual.respond_to? :output
actual_size = actual.output.size
Expand Down
8 changes: 4 additions & 4 deletions lib/aruba/processes/debug_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ def stdin(*); end
# @return [String]
# A predefined string to make users aware they are using the DebugProcess
def stdout(*)
'This is the debug launcher on STDOUT.' \
' If this output is unexpected, please check your setup.'
'This is the debug launcher on STDOUT. ' \
'If this output is unexpected, please check your setup.'
end

# Return stderr
#
# @return [String]
# A predefined string to make users aware they are using the DebugProcess
def stderr(*)
'This is the debug launcher on STDERR.' \
' If this output is unexpected, please check your setup.'
'This is the debug launcher on STDERR. ' \
'If this output is unexpected, please check your setup.'
end

# Write to nothing
Expand Down
6 changes: 3 additions & 3 deletions lib/aruba/processes/spawn_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ def initialize(cmd, exit_timeout, io_wait_timeout, working_directory, # rubocop:
def start
if started?
error_message =
"Command \"#{commandline}\" has already been started." \
' Please `#stop` the command first and `#start` it again.' \
' Alternatively use `#restart`.'
"Command \"#{commandline}\" has already been started. " \
'Please `#stop` the command first and `#start` it again. ' \
'Alternatively use `#restart`.'
raise CommandAlreadyStartedError, error_message
end

Expand Down
8 changes: 4 additions & 4 deletions spec/aruba/matchers/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ def fail_with(message)
it 'provides the correct path value in the message' do
expect { expect(file).to be_a_command_found_in_path }
.to raise_error RSpec::Expectations::ExpectationNotMetError,
"expected that command \"#{file}\" can be found" \
" in PATH \"#{expand_path('.')}\"."
"expected that command \"#{file}\" can be found " \
"in PATH \"#{expand_path('.')}\"."
end
end

Expand All @@ -332,8 +332,8 @@ def fail_with(message)
it 'provides the correct path value in the message' do
expect { expect(file).not_to be_a_command_found_in_path }
.to raise_error RSpec::Expectations::ExpectationNotMetError,
"expected that command \"#{file}\" cannot be found" \
" in PATH \"#{expand_path('.')}\"."
"expected that command \"#{file}\" cannot be found " \
"in PATH \"#{expand_path('.')}\"."
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/aruba/platforms/unix_platform_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
it 'works even when ruby is launched with --disable-gems and --disable-rubyopt' do
aruba_lib = File.expand_path('../../../lib', __dir__)
run_command_and_stop(
"ruby --disable-rubyopt --disable-gems -I#{aruba_lib}" \
" -e 'require \"aruba/platforms/unix_platform\";" \
" Aruba::Platforms::UnixPlatform.match?;'"
"ruby --disable-rubyopt --disable-gems -I#{aruba_lib} " \
"-e 'require \"aruba/platforms/unix_platform\"; " \
"Aruba::Platforms::UnixPlatform.match?;'"
)
expect(last_command_started).to be_successfully_executed
end
Expand Down
6 changes: 3 additions & 3 deletions spec/aruba/platforms/windows_platform_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
it 'works even when ruby is launched with --disable-gems and --disable-rubyopt' do
aruba_lib = File.expand_path('../../../lib', __dir__)
run_command_and_stop(
"ruby --disable-rubyopt --disable-gems -I#{aruba_lib}" \
" -e 'require \"aruba/platforms/windows_platform\";" \
" Aruba::Platforms::WindowsPlatform.match?;'"
"ruby --disable-rubyopt --disable-gems -I#{aruba_lib} " \
"-e 'require \"aruba/platforms/windows_platform\"; " \
"Aruba::Platforms::WindowsPlatform.match?;'"
)
expect(last_command_started).to be_successfully_executed
end
Expand Down

0 comments on commit 8e1715b

Please sign in to comment.