Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix extra blank line when no error_highlight #49666

Merged

Conversation

skipkayhil
Copy link
Member

@skipkayhil skipkayhil commented Oct 17, 2023

Motivation / Background

A new condition was recently added to exclude error_highlight from the Gemfile when the Ruby version is 3.2 or greater. However, this change leads to an extra blank line after gem "spring" on Ruby 3.2+. This could also happen to new apps generated on Rubies < 3.1, but my guess is that is less common.

Detail

This commit fixes the issue by moving the extra blank line into the condition.

Additional Information

I think this should definitely be backported to 7.1, and I can see an argument for 7.0 as well since a 7.0 app generated on ruby 2.7 or 3.0 would have the same issue.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

A new condition was recently [added][1] to exclude error_highlight from
the Gemfile when the Ruby version is 3.2 or greater. However, this
change leads to an extra blank line after `gem "spring"` on Ruby 3.2+.
This could also happen to new apps generated on Rubies < 3.1, but my
guess is that is less common.

This commit fixes the issue by moving the extra blank line into the
condition.

[1]: d7b3951
@rails-bot rails-bot bot added the railties label Oct 17, 2023
@jonathanhefner jonathanhefner merged commit c139e52 into rails:main Oct 17, 2023
4 checks passed
@jonathanhefner
Copy link
Member

jonathanhefner commented Oct 17, 2023

Thank you, @skipkayhil! ✂️

Backported to 7-1-stable in 5f2a1f1.

I can see an argument for 7.0 as well since a 7.0 app generated on ruby 2.7 or 3.0 would have the same issue.

7-0-stable does not appear to have this Gemfile entry.

jonathanhefner added a commit that referenced this pull request Oct 17, 2023
Fix extra blank line when no error_highlight

(cherry picked from commit c139e52)
@skipkayhil skipkayhil deleted the hm-fix-error-highlight-spacing branch October 17, 2023 05:07
@skipkayhil
Copy link
Member Author

7-0-stable does not appear to have this Gemfile entry.

🤦 thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants