| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer_impl; | 5 library analyzer_impl; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 ErrorSeverity status = maxErrorSeverity; | 146 ErrorSeverity status = maxErrorSeverity; |
| 147 if (status == ErrorSeverity.WARNING && options.warningsAreFatal) { | 147 if (status == ErrorSeverity.WARNING && options.warningsAreFatal) { |
| 148 status = ErrorSeverity.ERROR; | 148 status = ErrorSeverity.ERROR; |
| 149 } | 149 } |
| 150 exitCode = status.ordinal; | 150 exitCode = status.ordinal; |
| 151 }).catchError((ex, st) { | 151 }).catchError((ex, st) { |
| 152 AnalysisEngine.instance.logger.logError("${ex}\n${st}"); | 152 AnalysisEngine.instance.logger.logError("${ex}\n${st}"); |
| 153 }); | 153 }); |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool _excludeTodo(AnalysisError error) => error.errorCode.type != ErrorType.TO
DO; |
| 157 |
| 156 _printErrorsAndPerf() { | 158 _printErrorsAndPerf() { |
| 157 // The following is a hack. We currently print out to stderr to ensure that | 159 // The following is a hack. We currently print out to stderr to ensure that |
| 158 // when in batch mode we print to stderr, this is because the prints from | 160 // when in batch mode we print to stderr, this is because the prints from |
| 159 // batch are made to stderr. The reason that options.shouldBatch isn't used | 161 // batch are made to stderr. The reason that options.shouldBatch isn't used |
| 160 // is because when the argument flags are constructed in BatchRunner and | 162 // is because when the argument flags are constructed in BatchRunner and |
| 161 // passed in from batch mode which removes the batch flag to prevent the | 163 // passed in from batch mode which removes the batch flag to prevent the |
| 162 // "cannot have the batch flag and source file" error message. | 164 // "cannot have the batch flag and source file" error message. |
| 163 IOSink sink = options.machineFormat ? stderr : stdout; | 165 IOSink sink = options.machineFormat ? stderr : stdout; |
| 164 | 166 |
| 165 // print errors | 167 // print errors |
| 166 ErrorFormatter formatter = new ErrorFormatter(sink, options); | 168 ErrorFormatter formatter = new ErrorFormatter(sink, options, _excludeTodo); |
| 167 formatter.formatErrors(errorInfos); | 169 formatter.formatErrors(errorInfos); |
| 168 | 170 |
| 169 // print performance numbers | 171 // print performance numbers |
| 170 if (options.perf) { | 172 if (options.perf) { |
| 171 int totalTime = JavaSystem.currentTimeMillis() - startTime; | 173 int totalTime = JavaSystem.currentTimeMillis() - startTime; |
| 172 int ioTime = PerformanceStatistics.io.result; | 174 int ioTime = PerformanceStatistics.io.result; |
| 173 int scanTime = PerformanceStatistics.scan.result; | 175 int scanTime = PerformanceStatistics.scan.result; |
| 174 int parseTime = PerformanceStatistics.parse.result; | 176 int parseTime = PerformanceStatistics.parse.result; |
| 175 int resolveTime = PerformanceStatistics.resolve.result; | 177 int resolveTime = PerformanceStatistics.resolve.result; |
| 176 int errorsTime = PerformanceStatistics.errors.result; | 178 int errorsTime = PerformanceStatistics.errors.result; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 358 } |
| 357 } | 359 } |
| 358 | 360 |
| 359 @override | 361 @override |
| 360 void logInformation2(String message, Exception exception) { | 362 void logInformation2(String message, Exception exception) { |
| 361 if (log) { | 363 if (log) { |
| 362 stdout.writeln(message); | 364 stdout.writeln(message); |
| 363 } | 365 } |
| 364 } | 366 } |
| 365 } | 367 } |
| OLD | NEW |