Add whitespace lint rules checking for missing spaces before {.

This commit is contained in:
Tim Abbott 2015-11-10 10:04:28 -08:00
parent 5f25974737
commit b81ecc4064
1 changed files with 6 additions and 0 deletions

View File

@ -81,6 +81,12 @@ def check_whitespace(fn):
if re.search('\s+$', line.strip('\n')):
sys.stdout.write('Fix whitespace at %s line %s\n' % (fn, i+1))
failed = True
if re.search('[)]{$', line.strip()):
sys.stdout.write('Missing space between ) and { at %s line %s\n' % (fn, i+1))
failed = True
if re.search('else{$', line.strip()):
sys.stdout.write('Missing space between else and { at %s line %s\n' % (fn, i+1))
failed = True
if re.search('\t', line):
sys.stdout.write('Fix tab-based whitespace at %s line %s\n' % (fn, i+1))
failed = True