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

Side by Side Diff: pkg/analyzer/lib/src/analyzer_impl.dart

Issue 207693002: Don't print TODOs in Dart based analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: comments Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/error_formatter.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/error_formatter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698