forked from rubocop/rubocop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an incorrect auto-correct for
Layout/LineLength
This PR fixes an incorrect auto-correct for `Layout/LineLength` when using heredoc as the first method argument and omitting parentheses. ```console % cat example.rb foo <<~RUBY, arg RUBY % bundle exec rubocop --only Layout/LineLength -a (snip) Inspecting 1 file C Offenses: example.rb:1:16: C: [Corrected] Layout/LineLength: Line is too long. [16/15] foo <<~RUBY, arg ^ 1 file inspected, 1 offense detected, 1 offense corrected % cat example.rb foo <<~RUBY, arg RUBY % ruby -c example.rb example.rb:1: syntax error, unexpected end-of-input ```
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelog/fix_an_incorrect_autocorrect_for_layout_line_length.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#9882](https://github.com/rubocop/rubocop/pull/9882): Fix an incorrect auto-correct for `Layout/LineLength` when using heredoc as the first method argument and omitting parentheses. ([@koic][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters