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

RakeTask options for formatter don't remove default #2263

Closed
tigris opened this issue Sep 21, 2015 · 3 comments
Closed

RakeTask options for formatter don't remove default #2263

tigris opened this issue Sep 21, 2015 · 3 comments

Comments

@tigris
Copy link

tigris commented Sep 21, 2015

If you set a formatter in the rake task like below, the "default" formatter isn't removed from the formatter set, and you end up with both formatters. As such there is no way to set a "default" formatter via rake.

RuboCop::RakeTask.new(:rubocop) do |t|
  t.options = %w(--format json)
end
@jonas054
Copy link
Collaborator

There's a special attribute for rake tasks called formatters that you should use instead of options. See https://github.com/bbatsov/rubocop#rake-integration

@tigris
Copy link
Author

tigris commented Sep 22, 2015

You're right. This works as expected. I wonder if the above still sounds like a "bug". Completely up to you, happy to just close it if you want.

@jonas054
Copy link
Collaborator

I think we should issue a warning if -f/--format appears in t.options, so please leave this open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants