Skip to content

Commit

Permalink
Mark unsafe for Style/OptionalArguments cop
Browse files Browse the repository at this point in the history
This PR marks unsafe for `Style/OptionalArguments` cop because
changing method signature makes interface incompatible.
The incompatibility between good example and bad example shows that.
  • Loading branch information
koic authored and bbatsov committed May 10, 2020
1 parent 04039d8 commit ee2d393
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -39,6 +39,7 @@
* [#4245](https://github.com/rubocop-hq/rubocop/issues/4245): **(Breaking)** Inspect all files given on command line unless `--only-recognized-file-types` is given. ([@jonas054][])
* [#7390](https://github.com/rubocop-hq/rubocop/issues/7390): **(Breaking)** Enabling a cop overrides disabling its department. ([@jonas054][])
* [#7936](https://github.com/rubocop-hq/rubocop/issues/7936): Mark `Lint/BooleanSymbol` as unsafe. ([@laurmurclar][])
* [#7948](https://github.com/rubocop-hq/rubocop/pull/7948): Mark unsafe for `Style/OptionalArguments`. ([@koic][])

## 0.82.0 (2020-04-16)

Expand Down
2 changes: 2 additions & 0 deletions config/default.yml
Expand Up @@ -3435,7 +3435,9 @@ Style/OptionalArguments:
of the argument list.
StyleGuide: '#optional-arguments'
Enabled: true
Safe: false
VersionAdded: '0.33'
VersionChanged: '0.83'

Style/OrAssignment:
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/style/optional_arguments.rb
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Cop
module Style
# This cop checks for optional arguments to methods
# that do not come at the end of the argument list
# that do not come at the end of the argument list.
#
# @example
# # bad
Expand Down
4 changes: 2 additions & 2 deletions manual/cops_style.md
Expand Up @@ -5024,10 +5024,10 @@ SuspiciousParamNames | `options`, `opts`, `args`, `params`, `parameters` | Array

Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---
Enabled | Yes | No | 0.33 | -
Enabled | No | No | 0.33 | 0.83

This cop checks for optional arguments to methods
that do not come at the end of the argument list
that do not come at the end of the argument list.

### Examples

Expand Down

0 comments on commit ee2d393

Please sign in to comment.