1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-11-05 14:57:30 +01:00

Land #4593, msftidy extraneous comma check

This commit is contained in:
William Vu 2015-01-18 00:46:39 -06:00
commit 7c3378b2e6
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743

View File

@ -595,9 +595,21 @@ class Msftidy
def check_invalid_url_scheme
test = @source.scan(/^#.+http\/\/(?:www\.)?metasploit.com/)
unless test.empty?
test.each { |item|
test.each do |item|
info("Invalid URL: #{item}")
}
end
end
end
# This checks looks for extranous commas
# Stuff with comments should match too: , #metasploit module ]
# but it should not match interpolation #{
def check_comma
test = @source.scan(/[^\n]+,(?:\s*#[^{][^\n]+)?\s*[\]\}]/)
unless test.empty?
test.each do |item|
info("Extraneous comma: #{item}")
end
end
end
@ -650,6 +662,7 @@ def run_checks(full_filepath)
tidy.check_sock_get
tidy.check_udp_sock_get
tidy.check_invalid_url_scheme
tidy.check_comma
return tidy
end