Make check-whitespace.py exit 1 on whitespace errors
This commit is contained in:
@@ -37,8 +37,10 @@ def check_whitespace(*filenames):
|
|||||||
if whitespace:
|
if whitespace:
|
||||||
logger.info('%s: trailing whitespace at end of file', filename)
|
logger.info('%s: trailing whitespace at end of file', filename)
|
||||||
errors += 1
|
errors += 1
|
||||||
if errors:
|
return errors
|
||||||
logger.error('%d whitespace errors' % (errors,))
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
check_whitespace(*sys.argv[1:])
|
errors = check_whitespace(*sys.argv[1:])
|
||||||
|
if errors > 0:
|
||||||
|
logger.error('%d whitespace errors' % (errors,))
|
||||||
|
sys.exit(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user