Skip to content

Commit

Permalink
[Fix #9989] Mark unsafe auto-correct for Style/CommentedKeyword
Browse files Browse the repository at this point in the history
Fixes #9989

This PR mark unsafe auto-correct for `Style/CommentedKeyword`
because it may remove meaningful comments.
  • Loading branch information
koic authored and bbatsov committed Aug 12, 2021
1 parent 0114ebc commit ea7088e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
@@ -0,0 +1 @@
* [#9989](https://github.com/rubocop/rubocop/issues/9989): Mark `Style/CommentedKeyword` as unsafe auto-correction. ([@koic][])
3 changes: 2 additions & 1 deletion config/default.yml
Expand Up @@ -3155,8 +3155,9 @@ Style/CommentAnnotation:
Style/CommentedKeyword:
Description: 'Do not place comments on the same line as certain keywords.'
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.51'
VersionChanged: '1.7'
VersionChanged: '<<next>>'

Style/ConditionalAssignment:
Description: >-
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/style/commented_keyword.rb
Expand Up @@ -12,6 +12,7 @@ module Style
#
# Auto-correction removes comments from `end` keyword and keeps comments
# for `class`, `module`, `def` and `begin` above the keyword.
# It is marked as unsafe auto-correction as it may remove meaningful comments.
#
# @example
# # bad
Expand Down

0 comments on commit ea7088e

Please sign in to comment.