Closed padde closed 10 years ago
Maybe bbatsov/rubocop#1324 will fix the issue for us. Still, it would be useful to be able to pass command line arguments.
hmm, we do not have support for extra flags, but you could add it quite easily somewhere around here: https://github.com/jish/pre-commit/blob/master/lib/plugins/pre_commit/checks/rubocop.rb#L24
@jish what do you think?
Yea, I'm not sure what the correct solution is here. If you want team-wide configuration, then .rubycop.yml
would be the best solution -- although, it looks like your specific option is not supported in their config file :(
We do support writing custom checks in config/pre-commit.rb
. If you enable the local
check, then you can run your own custom Ruby code, and all contributors to the project will run the same code, and it can be tracked using source control.
@mpapis @jish sorry to bother you again. Have you decided yet how to proceed?
It's good to know that there's a plan B but going with the local check, we'd basically have to re-write and hard code the entire rubocop check for all of our projects, just to pass a command line flag. Of course we could make it into a gem, but all of this seems overkill :-(
I'd be happy to work on a PR, but only if this whole thing is even an option for you guys. Let me know what you think. Thanks!
looks like rubocop
can not decide on the ticket, I think we should be for adding extra command line flags - @jish what do you think?
@padde do you want to have have some fun with the PR or we should do it?
@mpapis I'd be happy to give it a try ;-)
@mpapis I've sent my PR, I think we can continue the discussion there, so feel free to close this issue.
The title says it all: Is it possible to pass command line options to Rubocop?
Specifically, we need to set
--fail-level error
, since we want everything less severe than anerror
not to prevent a commit. Unfortunately, Rubocop only provides this as a command line option, but not as an option in the YAML config file. Thanks!