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
Rename custom rake task to rubocop:autocorrect
#10709
Rename custom rake task to rubocop:autocorrect
#10709
Conversation
Follow up rubocop#10547. This PR renames custom rake task from `rubocop:auto_correct` to `rubocop:autocorrect`. ## Before ```console rake rubocop # Run RuboCop rake rubocop:auto_correct # Autocorrect RuboCop offenses ``` ## After ```console rake rubocop # Run RuboCop rake rubocop:autocorrect # Autocorrect RuboCop offenses ``` For compatibility, `rubocop:auto_correct` task is left, but the task is deprecated and does not display in `rake -T`. When executed, the following warning will be displayed: ```console % bundle exec rake rubocop:auto_correct rubocop:auto_correct task is deprecated; use rubocop:autocorrect task instead. Running RuboCop... ```
1b6f2c1
to
742f3e4
Compare
Thanks! |
|
||
task(:auto_correct, *args) do |_, task_args| | ||
desc 'Autocorrect RuboCop offenses' | ||
task(:autocorrect, *args) do |_, task_args| | ||
RakeFileUtils.verbose(verbose) do | ||
yield(*[self, task_args].slice(0, task_block.arity)) if task_block | ||
options = full_options.unshift('--autocorrect-all') |
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.
When I saw this PR, I was hoping that the rake task would now default to safe auto corrects only.
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.
@bbatsov Since this has been merged, but not been released yet, how would you feel about a new PR that adds a rubocop:autocorrect_all
task?
The deprecated rubocop:auto_correct
task could invoke this one, and the new rubocop:autocorrect
could be changed to do safe changes only?
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.
I'd be fine with this.
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.
I've opened #10746 to solve it.
…correct_all` Follow up rubocop#10709 (comment). This PR splits deprecated `rubocop:auto_correct` custom rake task into `rubocop:autocorrect` and `rubocop:autocorrect_all`.
…correct_all` Follow up #10709 (comment). This PR splits deprecated `rubocop:auto_correct` custom rake task into `rubocop:autocorrect` and `rubocop:autocorrect_all`.
Follow up #10547.
This PR renames custom rake task from
rubocop:auto_correct
torubocop:autocorrect
.Before
After
For compatibility,
rubocop:auto_correct
task is left, but the task is deprecated and does not display inrake -T
.When executed, the following warning will be displayed:
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.