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

README: Update instructions for generating a new app #1223

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Unreleased

* Require `--skip-rubocop` in favor of our [linting configuration][]

[linting configuration]: https://github.com/thoughtbot/suspenders/blob/main/FEATURES.md#linting

20240516.0 (May, 16, 2024)

"Tailored" release
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,6 +49,7 @@ Alternatively, if you're using our [dotfiles][], then you can just run `rails ne
app_name`, or create your own [railsrc][] file with the following configuration:

```
--skip_rubocop
--skip-test
--database=postgresql
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
Expand All @@ -57,6 +61,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

Expand Down
3 changes: 2 additions & 1 deletion lib/generators/suspenders/install/web_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class WebGenerator < Rails::Generators::Base
This generatator is intended to be invoked as part of an [application template][].

```
rails new suspenders_qa \
rails new <app_name> \
--skip-rubocop \\
--skip-test \
-d=postgresql \
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
Expand Down
3 changes: 2 additions & 1 deletion lib/install/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
stevepolitodesign marked this conversation as resolved.
Show resolved Hide resolved
after_bundle do
gem_group :development, :test do
gem "suspenders"
Expand All @@ -42,6 +42,7 @@ def apply_template!
=== Please use the correct options ===

rails new <app_name> \\
--skip-rubocop \\
--skip-test \\
-d=postgresql \\
-m=https://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
Expand Down