Skip to content

Commit

Permalink
[Fix #10036] Mark Style/StructInheritance as unsafe auto-correction
Browse files Browse the repository at this point in the history
Fixes #10036.

This PR marks `Style/StructInheritance` as unsafe auto-correction.
  • Loading branch information
koic authored and bbatsov committed Aug 24, 2021
1 parent 04dad00 commit b00265b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
@@ -0,0 +1 @@
* [#10036](https://github.com/rubocop/rubocop/issues/10036): Mark `Style/StructInheritance` as unsafe auto-correction. ([@koic][])
3 changes: 2 additions & 1 deletion config/default.yml
Expand Up @@ -4694,8 +4694,9 @@ Style/StructInheritance:
Description: 'Checks for inheritance from Struct.new.'
StyleGuide: '#no-extend-struct-new'
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.29'
VersionChanged: '0.86'
VersionChanged: '<<next>>'

Style/SwapValues:
Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
Expand Down
3 changes: 3 additions & 0 deletions lib/rubocop/cop/style/struct_inheritance.rb
Expand Up @@ -5,6 +5,9 @@ module Cop
module Style
# This cop checks for inheritance from Struct.new.
#
# It is marked as unsafe auto-correction because it will change the
# inheritance tree (e.g. return value of `Module#ancestors`).
#
# @example
# # bad
# class Person < Struct.new(:first_name, :last_name)
Expand Down

0 comments on commit b00265b

Please sign in to comment.