Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/closure_compiler/checker.py

Issue 421253006: Add ChromeCodingConvention.java to Closure Compiler to preserve getInstance() type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@A_typechecking_about
Patch Set: FileCache and fixes Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/closure_compiler/checker.py
diff --git a/third_party/closure_compiler/checker.py b/third_party/closure_compiler/checker.py
index 5ae34951f399d68082667aed5c3d1f10d69ebbab..4147c593a3041f7354fe21941ee00d984ecf59e5 100644
--- a/third_party/closure_compiler/checker.py
+++ b/third_party/closure_compiler/checker.py
@@ -19,7 +19,7 @@ class LineNumber(object):
class FileCache(object):
_cache = defaultdict(str)
-
+
def _read(self, file):
file = os.path.abspath(file)
self._cache[file] = self._cache[file] or open(file, "r").read()
@@ -105,12 +105,13 @@ class Checker(object):
"-XX:+TieredCompilation"
]
- def __init__(self, verbose=False):
+ def __init__(self, verbose=False, fatal_log_on_error=True):
current_dir = os.path.join(os.path.dirname(__file__))
self._compiler_jar = os.path.join(current_dir, "lib", "compiler.jar")
self._runner_jar = os.path.join(current_dir, "runner", "runner.jar")
self._temp_files = []
self._verbose = verbose
+ self._fatal_log_on_error = fatal_log_on_error
def _clean_up(self):
if not self._temp_files:
@@ -212,11 +213,16 @@ class Checker(object):
self._debug("Summary: " + errors.pop())
output = self._format_errors(map(self._fix_up_error, errors))
+
if runner_cmd.returncode:
- self._fatal("Error in: " + file + ("\n" + output if output else ""))
+ message = "Error in: " + file + ("\n" + output if output else "")
+ if self._fatal_log_on_error:
+ self._fatal(message)
+ else:
+ self._debug(message)
elif output:
self._debug("Output: " + output)
-
+
self._clean_up()
- return runner_cmd.returncode == 0
+ return runner_cmd.returncode == 0, output

Powered by Google App Engine
This is Rietveld 408576698