Warn for tabbed indentation

bug/bundler_fix
Tod Beardsley 2013-10-01 12:22:46 -05:00
parent 9abf727fa6
commit 36d058b28c
No known key found for this signature in database
GPG Key ID: 1EFFB682ADB9F193
1 changed files with 6 additions and 2 deletions

View File

@ -361,12 +361,16 @@ class Msftidy
warn("Spaces at EOL", idx)
end
# Allow tabs or spaces as indent characters, but not both.
# This should check for spaces only on October 8, 2013
# Check for mixed tab/spaces. Upgrade this to an error() soon.
if (ln.length > 1) and (ln =~ /^([\t ]*)/) and ($1.match(/\x20\x09|\x09\x20/))
warn("Space-Tab mixed indent: #{ln.inspect}", idx)
end
# Check for tabs. Upgrade this to an error() soon.
if (ln.length > 1) and (ln =~ /^\x09/)
warn("Tabbed indent: #{ln.inspect}", idx)
end
if ln =~ /\r$/
warn("Carriage return EOL", idx)
end