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
Add rubocop-rails-omakase to new Rails applications #50486
Conversation
This setups a basic rubocop config for new rails apps using the `rubocop-rails-omakase` gem: https://github.com/rails/rubocop-rails-omakase It can be skipped with the `--skip-rubocop` flag.
Based on rubygems/rubygems#6915 This occurs especially when generating a new rails app within a rails checkout: https://github.com/rails/rails/actions/runs/7360317953/job/20036287021#step:4:171
railties/lib/rails/generators/rails/app/templates/.rubocop.yml.tt
Outdated
Show resolved
Hide resolved
This way we get the permissions and shebang for free.
Since we were calling the rubocop command before, and not the patched binstub.
railties/lib/rails/generators/rails/app/templates/.rubocop.yml.tt
Outdated
Show resolved
Hide resolved
Thanks for the review! I was trying to debug the CI failures here, but fell asleep 😴 Looking into them now: |
def test_rubocop_is_skipped_if_required | ||
run_generator [destination_root, "--skip-rubocop"] | ||
|
||
assert_no_gem "rubocop" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be rubocop-rails-omakase
, instead of rubocop
?
-assert_no_gem "rubocop"
+assert_no_gem "rubocop-rails-omakase"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@koic You're right. Raising a PR.
Fixes #50456
This setups a basic rubocop config for new rails apps using the
rubocop-rails-omakase
gem: https://github.com/rails/rubocop-rails-omakaseIt can be skipped with the
--skip-rubocop
flag.