OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Makes sure files have the right permissions. | 6 """Makes sure files have the right permissions. |
7 | 7 |
8 Some developers have broken SCM configurations that flip the executable | 8 Some developers have broken SCM configurations that flip the executable |
9 permission on for no good reason. Unix developers who run ls --color will then | 9 permission on for no good reason. Unix developers who run ls --color will then |
10 see .cc files in green and get confused. | 10 see .cc files in green and get confused. |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 454 |
455 if not options.bare: | 455 if not options.bare: |
456 print('Processed %s files, %d files where tested for shebang/ELF ' | 456 print('Processed %s files, %d files where tested for shebang/ELF ' |
457 'header' % (api.count, api.count_read_header)) | 457 'header' % (api.count, api.count_read_header)) |
458 | 458 |
459 if options.json: | 459 if options.json: |
460 with open(options.json, 'w') as f: | 460 with open(options.json, 'w') as f: |
461 json.dump(errors, f) | 461 json.dump(errors, f) |
462 | 462 |
463 if errors: | 463 if errors: |
464 if options.bare: | 464 if not options.bare: |
465 print '\n'.join(e['full_path'] for e in errors) | |
466 else: | |
467 print '\nFAILED\n' | 465 print '\nFAILED\n' |
468 print '\n'.join('%s: %s' % (e['full_path'], e['error']) for e in errors) | 466 print '\n'.join('%s: %s' % (e['full_path'], e['error']) for e in errors) |
469 return 1 | 467 return 1 |
470 if not options.bare: | 468 if not options.bare: |
471 print '\nSUCCESS\n' | 469 print '\nSUCCESS\n' |
472 return 0 | 470 return 0 |
473 | 471 |
474 | 472 |
475 if '__main__' == __name__: | 473 if '__main__' == __name__: |
476 sys.exit(main()) | 474 sys.exit(main()) |
OLD | NEW |