| 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 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'generated/constant.dart'; | 10 import 'generated/constant.dart'; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // print errors and performance numbers | 165 // print errors and performance numbers |
| 166 _printErrorsAndPerf(); | 166 _printErrorsAndPerf(); |
| 167 | 167 |
| 168 // compute max severity and set exitCode | 168 // compute max severity and set exitCode |
| 169 ErrorSeverity status = maxErrorSeverity; | 169 ErrorSeverity status = maxErrorSeverity; |
| 170 if (status == ErrorSeverity.WARNING && options.warningsAreFatal) { | 170 if (status == ErrorSeverity.WARNING && options.warningsAreFatal) { |
| 171 status = ErrorSeverity.ERROR; | 171 status = ErrorSeverity.ERROR; |
| 172 } | 172 } |
| 173 exitCode = status.ordinal; | 173 exitCode = status.ordinal; |
| 174 }).catchError((ex, st) { | 174 }).catchError((ex, st) { |
| 175 AnalysisEngine.instance.logger.logError("${ex}\n${st}"); | 175 AnalysisEngine.instance.logger.logError("$ex\n$st"); |
| 176 }); | 176 }); |
| 177 } | 177 } |
| 178 | 178 |
| 179 bool _isDesiredError(AnalysisError error) { | 179 bool _isDesiredError(AnalysisError error) { |
| 180 if (error.errorCode.type == ErrorType.TODO) { | 180 if (error.errorCode.type == ErrorType.TODO) { |
| 181 return false; | 181 return false; |
| 182 } | 182 } |
| 183 if (computeSeverity(error, options.enableTypeChecks) == ErrorSeverity.INFO | 183 if (computeSeverity(error, options.enableTypeChecks) == ErrorSeverity.INFO |
| 184 && options.disableHints) { | 184 && options.disableHints) { |
| 185 return false; | 185 return false; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 | 429 |
| 430 @override | 430 @override |
| 431 void logInformation2(String message, Exception exception) { | 431 void logInformation2(String message, Exception exception) { |
| 432 if (log) { | 432 if (log) { |
| 433 stdout.writeln(message); | 433 stdout.writeln(message); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 } | 436 } |
| OLD | NEW |