From 832487cad784c01f57684b162b6563204ea41433 Mon Sep 17 00:00:00 2001 From: William Vu Date: Thu, 16 Apr 2015 18:00:08 -0500 Subject: [PATCH] Consolidate on one check and fix false positives --- tools/msftidy.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/msftidy.rb b/tools/msftidy.rb index bd160a8ebe..824db783a9 100755 --- a/tools/msftidy.rb +++ b/tools/msftidy.rb @@ -546,9 +546,7 @@ class Msftidy end if ln =~ /^\s*fail_with\(/ - if ln =~ /^\s*fail_with\(['"].+['"]\)/ - error("fail_with requires a Failure:: reason as first parameter: #{ln}", idx) - elsif ln !~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),.+\)/ + unless ln =~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),/ error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx) end end