Consolidate on one check and fix false positives
parent
40f6b086c2
commit
832487cad7
|
@ -546,9 +546,7 @@ class Msftidy
|
||||||
end
|
end
|
||||||
|
|
||||||
if ln =~ /^\s*fail_with\(/
|
if ln =~ /^\s*fail_with\(/
|
||||||
if ln =~ /^\s*fail_with\(['"].+['"]\)/
|
unless ln =~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),/
|
||||||
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),.+\)/
|
|
||||||
error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx)
|
error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue