Check source files for broken (read: not set to 8) tabstop settings.

Change-Id: I60e77a67189e7446f8c5ffd0add803cca10b4b57
Reviewed-on: https://code.wireshark.org/review/14345
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Jeff Morriss 2016-03-04 09:48:11 -05:00 committed by Michael Mann
parent 1e289cb906
commit be25474c94
1 changed files with 15 additions and 0 deletions

View File

@ -2056,6 +2056,21 @@ while ($_ = $ARGV[0])
print STDERR "Warning: ".$filename." has an SVN Id tag. Please remove it!\n";
}
if (($fileContents =~ m{ tab-width:\s*[0-7|9]+ | tabstop=[0-7|9]+ | tabSize=[0-7|9]+ }xo))
{
# To quote Icf0831717de10fc615971fa1cf75af2f1ea2d03d :
# HT tab stops are set every 8 spaces on UN*X; UN*X tools that treat an HT character
# as tabbing to 4-space tab stops, or that even are configurable but *default* to
# 4-space tab stops (I'm looking at *you*, Xcode!) are broken. tab-width: 4,
# tabstop=4, and tabSize=4 are errors if you ever expect anybody to look at your file
# with a UN*X tool, and every text file will probably be looked at by a UN*X tool at
# some point, so Don't Do That.
#
# Can I get an "amen!"?
print STDERR "Error: Found modelines with tabstops set to something other than 8 in " .$filename."\n";
$errorCount++;
}
# Remove all the C-comments
$fileContents =~ s{ $CComment } []xog;