Land #2935 - msftidy for nokogiri

bug/bundler_fix
sinn3r 2014-02-02 13:42:26 -06:00
commit 60dcc43d8d
No known key found for this signature in database
GPG Key ID: 2384DB4EF06F730B
1 changed files with 13 additions and 0 deletions

View File

@ -105,6 +105,18 @@ class Msftidy
end
end
def check_nokogiri
msg = "Requiring Nokogiri in modules can be risky, use REXML instead."
has_nokogiri = false
@source.each_line do |line|
if line =~ /^\s*(require|load)\s+['"]nokogiri['"]/
has_nokogiri = true
break
end
end
error(msg) if has_nokogiri
end
def check_ref_identifiers
in_super = false
in_refs = false
@ -489,6 +501,7 @@ def run_checks(full_filepath)
tidy = Msftidy.new(full_filepath)
tidy.check_mode
tidy.check_shebang
tidy.check_nokogiri
tidy.check_ref_identifiers
tidy.check_old_keywords
tidy.check_verbose_option