Better detection of tab indentation.

"But surely nobody would indent by having spaces first,
and tabs after that. Right? Right?"
pull/5379/head
Jussi Pakkanen 5 years ago
parent d31db565e1
commit b0f90a793f
  1. 5
      run_project_tests.py
  2. 18
      test cases/frameworks/18 vulkan/vulkanprog.c

@ -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))

@ -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;
}
}

Loading…
Cancel
Save