aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-03-24 19:35:17 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-03-24 19:35:17 +0200
commit8ba79591bccd50a1f0589214bb431bfc52cac768 (patch)
tree81e75d1a6edf39892242689bdf68e918a12e28ad
parent867c315e563d54b417eccdbdc3b0633ee0851d6a (diff)
downloadmeson-8ba79591bccd50a1f0589214bb431bfc52cac768.zip
meson-8ba79591bccd50a1f0589214bb431bfc52cac768.tar.gz
meson-8ba79591bccd50a1f0589214bb431bfc52cac768.tar.bz2
Check for tabs whenever running the test suite.
-rwxr-xr-xrun_tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/run_tests.py b/run_tests.py
index ec598c1..dd13669 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -91,8 +91,24 @@ def run_tests():
print('\nRunning framework tests.\n')
[run_test(t) for t in frameworktests]
+def check_file(fname):
+ linenum = 0
+ for line in open(fname).readlines():
+ if '\t' in line:
+ print("File %s contains a literal tab on line %d. Only spaces are permitted." % (fname, linenum))
+ sys.exit(1)
+ linenum += 1
+
+def check_tabs():
+ for (root, dirs, files) in os.walk('.'):
+ for file in files:
+ if file.endswith('.py') or file.endswith('.build'):
+ fullname = os.path.join(root, file)
+ check_file(fullname)
+
if __name__ == '__main__':
script_dir = os.path.split(__file__)[0]
if script_dir != '':
os.chdir(script_dir)
+ check_tabs()
run_tests()