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

Unified Diff: pkg/analyzer/lib/source/error_processor.dart

Issue 2863013002: Fix an issue with configuring the severity of lints. (Closed)
Patch Set: update dartdoc Created 3 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 | pkg/analyzer/test/source/error_processor_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/source/error_processor.dart
diff --git a/pkg/analyzer/lib/source/error_processor.dart b/pkg/analyzer/lib/source/error_processor.dart
index 1d8d0f8479405a14b8ed961b8204136c5dfe940f..a4a6f77eb6682b1e16ef121bfc4aa671f531f237 100644
--- a/pkg/analyzer/lib/source/error_processor.dart
+++ b/pkg/analyzer/lib/source/error_processor.dart
@@ -33,8 +33,8 @@ class ErrorConfig {
}
void _process(String code, Object action) {
- action = toLowerCase(action);
code = toUpperCase(code);
+ action = toLowerCase(action);
if (AnalyzerOptions.ignoreSynonyms.contains(action)) {
processors.add(new ErrorProcessor.ignore(code));
} else {
@@ -88,7 +88,12 @@ class ErrorProcessor {
String get description => '$code -> ${severity?.name}';
/// Check if this processor applies to the given [error].
- bool appliesTo(AnalysisError error) => code == error.errorCode.name;
+ ///
+ /// Note: [code] is normalized to uppercase; `errorCode.name` for regular
+ /// analysis issues uses uppercase; `errorCode.name` for lints uses lowercase.
+ bool appliesTo(AnalysisError error) =>
+ code == error.errorCode.name ||
+ code == error.errorCode.name.toUpperCase();
/// Return an error processor associated in the [analysisOptions] for the
/// given [error], or `null` if none is found.
« no previous file with comments | « no previous file | pkg/analyzer/test/source/error_processor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698