Skip to content

Commit 00a7e0e

Browse files
README: Update instructions for generating a new app
Closes #1221 The [release of Rails 7.2.0][rails_7_2] introduced its [own linting mechanism][rails-lint]. Unfortunately, this creates a conflict with [our linting mechanism][suspenders-lint]. This is only relevant when running `rails new` with our [application template][]. In order to fix this, we simply require the caller pass `--skip_rubocop`. A future commit could explore re-introducing the system executable to account for our required options, but for now, this fixes the issue. [rails_7_2]: https://guides.rubyonrails.org/v7.2/7_2_release_notes.html [rails-lint]: https://guides.rubyonrails.org/v7.2/7_2_release_notes.html#add-omakase-rubocop-rules-by-default [suspenders-lint]: https://github.com/thoughtbot/suspenders/blob/main/FEATURES.md#linting [application template]: https://github.com/thoughtbot/suspenders/blob/main/lib/install/web.rb
1 parent 2e1196f commit 00a7e0e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ application with Suspenders.
3333
We skip the [default test framework][] in favor of [RSpec][], and [prefer
3434
PostgreSQL][] as our database.
3535

36+
We skip [RuboCop rules by default][] in favor of our [holistic linting rules][].
37+
3638
```
3739
rails new app_name \
40+
--skip_rubocop \
3841
--skip-test \
3942
-d=postgresql \
4043
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
@@ -57,6 +60,8 @@ app_name`, or create your own [railsrc][] file with the following configuration:
5760
[prefer PostgreSQL]: https://github.com/thoughtbot/dotfiles/pull/728
5861
[dotfiles]: https://github.com/thoughtbot/dotfiles
5962
[railsrc]: https://github.com/rails/rails/blob/7f7f9df8641e35a076fe26bd097f6a1b22cb4e2d/railties/lib/rails/generators/rails/app/USAGE#L5C1-L7
63+
[RuboCop rules by default]: https://guides.rubyonrails.org/v7.2/7_2_release_notes.html#add-omakase-rubocop-rules-by-default
64+
[holistic linting rules]: https://github.com/thoughtbot/suspenders/blob/main/FEATURES.md#linting
6065

6166
### With Existing Rails Applications
6267

lib/install/web.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def apply_template!
2222

2323
fail Rails::Generators::Error, message
2424
end
25-
if options[:database] == "postgresql" && options[:skip_test]
25+
if options[:database] == "postgresql" && options[:skip_test] && options[:skip_rubocop]
2626
after_bundle do
2727
gem_group :development, :test do
2828
gem "suspenders"
@@ -42,6 +42,7 @@ def apply_template!
4242
=== Please use the correct options ===
4343
4444
rails new <app_name> \\
45+
--skip-rubocop \\
4546
--skip-test \\
4647
-d=postgresql \\
4748
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb

0 commit comments

Comments
 (0)