OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 import argparse | 6 import argparse |
7 import os | 7 import os |
8 import re | 8 import re |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
11 | 11 |
12 from skypy.url_mappings import URLMappings | 12 from skypy.url_mappings import URLMappings |
13 | 13 |
14 SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) | 14 SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) |
15 SKY_ROOT = os.path.dirname(SKY_TOOLS_DIR) | 15 SKY_ROOT = os.path.dirname(SKY_TOOLS_DIR) |
16 SRC_ROOT = os.path.dirname(SKY_ROOT) | 16 SRC_ROOT = os.path.dirname(SKY_ROOT) |
17 | 17 |
18 _IGNORED_PATTERNS = [ | 18 _IGNORED_PATTERNS = [ |
19 # Ignored because they're not indicative of specific errors. | 19 # Ignored because they're not indicative of specific errors. |
20 re.compile(r'^$'), | 20 re.compile(r'^$'), |
21 re.compile(r'^Analyzing \['), | 21 re.compile(r'^Analyzing \['), |
22 re.compile(r'^No issues found'), | 22 re.compile(r'^No issues found'), |
23 re.compile(r'^[0-9]+ errors? and [0-9]+ warnings? found.'), | 23 re.compile(r'^[0-9]+ errors? and [0-9]+ warnings? found.'), |
24 re.compile(r'^([0-9]+|No) (error|warning|issue)s? found.'), | 24 re.compile(r'^([0-9]+|No) (error|warning|issue)s? found.'), |
25 | 25 |
| 26 # Ignore analyzer status output. |
| 27 re.compile(r'^[0-9]+ errors, [0-9]+ warnings and [0-9]+ hints found.'), |
| 28 |
26 # Ignored because they don't affect Sky code | 29 # Ignored because they don't affect Sky code |
27 re.compile(r'\[hint\] When compiled to JS, this test might return true when th
e left hand side is an int'), | 30 re.compile(r'\[hint\] When compiled to JS, this test might return true when th
e left hand side is an int'), |
28 | 31 |
29 # TODO: Remove once sdk-extensions are in place | 32 # TODO: Remove once sdk-extensions are in place |
30 re.compile(r'^\[error\] Native functions can only be declared in'), | 33 re.compile(r'^\[error\] Native functions can only be declared in'), |
31 | 34 |
32 # TODO: Fix all the warnings in the mojo packages | 35 # TODO: Fix all the warnings in the mojo packages |
33 re.compile(r'.*/dart-pkg/mojom/'), | 36 re.compile(r'.*/dart-pkg/mojom/'), |
34 re.compile(r'.*/dart-pkg/mojo/'), | 37 re.compile(r'.*/dart-pkg/mojo/'), |
35 re.compile(r'.*/mojo/public/dart/'), | 38 re.compile(r'.*/mojo/public/dart/'), |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 print >> sys.stderr, error | 75 print >> sys.stderr, error |
73 # Propagate analyzer error code. | 76 # Propagate analyzer error code. |
74 return e.returncode | 77 return e.returncode |
75 # If we do not have any errors left after filtering, return 0. | 78 # If we do not have any errors left after filtering, return 0. |
76 if args.congratulate: | 79 if args.congratulate: |
77 print >> sys.stdout, "No analyzer warnings!" | 80 print >> sys.stdout, "No analyzer warnings!" |
78 return 0 | 81 return 0 |
79 | 82 |
80 if __name__ == '__main__': | 83 if __name__ == '__main__': |
81 sys.exit(main()) | 84 sys.exit(main()) |
OLD | NEW |