Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from collections import defaultdict | 5 from collections import defaultdict |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 import tempfile | 10 import tempfile |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 64 |
| 65 class Checker(object): | 65 class Checker(object): |
| 66 _common_closure_args = [ | 66 _common_closure_args = [ |
| 67 "--accept_const_keyword", | 67 "--accept_const_keyword", |
| 68 "--language_in=ECMASCRIPT5", | 68 "--language_in=ECMASCRIPT5", |
| 69 "--summary_detail_level=3", | 69 "--summary_detail_level=3", |
| 70 "--warning_level=VERBOSE", | 70 "--warning_level=VERBOSE", |
| 71 "--jscomp_error=accessControls", | 71 "--jscomp_error=accessControls", |
| 72 "--jscomp_error=ambiguousFunctionDecl", | 72 "--jscomp_error=ambiguousFunctionDecl", |
| 73 "--jscomp_error=checkStructDictInheritance", | 73 "--jscomp_error=checkStructDictInheritance", |
| 74 "--jscomp_error=checkTypes", | 74 # TODO(vitalyp): switch to jscomp_error after transition to new imports |
| 75 "--jscomp_warning=checkTypes", | |
|
Dan Beam
2014/07/23 22:09:24
did @suppress {checkTypes} not work? i don't thin
Vitaly Pavlenko
2014/07/24 00:59:58
I'll enable it in the next CL where I switch to cr
| |
| 76 # "--jscomp_error=newCheckTypes", | |
| 75 "--jscomp_error=checkVars", | 77 "--jscomp_error=checkVars", |
| 76 "--jscomp_error=constantProperty", | 78 "--jscomp_error=constantProperty", |
| 77 "--jscomp_error=deprecated", | 79 "--jscomp_error=deprecated", |
| 78 "--jscomp_error=externsValidation", | 80 "--jscomp_error=externsValidation", |
| 79 "--jscomp_error=globalThis", | 81 "--jscomp_error=globalThis", |
| 80 "--jscomp_error=invalidCasts", | 82 "--jscomp_error=invalidCasts", |
| 81 "--jscomp_error=misplacedTypeAnnotation", | 83 "--jscomp_error=misplacedTypeAnnotation", |
| 82 "--jscomp_error=missingProperties", | 84 # TODO(vitalyp): switch to jscomp_error after transition to new imports |
|
Dan Beam
2014/07/23 22:09:24
maybe we could stand for this, but why can't we ju
Vitaly Pavlenko
2014/07/24 01:09:31
I caught a situation when the suppress declaration
| |
| 85 "--jscomp_warning=missingProperties", | |
| 83 "--jscomp_error=missingReturn", | 86 "--jscomp_error=missingReturn", |
| 84 "--jscomp_error=nonStandardJsDocs", | 87 "--jscomp_error=nonStandardJsDocs", |
| 85 "--jscomp_error=suspiciousCode", | 88 "--jscomp_error=suspiciousCode", |
| 86 "--jscomp_error=undefinedNames", | 89 "--jscomp_error=undefinedNames", |
| 87 "--jscomp_error=undefinedVars", | 90 "--jscomp_error=undefinedVars", |
| 88 "--jscomp_error=unknownDefines", | 91 "--jscomp_error=unknownDefines", |
| 89 "--jscomp_error=uselessCode", | 92 "--jscomp_error=uselessCode", |
| 90 "--jscomp_error=visibility", | 93 "--jscomp_error=visibility", |
| 91 # TODO(dbeam): happens when the same file is <include>d multiple times. | 94 # TODO(dbeam): happens when the same file is <include>d multiple times. |
| 92 "--jscomp_off=duplicate", | 95 "--jscomp_off=duplicate", |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 | 213 |
| 211 output = self._format_errors(map(self._fix_up_error, errors)) | 214 output = self._format_errors(map(self._fix_up_error, errors)) |
| 212 if runner_cmd.returncode: | 215 if runner_cmd.returncode: |
| 213 self._fatal("Error in: " + file + ("\n" + output if output else "")) | 216 self._fatal("Error in: " + file + ("\n" + output if output else "")) |
| 214 elif output: | 217 elif output: |
| 215 self._debug("Output: " + output) | 218 self._debug("Output: " + output) |
| 216 | 219 |
| 217 self._clean_up() | 220 self._clean_up() |
| 218 | 221 |
| 219 return runner_cmd.returncode == 0 | 222 return runner_cmd.returncode == 0 |
| OLD | NEW |