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

Side by Side Diff: lib/src/report.dart

Issue 1554683002: Update to latest analyzer (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Fix error severities Created 4 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 unified diff | Download patch
OLDNEW
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 /// Summarizes the information produced by the checker. 5 /// Summarizes the information produced by the checker.
6 library dev_compiler.src.report; 6 library dev_compiler.src.report;
7 7
8 import 'dart:math' show max; 8 import 'dart:math' show max;
9 9
10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 void onError(AnalysisError error) { 56 void onError(AnalysisError error) {
57 _errors.add(error); 57 _errors.add(error);
58 } 58 }
59 } 59 }
60 60
61 ErrorSeverity _strongModeErrorSeverity(AnalysisError error) { 61 ErrorSeverity _strongModeErrorSeverity(AnalysisError error) {
62 // Upgrade analyzer warnings to errors. 62 // Upgrade analyzer warnings to errors.
63 // TODO(jmesserly: reconcile this with analyzer_cli 63 // TODO(jmesserly: reconcile this with analyzer_cli
64 var severity = error.errorCode.errorSeverity; 64 var severity = error.errorCode.errorSeverity;
65 if (!error.errorCode.name.startsWith('dev_compiler.') && 65 if (!isStrongModeError(error.errorCode) &&
66 severity == ErrorSeverity.WARNING) { 66 severity == ErrorSeverity.WARNING) {
67 return ErrorSeverity.ERROR; 67 return ErrorSeverity.ERROR;
68 } 68 }
69 return severity; 69 return severity;
70 } 70 }
71 71
72 /// Simple reporter that logs checker messages as they are seen. 72 /// Simple reporter that logs checker messages as they are seen.
73 class LogReporter implements AnalysisErrorListener { 73 class LogReporter implements AnalysisErrorListener {
74 final AnalysisContext _context; 74 final AnalysisContext _context;
75 final bool useColors; 75 final bool useColors;
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 361
362 visitMessage(MessageSummary message) { 362 visitMessage(MessageSummary message) {
363 var kind = message.kind; 363 var kind = message.kind;
364 errorCount.putIfAbsent(currentPackage, () => <String, int>{}); 364 errorCount.putIfAbsent(currentPackage, () => <String, int>{});
365 errorCount[currentPackage].putIfAbsent(kind, () => 0); 365 errorCount[currentPackage].putIfAbsent(kind, () => 0);
366 errorCount[currentPackage][kind]++; 366 errorCount[currentPackage][kind]++;
367 totals.putIfAbsent(kind, () => 0); 367 totals.putIfAbsent(kind, () => 0);
368 totals[kind]++; 368 totals[kind]++;
369 } 369 }
370 } 370 }
OLDNEW
« no previous file with comments | « lib/src/compiler.dart ('k') | lib/src/server/dependency_graph.dart » ('j') | lib/src/utils.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698