Skip to content

Commit

Permalink
Fix grammar in Layout/LineContinuationLeadingSpace offense messages
Browse files Browse the repository at this point in the history
Use "of <the> next/previous line" instead of "of next/previous line".
  • Loading branch information
dvandersluis authored and bbatsov committed Dec 3, 2024
1 parent c7dfa74 commit 1b6aded
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions lib/rubocop/cop/layout/line_continuation_leading_space.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ def trailing_offense_range(end_of_first_line, matches)

def message(_range)
if enforced_style_leading?
'Move trailing spaces to the start of next line.'
'Move trailing spaces to the start of the next line.'
else
'Move leading spaces to the end of previous line.'
'Move leading spaces to the end of the previous line.'
end
end

Expand Down
46 changes: 23 additions & 23 deletions spec/rubocop/cop/layout/line_continuation_leading_space_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
expect_offense(<<~'RUBY')
'this text is too' \
' long'
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -21,7 +21,7 @@
expect_offense(<<~'RUBY')
'this text is too' \
' long'
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -34,7 +34,7 @@
expect_offense(<<~'RUBY')
'this text contains a lot of' \
' spaces'
^^^^^^^^^^^^^^^ Move leading spaces to the end of previous line.
^^^^^^^^^^^^^^^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -47,9 +47,9 @@
expect_offense(<<~'RUBY')
'this text is too' \
' long' \
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
' long long'
^^ Move leading spaces to the end of previous line.
^^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -64,7 +64,7 @@
something_unrelated_to_the_line_continuation_below
'this text is too' \
' long'
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -78,7 +78,7 @@
expect_offense(<<~'RUBY')
long_method_name 'this text is too' \
' long' do
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
end
RUBY

Expand All @@ -94,7 +94,7 @@
long_method_name(
'this text is too' \
' long'
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
)
RUBY

Expand Down Expand Up @@ -126,7 +126,7 @@
"foo
bar" \
" baz"
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -153,7 +153,7 @@
expect_offense(<<~'RUBY')
"foo #{bar}" \
' long'
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -166,7 +166,7 @@
expect_offense(<<~'RUBY')
'this line is' \
" #{foo}"
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -193,7 +193,7 @@
expect_offense(<<~'RUBY')
"foo #{'bar' \
' baz'}"
^ Move leading spaces to the end of previous line.
^ Move leading spaces to the end of the previous line.
RUBY

expect_correction(<<~'RUBY')
Expand All @@ -210,7 +210,7 @@
it 'registers an offense when 1st line has one trailing space' do
expect_offense(<<~'RUBY')
'this text is too ' \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
'long'
RUBY

Expand All @@ -224,7 +224,7 @@
expect_offense(<<~'RUBY')
'this text is too' \
' very ' \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
'long'
RUBY

Expand All @@ -238,7 +238,7 @@
it 'registers an offense when 1st line has multiple trailing spaces' do
expect_offense(<<~'RUBY')
'this text contains a lot of ' \
^^^^^^^^^^^^^^^ Move trailing spaces to the start of next line.
^^^^^^^^^^^^^^^ Move trailing spaces to the start of the next line.
'spaces'
RUBY

Expand All @@ -251,9 +251,9 @@
it 'registers offenses when 1st and 2nd line has trailing spaces' do
expect_offense(<<~'RUBY')
'this text is too ' \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
'long ' \
^^ Move trailing spaces to the start of next line.
^^ Move trailing spaces to the start of the next line.
'long long'
RUBY

Expand All @@ -268,7 +268,7 @@
expect_offense(<<~'RUBY')
something_unrelated_to_the_line_continuation_below
'this text is too ' \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
'long'
RUBY

Expand All @@ -283,7 +283,7 @@
expect_offense(<<~'RUBY')
long_method_name 'this text is too' \
' very ' \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
'long' do
end
RUBY
Expand All @@ -300,7 +300,7 @@
expect_offense(<<~'RUBY')
long_method_name(
'this text is too ' \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
'long'
)
RUBY
Expand Down Expand Up @@ -336,7 +336,7 @@
it 'registers offenses when 1st line has trailing spaces and 2nd line is interpolated' do
expect_offense(<<~'RUBY')
'foo ' \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
"#{bar} long"
RUBY

Expand All @@ -349,7 +349,7 @@
it 'registers offenses when 1st line has leading spaces and 1st line is interpolated' do
expect_offense(<<~'RUBY')
"this #{foo} is " \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
'long'
RUBY

Expand All @@ -376,7 +376,7 @@
it 'registers an offense for incorrectly formatted multiline interpolated string' do
expect_offense(<<~'RUBY')
"foo #{'bar ' \
^ Move trailing spaces to the start of next line.
^ Move trailing spaces to the start of the next line.
'baz'}"
RUBY

Expand Down

0 comments on commit 1b6aded

Please sign in to comment.