Skip to content

Commit 3300845

Browse files
committed
Land rapid7#5171, fail_with check for msftidy
2 parents 753978f + d494bdd commit 3300845

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/msftidy.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,13 @@ def check_lines
544544
if ln =~ /^\s*def\s+(?:[^\(\)#]*[A-Z]+[^\(\)]*)(?:\(.*\))?$/
545545
warn("Please use snake case on method names: #{ln}", idx)
546546
end
547+
548+
if ln =~ /^\s*fail_with\(/
549+
unless ln =~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),/
550+
error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx)
551+
end
552+
end
553+
547554
end
548555
end
549556

0 commit comments

Comments
 (0)