Skip to content

Conversation

@Earlopain
Copy link
Contributor

Fixes #14499

The dstr parts also need to have their content adjusted since they may contains strings.

This slightly changes one autocorrect expectation, but the parens inside of the interpolation
are redundant so there is no problem removing them.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

"\#{#{part.source}}"
end
adjust_str(part)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nits: The following one-liner is simpler.

interpolated_parts = parts.map { |part| adjust_str(part) }

…ion` with escaped quotes and interpolation

The dstr parts also need to have their content adjusted since they
may contains strings.

This slightly changes one autocorrect expectation, but
the parens inside of the interpolation
are redundant so there is no problem removing them.
@Earlopain Earlopain force-pushed the string-concat-escaped branch from 3776724 to 2f2f63a Compare September 2, 2025 15:32
@koic koic merged commit 9a82957 into rubocop:master Sep 2, 2025
22 checks passed
@Earlopain Earlopain deleted the string-concat-escaped branch September 3, 2025 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Style/StringConcatenation autocorrect triggers Lint/Syntax error

2 participants