Skip to content

Commit

Permalink
[Fix rubocop#4168] Removed shorthand no-color option -n
Browse files Browse the repository at this point in the history
This option was broken in a5ce6d and the community decided to remove it. Here's why:
* Nobody used it. It has been broken for over a year before it was noticed it's broken
* `-n` is not the most intuitive option for disabling color
* There is no plain way to fix it
  • Loading branch information
sadovnik committed Mar 31, 2017
1 parent e50e7ad commit 832de17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Changes

* [#4219](https://github.com/bbatsov/rubocop/issues/4219): Add a link to style guide for `Style/IndentationConsistency` cop. ([@pocke][])
* [#4168](https://github.com/bbatsov/rubocop/issues/4168): Removed `-n` option. ([@sadovnik][])

### Bug fixes

Expand Down Expand Up @@ -2716,3 +2717,4 @@
[@betesh]: https://github.com/betesh
[@dpostorivo]: https://github.com/dpostorivo
[@konto-andrzeja]: https://github.com/konto-andrzeja
[@sadovnik]: https://github.com/sadovnik
2 changes: 1 addition & 1 deletion lib/rubocop/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def add_boolean_flags(opts) # rubocop:disable Metrics/MethodLength
end
option(opts, '-a', '--auto-correct')

option(opts, '-n', '--[no-]color') { |c| @options[:color] = c }
option(opts, '--[no-]color') { |c| @options[:color] = c }

option(opts, '-v', '--version')
option(opts, '-V', '--verbose-version')
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def abs(path)
-R, --rails Run extra Rails cops.
-l, --lint Run only lint cops.
-a, --auto-correct Auto-correct offenses.
-n, --[no-]color Force color output on or off.
--[no-]color Force color output on or off.
-v, --version Display version.
-V, --verbose-version Display verbose version.
-s, --stdin Pipe source from STDIN.
Expand Down

0 comments on commit 832de17

Please sign in to comment.