Allow for tabs or spaces as indentation

This signals a move to allowing for normal Ruby indentation (2 space
soft tabs). This change will check files for indentation of spaces or of
tabs, since we don't want to fail out all modules quite yet.

For more, see
https://github.com/rapid7/metasploit-framework/wiki/Indentation-Standards
where all details of the conversion plan will be documented in order to
minimize the amount of whitespace conflict we are sure to encounter over
this conversion.
bug/bundler_fix
Tod Beardsley 2013-08-07 11:45:41 -05:00
parent be01cd96a3
commit ef224b175d
1 changed files with 4 additions and 2 deletions

View File

@ -353,8 +353,10 @@ class Msftidy
warn("Spaces at EOL", idx)
end
if (ln.length > 1) and (ln =~ /^([\t ]*)/) and ($1.include?(' '))
warn("Bad indent: #{ln.inspect}", idx)
# Allow tabs or spaces as indent characters, but not both.
# This should check for spaces only on October 8, 2013
if (ln.length > 1) and (ln =~ /^([\t ]*)/) and ($1.match(/\x20\x09|\x09\x20/))
warn("Space-Tab mixed indent: #{ln.inspect}", idx)
end
if ln =~ /\r$/