Index: pkg/analyzer_experimental/bin/analyzer.dart |
diff --git a/pkg/analyzer_experimental/bin/analyzer.dart b/pkg/analyzer_experimental/bin/analyzer.dart |
index c9b83c8c1e5cf6d40b1aa3e4772d24a36c0a43f0..f8f48e61b53a42dd936fc89b80bd5da6f61cbe66 100644 |
--- a/pkg/analyzer_experimental/bin/analyzer.dart |
+++ b/pkg/analyzer_experimental/bin/analyzer.dart |
@@ -42,32 +42,30 @@ ErrorSeverity _runAnalyzer(CommandLineOptions options) { |
stdout.writeln("Analyzing ${options.sourceFiles}..."); |
} |
ErrorSeverity allResult = ErrorSeverity.NONE; |
- for (String sourcePath in options.sourceFiles) { |
- sourcePath = sourcePath.trim(); |
- // check that file exists |
- if (!new File(sourcePath).existsSync()) { |
- print('File not found: $sourcePath'); |
- return ErrorSeverity.ERROR; |
- } |
- // check that file is Dart file |
- if (!AnalysisEngine.isDartFileName(sourcePath)) { |
- print('$sourcePath is not a Dart file'); |
- return ErrorSeverity.ERROR; |
- } |
- // do analyze |
- ErrorFormatter formatter = new ErrorFormatter(options.machineFormat ? stderr : stdout, options); |
- AnalyzerImpl analyzer = new AnalyzerImpl(options); |
- analyzer.analyze(sourcePath); |
- // pring errors |
- formatter.formatErrors(analyzer.errorInfos); |
- // prepare status |
- ErrorSeverity status = analyzer.maxErrorSeverity; |
- if (status == ErrorSeverity.WARNING && options.warningsAreFatal) { |
- status = ErrorSeverity.ERROR; |
- } |
- allResult = allResult.max(status); |
+ String sourcePath = options.sourceFiles[0]; |
+ sourcePath = sourcePath.trim(); |
+ // check that file exists |
+ if (!new File(sourcePath).existsSync()) { |
+ print('File not found: $sourcePath'); |
+ return ErrorSeverity.ERROR; |
} |
- return allResult; |
+ // check that file is Dart file |
+ if (!AnalysisEngine.isDartFileName(sourcePath)) { |
+ print('$sourcePath is not a Dart file'); |
+ return ErrorSeverity.ERROR; |
+ } |
+ // do analyze |
+ ErrorFormatter formatter = new ErrorFormatter(options.machineFormat ? stderr : stdout, options); |
+ AnalyzerImpl analyzer = new AnalyzerImpl(options); |
+ analyzer.analyze(sourcePath); |
+ // pring errors |
Brian Wilkerson
2013/06/06 16:53:18
"pring" --> "print"
|
+ formatter.formatErrors(analyzer.errorInfos); |
Brian Wilkerson
2013/06/06 16:53:18
It might already be getting done, but somewhere we
|
+ // prepare status |
+ ErrorSeverity status = analyzer.maxErrorSeverity; |
+ if (status == ErrorSeverity.WARNING && options.warningsAreFatal) { |
+ status = ErrorSeverity.ERROR; |
+ } |
+ return status; |
} |
typedef ErrorSeverity BatchRunnerHandler(List<String> args); |