Skip to content

Commit

Permalink
Merge pull request #196 from jmkoni/Issue-185_prefer-alias_method
Browse files Browse the repository at this point in the history
Updates Style/Alias to prefer alias_method
  • Loading branch information
searls committed Sep 1, 2020
2 parents aba3fa4 + 8981630 commit c8fba57
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 c8fba57

Please sign in to comment.