'Rubocop – how can I just display auto-correctable results
I would like to run Rubocop and just see auto-correctable results. The documentation (https://docs.rubocop.org/rubocop/usage/basic_usage.html) indicates this should be possible with a --display-only-correctable flag.
But at the command line rubocop --display-only-correctable
responds:
invalid option: --display-only-correctable
Did you mean? display-only-failed
For usage information, use –help
And from rubocop --help I don’t see any reference to the display-only-correctable flag.
Is it possible to just just display auto-correctable results?
Thanks
Daniel
Solution 1:[1]
@Andy Waite’s comment helped solve it.
I was running rubocop version 1.25.1. The --display-only-correctable flag only arrived arrived in version 1.28.0.
I changed my gemfile from:
gem 'rubocop', '~> 1.25', require: false
to
gem 'rubocop', require: false
then ran
bundle update
now rubocop --display-only-correctable works as expected.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dan SimBed |
