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:
commit
7c3378b2e6
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user