Skip to content

Commit 561f0fd

Browse files
committed
Suppress a RuboCop offense after running rails new with --devcontainer
This PR suppresses the following RuboCop offense when running `rubocop` after generating a new Rails project with `--devcontainer`: ```console $ rails new example --devcontainer $ cd example $ bin/rubocop (snip) Offenses: test/application_system_test_case.rb:14:1: C: [Correctable] Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body end. ``` This PR removes the following redundant blank line by default that cause the offense: ```diff require "test_helper" class ApplicationSystemTestCase < ActionDispatch::SystemTestCase if ENV["CAPYBARA_SERVER_PORT"] served_by host: "rails-app", port: ENV["CAPYBARA_SERVER_PORT"] driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ], options: { browser: :remote, url: "http://#{ENV["SELENIUM_HOST"]}:4444" } else driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] end - end ``` This is a similar issue to rails#52199
1 parent 79f34b9 commit 561f0fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

railties/lib/rails/generators/rails/devcontainer/devcontainer_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def local_rails_mount
150150
end
151151

152152
def system_test_configuration
153-
optimize_indentation(<<-'RUBY', 2)
153+
optimize_indentation(<<-'RUBY', 2).chomp
154154
if ENV["CAPYBARA_SERVER_PORT"]
155155
served_by host: "rails-app", port: ENV["CAPYBARA_SERVER_PORT"]
156156

0 commit comments

Comments
 (0)