Skip to content

Commit

Permalink
Remove a redundant blank line from Gemfile of new app
Browse files Browse the repository at this point in the history
## Motivation / Background

Continuous Integrating rubocop-rails_config after upgrading from Rails 7.0.7.2 to Rails 7.0.8 now fails:

```console
(snip)
rubocop --except=Style/StringLiterals,Style/FrozenStringLiteralComment .
cp ./test/fixture/.rubocop.yml rails_test/.rubocop.yml
cd rails_test
Inspecting 28 files
C...........................

Offenses:

Gemfile:71:1: C: [Correctable] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.

28 files inspected, 1 offense detected, 1 offense autocorrectable
rake aborted!
```

https://github.com/toshimaru/rubocop-rails_config/actions/runs/6167995304/job/16739825926

Upon checking, redundant blank was added from version 7.0.8. This was `gem "webdrivers"` before 7.0.7.2.

### Rails 7.0.7.2

```console
$ ruby -v
ruby 3.3.0dev (2023-09-08T16:09:30Z master af5df9ee5e) [x86_64-darwin22]

$ cat Gemfile
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "7.0.7.2"

$ bundle install
(snip)

$ bundle exec rails new example && cd $_
(snip)

% tail -n5 Gemfile
  # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
  gem "capybara"
  gem "selenium-webdriver"
  gem "webdrivers"
end
```

### Rails 7.0.8

```console
$ cat Gemfile
# frozen_string_literal: true

source "https://rubygems.org"

gem "rails", "7.0.8"

$ bundle install
(snip)

$ bundle exec rails new example && cd $_
(snip)

% tail -n5 Gemfile
  # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
  gem "capybara"
  gem "selenium-webdriver"

end
```

This is reproduced with Rails 7.0.8, Rails 7.1.0.beta1 and the main branch.

I understand this might not be of utmost importance, but I would appreciate
it if it could be backported to the Rails 7.0 branch, if possible.

## Detail

The blank line is filled in by rails#48847.
This PR removes the redundant blank line from Gemfile of new app.
  • Loading branch information
koic committed Sep 13, 2023
1 parent 4986cfb commit f47d082
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -63,6 +63,6 @@ group :test do
gem "selenium-webdriver"
<%- if RUBY_VERSION < "3.0" -%>
gem "webdrivers"
<% end %>
<%- end -%>
end
<%- end -%>

0 comments on commit f47d082

Please sign in to comment.