diff --git a/README.md b/README.md index 3694b164..a16f4311 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,11 @@ application with Suspenders. We skip the [default test framework][] in favor of [RSpec][], and [prefer PostgreSQL][] as our database. +We skip [RuboCop rules by default][] in favor of our [holistic linting rules][]. + ``` rails new app_name \ + --skip_rubocop \ --skip-test \ -d=postgresql \ -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: [prefer PostgreSQL]: https://github.com/thoughtbot/dotfiles/pull/728 [dotfiles]: https://github.com/thoughtbot/dotfiles [railsrc]: https://github.com/rails/rails/blob/7f7f9df8641e35a076fe26bd097f6a1b22cb4e2d/railties/lib/rails/generators/rails/app/USAGE#L5C1-L7 +[RuboCop rules by default]: https://guides.rubyonrails.org/v7.2/7_2_release_notes.html#add-omakase-rubocop-rules-by-default +[holistic linting rules]: https://github.com/thoughtbot/suspenders/blob/main/FEATURES.md#linting ### With Existing Rails Applications diff --git a/lib/install/web.rb b/lib/install/web.rb index ac73bcdb..e1639958 100644 --- a/lib/install/web.rb +++ b/lib/install/web.rb @@ -22,7 +22,7 @@ def apply_template! fail Rails::Generators::Error, message end - if options[:database] == "postgresql" && options[:skip_test] + if options[:database] == "postgresql" && options[:skip_test] && options[:skip_rubocop] after_bundle do gem_group :development, :test do gem "suspenders" @@ -42,6 +42,7 @@ def apply_template! === Please use the correct options === rails new \\ + --skip-rubocop \\ --skip-test \\ -d=postgresql \\ -m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb