Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates Style/Alias to prefer alias_method #196

Merged
merged 1 commit into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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