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

Unified Diff: pkg/analyzer/lib/src/error_formatter.dart

Issue 874253004: Fix to add lints to error report summary. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/error_formatter.dart
===================================================================
--- pkg/analyzer/lib/src/error_formatter.dart (revision 43353)
+++ pkg/analyzer/lib/src/error_formatter.dart (working copy)
@@ -103,6 +103,7 @@
int errorCount = 0;
int warnCount = 0;
int hintCount = 0;
+ int lintCount = 0;
for (AnalysisError error in errors) {
ErrorSeverity severity =
AnalyzerImpl.computeSeverity(error, options.enableTypeChecks);
@@ -118,6 +119,8 @@
warnCount++;
}
}
+ } else if (error.errorCode.type == ErrorType.LINT) {
+ lintCount++;
}
formatError(errorToLine, error);
}
@@ -126,6 +129,7 @@
var hasErrors = errorCount != 0;
var hasWarns = warnCount != 0;
var hasHints = hintCount != 0;
+ var hasLints = lintCount != 0;
bool hasContent = false;
if (hasErrors) {
out.write(errorCount);
@@ -135,7 +139,7 @@
}
if (hasWarns) {
if (hasContent) {
- if (!hasHints) {
+ if (!hasHints && !hasLints) {
out.write(' and ');
} else {
out.write(", ");
@@ -148,13 +152,26 @@
}
if (hasHints) {
if (hasContent) {
- out.write(" and ");
+ if (!hasLints) {
+ out.write(' and ');
+ } else {
+ out.write(", ");
+ }
}
out.write(hintCount);
out.write(' ');
out.write(pluralize("hint", hintCount));
hasContent = true;
}
+ if (hasLints) {
+ if (hasContent) {
+ out.write(" and ");
+ }
+ out.write(lintCount);
+ out.write(' ');
+ out.write(pluralize("lint", lintCount));
+ hasContent = true;
+ }
if (hasContent) {
out.writeln(" found.");
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698