diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-03-24 19:35:17 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-03-24 19:35:17 +0200 |
commit | 8ba79591bccd50a1f0589214bb431bfc52cac768 (patch) | |
tree | 81e75d1a6edf39892242689bdf68e918a12e28ad | |
parent | 867c315e563d54b417eccdbdc3b0633ee0851d6a (diff) | |
download | meson-8ba79591bccd50a1f0589214bb431bfc52cac768.zip meson-8ba79591bccd50a1f0589214bb431bfc52cac768.tar.gz meson-8ba79591bccd50a1f0589214bb431bfc52cac768.tar.bz2 |
Check for tabs whenever running the test suite.
-rwxr-xr-x | run_tests.py | 16 |
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() |