| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_cli.src.error_formatter; | 5 library analyzer_cli.src.error_formatter; |
| 6 | 6 |
| 7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
| 8 import 'package:analyzer/src/generated/engine.dart'; | 8 import 'package:analyzer/src/generated/engine.dart'; |
| 9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
| 10 import 'package:analyzer_cli/src/analyzer_options.dart'; |
| 10 import 'package:analyzer_cli/src/ansi.dart'; | 11 import 'package:analyzer_cli/src/ansi.dart'; |
| 11 import 'package:analyzer_cli/src/options.dart'; | |
| 12 import 'package:path/path.dart' as path; | 12 import 'package:path/path.dart' as path; |
| 13 | 13 |
| 14 /// Returns the given error's severity. | 14 /// Returns the given error's severity. |
| 15 ProcessedSeverity _severityIdentity(AnalysisError error) => | 15 ProcessedSeverity _severityIdentity(AnalysisError error) => |
| 16 new ProcessedSeverity(error.errorCode.errorSeverity); | 16 new ProcessedSeverity(error.errorCode.errorSeverity); |
| 17 | 17 |
| 18 String _pluralize(String word, int count) => count == 1 ? word : word + "s"; | 18 String _pluralize(String word, int count) => count == 1 ? word : word + "s"; |
| 19 | 19 |
| 20 /// Returns desired severity for the given [error] (or `null` if it's to be | 20 /// Returns desired severity for the given [error] (or `null` if it's to be |
| 21 /// suppressed). | 21 /// suppressed). |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 final ErrorSeverity severity; | 387 final ErrorSeverity severity; |
| 388 final bool overridden; | 388 final bool overridden; |
| 389 ProcessedSeverity(this.severity, [this.overridden = false]); | 389 ProcessedSeverity(this.severity, [this.overridden = false]); |
| 390 } | 390 } |
| 391 | 391 |
| 392 /// Given an absolute path, return a relative path if the file is contained in | 392 /// Given an absolute path, return a relative path if the file is contained in |
| 393 /// the current directory; return the original path otherwise. | 393 /// the current directory; return the original path otherwise. |
| 394 String _relative(String file) { | 394 String _relative(String file) { |
| 395 return file.startsWith(path.current) ? path.relative(file) : file; | 395 return file.startsWith(path.current) ? path.relative(file) : file; |
| 396 } | 396 } |
| OLD | NEW |