From b0f90a793f5ef3e08aa51549773581dff862ddb7 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 9 May 2019 21:46:22 +0300 Subject: [PATCH] Better detection of tab indentation. "But surely nobody would indent by having spaces first, and tabs after that. Right? Right?" --- run_project_tests.py | 5 +++-- test cases/frameworks/18 vulkan/vulkanprog.c | 18 +++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/run_project_tests.py b/run_project_tests.py index 324d82430..b9077c96f 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -702,9 +702,10 @@ def check_file(fname): linenum = 1 with open(fname, 'rb') as f: lines = f.readlines() + tabdetector = re.compile(br' *\t') for line in lines: - if line.startswith(b'\t'): - print("File %s contains a literal tab on line %d. Only spaces are permitted." % (fname, linenum)) + if re.match(tabdetector, line): + print("File %s contains a tab indent on line %d. Only spaces are permitted." % (fname, linenum)) sys.exit(1) if b'\r' in line: print("File %s contains DOS line ending on line %d. Only unix-style line endings are permitted." % (fname, linenum)) diff --git a/test cases/frameworks/18 vulkan/vulkanprog.c b/test cases/frameworks/18 vulkan/vulkanprog.c index 1c1c58aae..58d63ece7 100644 --- a/test cases/frameworks/18 vulkan/vulkanprog.c +++ b/test cases/frameworks/18 vulkan/vulkanprog.c @@ -4,14 +4,14 @@ int main() { VkInstanceCreateInfo instance_create_info = { - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, - NULL, - 0, - NULL, - 0, - NULL, - 0, - NULL, + VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, + NULL, + 0, + NULL, + 0, + NULL, + 0, + NULL, }; // we don't actually require instance creation to succeed since @@ -23,4 +23,4 @@ int main() vkDestroyInstance(instance, NULL); return 0; -} \ No newline at end of file +}