Land #9398, allow UTF-8 module names and authors
commit
c35eb0de31
|
@ -34,10 +34,6 @@ class String
|
|||
def cyan
|
||||
"\e[1;36;40m#{self}\e[0m"
|
||||
end
|
||||
|
||||
def ascii_only?
|
||||
self =~ Regexp.new('[\x00-\x08\x0b\x0c\x0e-\x19\x7f-\xff]', nil, 'n') ? false : true
|
||||
end
|
||||
end
|
||||
|
||||
class Msftidy
|
||||
|
@ -318,10 +314,6 @@ class Msftidy
|
|||
end
|
||||
end
|
||||
|
||||
if not mod_title.ascii_only?
|
||||
error("Please avoid unicode or non-printable characters in module title.")
|
||||
end
|
||||
|
||||
# Since we're looking at the module title, this line clearly cannot be
|
||||
# the author block, so no point to run more code below.
|
||||
next
|
||||
|
@ -355,10 +347,6 @@ class Msftidy
|
|||
error("No Twitter handles, please. Try leaving it in a comment instead.")
|
||||
end
|
||||
|
||||
if not author_name.ascii_only?
|
||||
error("Please avoid unicode or non-printable characters in Author")
|
||||
end
|
||||
|
||||
unless author_name.empty?
|
||||
author_open_brackets = author_name.scan('<').size
|
||||
author_close_brackets = author_name.scan('>').size
|
||||
|
@ -541,10 +529,6 @@ class Msftidy
|
|||
src_ended = true if ln =~ /^__END__$/
|
||||
next if src_ended
|
||||
|
||||
if ln =~ /[\x00-\x08\x0b\x0c\x0e-\x19\x7f-\xff]/
|
||||
error("Unicode detected: #{ln.inspect}", idx)
|
||||
end
|
||||
|
||||
if ln =~ /[ \t]$/
|
||||
warn("Spaces at EOL", idx)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue