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

Remove extra empty line #30022

Merged
merged 1 commit into from
Aug 4, 2017
Merged

Conversation

y-yagi
Copy link
Member

@y-yagi y-yagi commented Jul 31, 2017

before

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.4.1'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails'

after

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.4.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0.alpha'

@rails-bot
Copy link

r? @eileencodes

(@rails-bot has picked a reviewer for you, use r? to override)

@@ -1,6 +1,6 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby <%= "'#{RUBY_VERSION}'" %>
ruby <%= "'#{RUBY_VERSION}'" -%>
Copy link

Choose a reason for hiding this comment

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

While this works for bundle exec rails new destination, since that includes a gem.comment (# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'), if you do bundle exec rails new destination --dev with your change, there's no empty line at all after ruby '2.4.1'. Can you instead remove the empty line following <% if gem.comment -%>? It then gives a single blank line in both cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

The empty line following <% if gem.comment -%> is required when commenting in a loop.
If there is no empty line, the comment will collapse as shown below.

# Use sqlite3 as the database for Active Record
gem 'sqlite3'# Use Puma as the app server
gem 'puma', '~> 3.7'# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'# See https://github.com/rails/execjs#readme for more supported runtimes

So, instead of remove this emptyline, I fixed by adding a empty line to the beginning.

@kaspth
Copy link
Contributor

kaspth commented Aug 1, 2017

I kinda like it with the extra newline to separate the setup and the raw gems/groups below.

What I'd want here is one newline before the ruby statement though.

@lugray
Copy link

lugray commented Aug 1, 2017

I kinda like it with the extra newline to separate the setup and the raw gems/groups below.

A Gemfile is still ruby, and rails coding style disallows more than one empty line in a row. I agree with the change.

@y-yagi
Copy link
Member Author

y-yagi commented Aug 1, 2017

What I'd want here is one newline before the ruby statement though.

Looks good. I added.

@eileencodes eileencodes merged commit e3edbd6 into rails:master Aug 4, 2017
@y-yagi y-yagi deleted the remove_extra_empty_line branch August 4, 2017 13:18
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.

None yet

5 participants