style.py: don't die on empty files
This commit is contained in:
parent
40b6c9cb2e
commit
ed61e02b24
1 changed files with 3 additions and 0 deletions
|
@ -233,6 +233,9 @@ class SortedIncludes(Verifier):
|
|||
old = ''.join(line + '\n' for line in lines)
|
||||
f.close()
|
||||
|
||||
if len(lines) == 0:
|
||||
return 0
|
||||
|
||||
language = lang_type(filename, lines[0])
|
||||
sort_lines = list(self.sort_includes(lines, filename, language))
|
||||
new = ''.join(line + '\n' for line in sort_lines)
|
||||
|
|
Loading…
Reference in a new issue