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

Unified Diff: bin/linter.dart

Issue 1918933002: Fix for default filter (#228). (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Created 4 years, 8 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 | test/integration_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/linter.dart
diff --git a/bin/linter.dart b/bin/linter.dart
index 45af03027081b13397ab6baef01a2c28af6102e7..5c5670bf30c39def79b66fbd5de2b670d733e33e 100644
--- a/bin/linter.dart
+++ b/bin/linter.dart
@@ -174,12 +174,16 @@ $stack''');
}
}
+Iterable<AnalysisError> _filtered(
+ List<AnalysisError> errors, LintFilter filter) =>
+ (filter == null)
+ ? errors
+ : errors.where((AnalysisError e) => !filter.filter(e));
+
int _maxSeverity(List<AnalysisErrorInfo> errors, LintFilter filter) {
int max = 0;
for (AnalysisErrorInfo info in errors) {
- info.errors
- .where((AnalysisError e) => !filter.filter(e))
- .forEach((AnalysisError e) {
+ _filtered(info.errors, filter).forEach((AnalysisError e) {
max = math.max(max, e.errorCode.errorSeverity.ordinal);
});
}
« no previous file with comments | « no previous file | test/integration_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698