From ef224b175dd79053e98365c14069f0872c4345d8 Mon Sep 17 00:00:00 2001 From: Tod Beardsley Date: Wed, 7 Aug 2013 11:45:41 -0500 Subject: [PATCH] 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. --- tools/msftidy.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/msftidy.rb b/tools/msftidy.rb index 91a8b9b82e..2057bdc169 100755 --- a/tools/msftidy.rb +++ b/tools/msftidy.rb @@ -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$/