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

Unified Diff: pkg/analyzer/bin/analyzer.dart

Issue 287653003: set exitCode on errors or warnings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 7 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/bin/analyzer.dart
diff --git a/pkg/analyzer/bin/analyzer.dart b/pkg/analyzer/bin/analyzer.dart
index a9333c051ebc5758b8c09283bc1baed99b60b7c6..bab77b6fa4cbd1c82965230ad18006d7bdc60d18 100644
--- a/pkg/analyzer/bin/analyzer.dart
+++ b/pkg/analyzer/bin/analyzer.dart
@@ -70,7 +70,14 @@ _runAnalyzer(CommandLineOptions options, [bool async = true]) {
if (async) {
return analyzer.analyzeAsync();
} else {
- return analyzer.analyzeSync();
+ var errorSeverity = analyzer.analyzeSync();
+ if (errorSeverity == ErrorSeverity.ERROR) {
+ exitCode = errorSeverity.ordinal;
+ }
+ if (options.warningsAreFatal && errorSeverity == ErrorSeverity.WARNING) {
+ exitCode = errorSeverity.ordinal;
+ }
+ return errorSeverity;
}
}
« 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