Skip to content

Commit

Permalink
[Fixes #7914] Style/SafeNavigation marked as having unsafe auto-corre…
Browse files Browse the repository at this point in the history
…ction.
  • Loading branch information
marcandre committed Sep 20, 2020
1 parent fbf1966 commit 760d98b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@
### Changes

* [#8489](https://github.com/rubocop-hq/rubocop/issues/8489): Exclude method `respond_to_missing?` from `OptionalBooleanParameter` cop. ([@em-gazelle][])
* [#7914](https://github.com/rubocop-hq/rubocop/issues/7914): Style/SafeNavigation marked as having unsafe auto-correction. ([@marcandre][])

## 0.91.0 (2020-09-15)

Expand Down
3 changes: 3 additions & 0 deletions config/default.yml
Expand Up @@ -3988,6 +3988,8 @@ Style/SafeNavigation:
This cop transforms usages of a method call safeguarded by
a check for the existence of the object to
safe navigation (`&.`).
Auto-correction is unsafe as it assumes the object will
be `nil` or truthy, but never `false`.
Enabled: true
VersionAdded: '0.43'
VersionChanged: '0.77'
Expand All @@ -4000,6 +4002,7 @@ Style/SafeNavigation:
- presence
- try
- try!
SafeAutoCorrect: false

Style/Sample:
Description: >-
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/cops_style.adoc
Expand Up @@ -8611,7 +8611,7 @@ end

| Enabled
| Yes
| Yes
| Yes (Unsafe)
| 0.43
| 0.77
|===
Expand Down

0 comments on commit 760d98b

Please sign in to comment.