check_whitespace: Minor simplification of control char check
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
7c7de85f01
commit
ac5e207241
|
@ -36,10 +36,9 @@ def check_file(filename):
|
||||||
continue
|
continue
|
||||||
# Check for control characters
|
# Check for control characters
|
||||||
for c in line:
|
for c in line:
|
||||||
oc = ord(c)
|
if unicodedata.category(c).startswith('C'):
|
||||||
if oc < 32 or unicodedata.category(c).startswith('C'):
|
|
||||||
char_name = repr(c)
|
char_name = repr(c)
|
||||||
if oc == 9:
|
if c == '\t':
|
||||||
if os.path.basename(filename).lower() == 'makefile':
|
if os.path.basename(filename).lower() == 'makefile':
|
||||||
continue
|
continue
|
||||||
char_name = 'tab'
|
char_name = 'tab'
|
||||||
|
|
Loading…
Reference in New Issue