Skip to content

Commit 40f6b08

Browse files
committed
fix regex
1 parent 0815791 commit 40f6b08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/msftidy.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,10 @@ def check_lines
545545
warn("Please use snake case on method names: #{ln}", idx)
546546
end
547547

548-
if ln =~ /fail_with\(/
549-
if ln =~ /fail_with\(['"].+['"]\)/
548+
if ln =~ /^\s*fail_with\(/
549+
if ln =~ /^\s*fail_with\(['"].+['"]\)/
550550
error("fail_with requires a Failure:: reason as first parameter: #{ln}", idx)
551-
elsif ln !~ /fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),.+\)/
551+
elsif ln !~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),.+\)/
552552
error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx)
553553
end
554554
end

0 commit comments

Comments
 (0)