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 that all files contain proper licensing information.""" | 6 """Makes sure that all files contain proper licensing information.""" |
7 | 7 |
8 | 8 |
9 import json | 9 import json |
10 import optparse | 10 import optparse |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 # https://github.com/PyCQA/pylint/issues/894 | 638 # https://github.com/PyCQA/pylint/issues/894 |
639 'UNKNOWN', | 639 'UNKNOWN', |
640 ], | 640 ], |
641 } | 641 } |
642 | 642 |
643 EXCLUDED_PATHS = [ | 643 EXCLUDED_PATHS = [ |
644 # Don't check generated files | 644 # Don't check generated files |
645 'out/', | 645 'out/', |
646 | 646 |
647 # Don't check downloaded goma client binaries | 647 # Don't check downloaded goma client binaries |
648 'build/goma/client', | 648 'build/goma/client/', |
649 | 649 |
650 # Don't check sysroot directories | 650 # Don't check sysroot directories |
651 'build/linux/debian_jessie_arm64-sysroot', | 651 'build/linux/debian_jessie_arm64-sysroot/', |
652 'build/linux/debian_jessie_amd64-sysroot', | 652 'build/linux/debian_jessie_amd64-sysroot/', |
653 'build/linux/debian_jessie_arm-sysroot', | 653 'build/linux/debian_jessie_arm-sysroot/', |
654 'build/linux/debian_jessie_i386-sysroot', | 654 'build/linux/debian_jessie_i386-sysroot/', |
655 'build/linux/debian_jessie_mips-sysroot', | 655 'build/linux/debian_jessie_mips-sysroot/', |
656 'build/linux/debian_wheezy_amd64-sysroot', | |
657 'build/linux/debian_wheezy_arm-sysroot', | |
658 'build/linux/debian_wheezy_i386-sysroot', | |
659 'build/linux/debian_wheezy_mips-sysroot', | |
660 'build/linux/ubuntu_precise_amd64-sysroot', | |
661 ] | 656 ] |
662 | 657 |
663 | 658 |
664 def check_licenses(options, args): | 659 def check_licenses(options, args): |
665 # Figure out which directory we have to check. | 660 # Figure out which directory we have to check. |
666 if len(args) == 0: | 661 if len(args) == 0: |
667 # No directory to check specified, use the repository root. | 662 # No directory to check specified, use the repository root. |
668 start_dir = options.base_directory | 663 start_dir = options.base_directory |
669 elif len(args) == 1: | 664 elif len(args) == 1: |
670 # Directory specified. Start here. It's supposed to be relative to the | 665 # Directory specified. Start here. It's supposed to be relative to the |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 action='store_true', | 778 action='store_true', |
784 default=False, | 779 default=False, |
785 help='Ignore path-specific license whitelist.') | 780 help='Ignore path-specific license whitelist.') |
786 option_parser.add_option('--json', help='Path to JSON output file') | 781 option_parser.add_option('--json', help='Path to JSON output file') |
787 options, args = option_parser.parse_args() | 782 options, args = option_parser.parse_args() |
788 return check_licenses(options, args) | 783 return check_licenses(options, args) |
789 | 784 |
790 | 785 |
791 if '__main__' == __name__: | 786 if '__main__' == __name__: |
792 sys.exit(main()) | 787 sys.exit(main()) |
OLD | NEW |