Skip to content
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

Mark unsafe for Style/OptionalArguments cop #7948

Merged
merged 1 commit into from May 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -38,6 +38,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