| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Runs Android's lint tool.""" | 7 """Runs Android's lint tool.""" |
| 8 | 8 |
| 9 | 9 |
| 10 import optparse | 10 import optparse |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 # There is a problem with lint usage | 120 # There is a problem with lint usage |
| 121 if not os.path.exists(result_path): | 121 if not os.path.exists(result_path): |
| 122 print 'Something is wrong:' | 122 print 'Something is wrong:' |
| 123 print e | 123 print e |
| 124 return 1 | 124 return 1 |
| 125 | 125 |
| 126 # There are actual lint issues | 126 # There are actual lint issues |
| 127 else: | 127 else: |
| 128 try: | 128 try: |
| 129 num_issues = _ParseAndShowResultFile() | 129 num_issues = _ParseAndShowResultFile() |
| 130 except Exception: | 130 except Exception: # pylint: disable=broad-except |
| 131 print 'Lint created unparseable xml file...' | 131 print 'Lint created unparseable xml file...' |
| 132 print 'File contents:' | 132 print 'File contents:' |
| 133 with open(result_path) as f: | 133 with open(result_path) as f: |
| 134 print f.read() | 134 print f.read() |
| 135 return 1 | 135 return 1 |
| 136 | 136 |
| 137 _ProcessResultFile() | 137 _ProcessResultFile() |
| 138 msg = ('\nLint found %d new issues.\n' | 138 msg = ('\nLint found %d new issues.\n' |
| 139 ' - For full explanation refer to %s\n' | 139 ' - For full explanation refer to %s\n' |
| 140 ' - Wanna suppress these issues?\n' | 140 ' - Wanna suppress these issues?\n' |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 build_utils.GetPythonDependencies()) | 205 build_utils.GetPythonDependencies()) |
| 206 | 206 |
| 207 if options.stamp and not rc: | 207 if options.stamp and not rc: |
| 208 build_utils.Touch(options.stamp) | 208 build_utils.Touch(options.stamp) |
| 209 | 209 |
| 210 return rc if options.can_fail_build else 0 | 210 return rc if options.can_fail_build else 0 |
| 211 | 211 |
| 212 | 212 |
| 213 if __name__ == '__main__': | 213 if __name__ == '__main__': |
| 214 sys.exit(main()) | 214 sys.exit(main()) |
| OLD | NEW |