-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Quiet mode? (suppress all output when no offenses) #1583
Comments
What's the use case for such an option? One alternate solution I see is to redirect all output to a file and later read it if necessary. You can check RuboCop's exit code to see if there were any offences. rubocop > /tmp/rubocop.log
[ $? -ne 0 ] && cat /tmp/rubocop.log EDIT: I believe outputting nothing if the program ran successfully matches the UNIX philosophy. Is that why you want this flag? |
Aside from a unix-y aesthetic of "succeed quietly," I want to alias rspec on my dev box to also run rubocop. (Because I never remember to run it on my own!) So I want it to nag me about formatting ASAP, but I don't want to see the clutter when I'm a good boy. |
$ rubocop -V |
Closing due to lack of activity. |
The other use case is when using |
So basically
Correct, @pvdb? |
Reopening due to renewed interest. Might take a stab at it tonight. |
If you want to build on/steal/mutate Issue #1593 , feel free! |
For context, the "succeed quietly" guideline @dhempy was referring to is also known as "The Rule of Silence", a long-standing, KISS-inspired design rule part of the Unix philosophy: Rule of Silence
|
I am writing a Rails generator that uses Rubocop to clean up the file output before it generates the files. It would be helpful to have an option to suppress ALL the output. |
Another use case: I run Rubocop in Update: Ahh! |
Is there a way to have rubocop output nothing if no offenses are found?
I'm going to write a formatter to do this, but it seems like this would be a good command line option.
If I've overlooked this functionality already in rubocop, please let me know.
The text was updated successfully, but these errors were encountered: