Skip to content

Commit

Permalink
Updates Style/Alias to prefer alias_method
Browse files Browse the repository at this point in the history
- Fixes standardrb#185
- Added line autocorrectable files to validate that the change happens
  • Loading branch information
Jennifer Konikowski committed Sep 1, 2020
1 parent aba3fa4 commit 8981630
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ Standard/SemanticBlocks:

Style/Alias:
Enabled: true
EnforcedStyle: prefer_alias
EnforcedStyle: prefer_alias_method

Style/AndOr:
Enabled: true
Expand Down
3 changes: 1 addition & 2 deletions test/fixture/cli/autocorrectable-bad.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}

class Something

alias do_more_stuff do_stuff

def do_stuff( a,b,c )
maths_and_stuff = 4 +
Expand Down Expand Up @@ -75,4 +75,3 @@ def setup_fog_credentials(config)
end

end

2 changes: 2 additions & 0 deletions test/fixture/cli/autocorrectable-good.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
}

class Something
alias_method :do_more_stuff, :do_stuff

def do_stuff(a, b, c)
maths_and_stuff = 4 +
5 +
Expand Down

0 comments on commit 8981630

Please sign in to comment.