-
Notifications
You must be signed in to change notification settings - Fork 21.9k
Apply autocorrection by RuboCop to files generated by bin/rails generate
#50506
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
Apply autocorrection by RuboCop to files generated by bin/rails generate
#50506
Conversation
Love the concept, but would like if we could package up the code needed to accomplish this. There's a little too much logic code to have in the config file. |
…rate` ## Motivation / Background RuboCop has now been included by default (rails#50456). By adding the following tip to the default configuration, user can apply RuboCop's autocorrection to code generated by `bin/rails generate` (e.g., migration file): https://github.com/rubocop/rubocop-rails#rails-configuration-tip This means that the generated files will be formatted according to user's .rubocop.yml custom configuration. ## Detail Since `bin/rails generate` and `bin/rubocop` are used only in the development environment, the target files are limited to only `config/environments/development.rb`. ## Additional information This feature was introduced in Rails 6.1 by rails#38870.
85c1ca9
to
5409a89
Compare
Sure! I have packaged it as |
railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
Outdated
Show resolved
Hide resolved
* main: Add brakeman as development dependency Fix skipped rubocop test typo (rails#50519) Update the puma startup message docs: remove unneeded whitespace from start of code blocks Add changelog entry for rails#50512 Add step to keep screenshots of failed system tests Fix name casing ✂️ cut trailing whitespace Switch to headless chrome by default (rails#50512) Fix generator output paths New default files Errant debug puts Add changelog entry for rails#50505 [ci skip] (rails#50513) Default to creating GitHub CI files (rails#50508) Remove unnecessary require Fix railspect not validating alphabetical order
* main: Add a default yield :head to layouts/application.html.erb (rails#50527) Switch to new enum syntax in example code [ci-skip] Utilize new enum syntax Apply autocorrection by RuboCop to files generated by `bin/rails generate` (rails#50506) Add brakeman as development dependency Fix skipped rubocop test typo (rails#50519) Update the puma startup message docs: remove unneeded whitespace from start of code blocks Add changelog entry for rails#50512 Remove unnecessary require Fix railspect not validating alphabetical order
I made a PR here #53138 |
…rate` (rails#50506) * Apply autocorrection by RuboCop to files generated by `bin/rails generate` ## Motivation / Background RuboCop has now been included by default (rails#50456). By adding the following tip to the default configuration, user can apply RuboCop's autocorrection to code generated by `bin/rails generate` (e.g., migration file): https://github.com/rubocop/rubocop-rails#rails-configuration-tip This means that the generated files will be formatted according to user's .rubocop.yml custom configuration. ## Detail Since `bin/rails generate` and `bin/rubocop` are used only in the development environment, the target files are limited to only `config/environments/development.rb`. ## Additional information This feature was introduced in Rails 6.1 by rails#38870.
Motivation / Background
RuboCop has now been included by default (#50456). By adding the following tip to the default configuration, user can apply RuboCop's autocorrection to code generated by
bin/rails generate
(e.g., migration file):https://github.com/rubocop/rubocop-rails#rails-configuration-tip
This means that the generated files will be formatted according to user's .rubocop.yml custom configuration.
Detail
Since
bin/rails generate
andbin/rubocop
are used only in the development environment, the target files are limited to onlyconfig/environments/development.rb
.Additional information
This feature was introduced in Rails 6.1 by #38870.
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]