diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-12-13 14:00:32 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-12-14 10:10:42 +0100 |
commit | 29b1ef009aa16f58a0423da8a25fee6edac30393 (patch) | |
tree | c7552571ab338c79679afa239bd2bb259d3a9202 /crawl-ref/source/util/checkwhite | |
parent | 55beb4d44935ed4059bf8dcf838158ac52e029cf (diff) | |
download | crawl-ref-29b1ef009aa16f58a0423da8a25fee6edac30393.tar.gz crawl-ref-29b1ef009aa16f58a0423da8a25fee6edac30393.zip |
Don't exempt *.txt, *.rb, *.pl and the makefile from whitespace checks.
Only tabs are allowed, and not for .txt either.
Diffstat (limited to 'crawl-ref/source/util/checkwhite')
-rwxr-xr-x | crawl-ref/source/util/checkwhite | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crawl-ref/source/util/checkwhite b/crawl-ref/source/util/checkwhite index 3d1520bab8..03b7908146 100755 --- a/crawl-ref/source/util/checkwhite +++ b/crawl-ref/source/util/checkwhite @@ -7,13 +7,14 @@ while(<FLIST>) { chomp; next unless -f $_; - next if /\.(png|ttf|ico|icns|fig|tex|eps|pdf|txt)$/i; + next if /\.(png|ttf|ico|icns|fig|tex|eps|pdf)$/i; next if /\.(sln|vim|pbxproj|vsprops|plist)$/i; next if /\.(rb|pl)$/i; next if /Makefile/i; next if /vcproj/; next if /\.(lex|tab)\./; next if !/\./; + my $tab = /\.(rb|pl|Makefile)$/i; # Allow tabs for these files. undef local $/; open F, "<$_" or die "Can't open $_"; my $file = $_; @@ -22,7 +23,7 @@ while(<FLIST>) $_.="\n", print "missing newline at eof: $file\n" unless /\n$/s; print "extra newlines at eof: $file\n" if s/\n+\n$/\n/s; - print "tab: $file\n" if s/ {0,7}\t/ /sg; + print "tab: $file\n" if !$tab && s/ {0,7}\t/ /sg; print "spaces at eol: $file\n" if s/ +\n/\n/sg; print "CR: $file\n" if s/\r//sg; eval{decode("UTF-8", "$_", Encode::FB_CROAK)}; |