OLD | NEW |
1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 29 matching lines...) Expand all Loading... |
40 INTERRUPTED_EXIT_STATUS = signal.SIGINT + 128 | 40 INTERRUPTED_EXIT_STATUS = signal.SIGINT + 128 |
41 | 41 |
42 # This is a randomly chosen exit code that can be tested against to | 42 # This is a randomly chosen exit code that can be tested against to |
43 # indicate that an unexpected exception occurred. | 43 # indicate that an unexpected exception occurred. |
44 EXCEPTIONAL_EXIT_STATUS = 254 | 44 EXCEPTIONAL_EXIT_STATUS = 254 |
45 | 45 |
46 _log = logging.getLogger(__name__) | 46 _log = logging.getLogger(__name__) |
47 | 47 |
48 | 48 |
49 def lint(host, options): | 49 def lint(host, options): |
50 # FIXME: Remove this when we remove the --chromium flag (crbug.com/245504). | |
51 if options.platform == 'chromium': | |
52 options.platform = None | |
53 | |
54 ports_to_lint = [host.port_factory.get(name) for name in host.port_factory.a
ll_port_names(options.platform)] | 50 ports_to_lint = [host.port_factory.get(name) for name in host.port_factory.a
ll_port_names(options.platform)] |
55 files_linted = set() | 51 files_linted = set() |
56 lint_failed = False | 52 lint_failed = False |
57 | 53 |
58 for port_to_lint in ports_to_lint: | 54 for port_to_lint in ports_to_lint: |
59 expectations_dict = port_to_lint.expectations_dict() | 55 expectations_dict = port_to_lint.expectations_dict() |
60 | 56 |
61 for expectations_file in expectations_dict.keys(): | 57 for expectations_file in expectations_dict.keys(): |
62 if expectations_file in files_linted: | 58 if expectations_file in files_linted: |
63 continue | 59 continue |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 try: | 133 try: |
138 exit_status = run_checks(host, options, stderr) | 134 exit_status = run_checks(host, options, stderr) |
139 except KeyboardInterrupt: | 135 except KeyboardInterrupt: |
140 exit_status = INTERRUPTED_EXIT_STATUS | 136 exit_status = INTERRUPTED_EXIT_STATUS |
141 except Exception as e: | 137 except Exception as e: |
142 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) | 138 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) |
143 traceback.print_exc(file=stderr) | 139 traceback.print_exc(file=stderr) |
144 exit_status = EXCEPTIONAL_EXIT_STATUS | 140 exit_status = EXCEPTIONAL_EXIT_STATUS |
145 | 141 |
146 return exit_status | 142 return exit_status |
OLD | NEW |