From 898163055fd3c16e4438c89a2100fe2e4fd02658 Mon Sep 17 00:00:00 2001 From: Jennifer Konikowski Date: Tue, 1 Sep 2020 08:48:11 -0400 Subject: [PATCH] Updates Style/Alias to prefer alias_method - Fixes #185 - Added line autocorrectable files to validate that the change happens --- config/base.yml | 2 +- test/fixture/cli/autocorrectable-bad.rb | 3 +-- test/fixture/cli/autocorrectable-good.rb | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/base.yml b/config/base.yml index 7319d8c2..a46efac4 100644 --- a/config/base.yml +++ b/config/base.yml @@ -726,7 +726,7 @@ Standard/SemanticBlocks: Style/Alias: Enabled: true - EnforcedStyle: prefer_alias + EnforcedStyle: prefer_alias_method Style/AndOr: Enabled: true diff --git a/test/fixture/cli/autocorrectable-bad.rb b/test/fixture/cli/autocorrectable-bad.rb index 1c3eb488..358c85c7 100644 --- a/test/fixture/cli/autocorrectable-bad.rb +++ b/test/fixture/cli/autocorrectable-bad.rb @@ -13,7 +13,7 @@ } class Something - + alias do_more_stuff do_stuff def do_stuff( a,b,c ) maths_and_stuff = 4 + @@ -75,4 +75,3 @@ def setup_fog_credentials(config) end end - diff --git a/test/fixture/cli/autocorrectable-good.rb b/test/fixture/cli/autocorrectable-good.rb index 6894431d..72b8bdec 100644 --- a/test/fixture/cli/autocorrectable-good.rb +++ b/test/fixture/cli/autocorrectable-good.rb @@ -13,6 +13,8 @@ } class Something + alias_method :do_more_stuff, :do_stuff + def do_stuff(a, b, c) maths_and_stuff = 4 + 5 +