comparison contrib/check-code.py @ 15544:53ef627cda30

check-code: fix return code initialization Don't crash when nothing is tested, but return failure when other files than the last one fails.
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 22 Nov 2011 01:37:26 +0100
parents 7917a104a285
children ec8a49c46d7e
comparison
equal deleted inserted replaced
15543:49a5db5b10de 15544:53ef627cda30
418 if len(args) == 0: 418 if len(args) == 0:
419 check = glob.glob("*") 419 check = glob.glob("*")
420 else: 420 else:
421 check = args 421 check = args
422 422
423 ret = 0
423 for f in check: 424 for f in check:
424 ret = 0
425 if not checkfile(f, maxerr=options.per_file, warnings=options.warnings, 425 if not checkfile(f, maxerr=options.per_file, warnings=options.warnings,
426 blame=options.blame, debug=options.debug, 426 blame=options.blame, debug=options.debug,
427 lineno=options.lineno): 427 lineno=options.lineno):
428 ret = 1 428 ret = 1
429 sys.exit(ret) 429 sys.exit(ret)