Skip to content

Commit c35eb0d

Browse files
committed
Land rapid7#9398, allow UTF-8 module names and authors
2 parents 65781ef + 6aebc1f commit c35eb0d

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

tools/dev/msftidy.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ def green
3434
def cyan
3535
"\e[1;36;40m#{self}\e[0m"
3636
end
37-
38-
def ascii_only?
39-
self =~ Regexp.new('[\x00-\x08\x0b\x0c\x0e-\x19\x7f-\xff]', nil, 'n') ? false : true
40-
end
4137
end
4238

4339
class Msftidy
@@ -318,10 +314,6 @@ def check_badchars
318314
end
319315
end
320316

321-
if not mod_title.ascii_only?
322-
error("Please avoid unicode or non-printable characters in module title.")
323-
end
324-
325317
# Since we're looking at the module title, this line clearly cannot be
326318
# the author block, so no point to run more code below.
327319
next
@@ -355,10 +347,6 @@ def check_badchars
355347
error("No Twitter handles, please. Try leaving it in a comment instead.")
356348
end
357349

358-
if not author_name.ascii_only?
359-
error("Please avoid unicode or non-printable characters in Author")
360-
end
361-
362350
unless author_name.empty?
363351
author_open_brackets = author_name.scan('<').size
364352
author_close_brackets = author_name.scan('>').size
@@ -541,10 +529,6 @@ def check_lines
541529
src_ended = true if ln =~ /^__END__$/
542530
next if src_ended
543531

544-
if ln =~ /[\x00-\x08\x0b\x0c\x0e-\x19\x7f-\xff]/
545-
error("Unicode detected: #{ln.inspect}", idx)
546-
end
547-
548532
if ln =~ /[ \t]$/
549533
warn("Spaces at EOL", idx)
550534
end

0 commit comments

Comments
 (0)