Skip to content

Commit

Permalink
Analyzer CLI: fix machine format in build mode.
Browse files Browse the repository at this point in the history
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2885063002 .
  • Loading branch information
stereotype441 committed May 16, 2017
1 parent 77f3498 commit 42ef3eb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/analyzer_cli/lib/src/build_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,13 @@ class BuildMode {
*/
void _printErrors({String outputPath}) {
StringBuffer buffer = new StringBuffer();
ErrorFormatter formatter = new HumanErrorFormatter(buffer, options, stats,
severityProcessor: (AnalysisError error) => determineProcessedSeverity(
error, options, context.analysisOptions));
var severityProcessor = (AnalysisError error) =>
determineProcessedSeverity(error, options, context.analysisOptions);
ErrorFormatter formatter = options.machineFormat
? new MachineErrorFormatter(buffer, options, stats,
severityProcessor: severityProcessor)
: new HumanErrorFormatter(buffer, options, stats,
severityProcessor: severityProcessor);
for (Source source in explicitSources) {
AnalysisErrorInfo errorInfo = context.getErrors(source);
formatter.formatErrors([errorInfo]);
Expand Down

0 comments on commit 42ef3eb

Please sign in to comment.