aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2016-03-04 09:48:11 -0500
committerMichael Mann <mmann78@netscape.net>2016-03-05 17:46:00 +0000
commitbe25474c941661079a0ed795426b21716d3a7d43 (patch)
tree3b316161633ef511edde55b3c8cf078f53b0ceb7 /tools
parent1e289cb9064c936010a5c85badd715b00ecb555c (diff)
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>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checkAPIs.pl15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/checkAPIs.pl b/tools/checkAPIs.pl
index 3ac14344f1..62372bd5cf 100755
--- a/tools/checkAPIs.pl
+++ b/tools/checkAPIs.pl
@@ -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;