@@ -78,30 +78,23 @@ class CustomAnalyzerConverter {
78
78
Map <String , analyzer.ErrorSeverity >? configSeverities,
79
79
}) {
80
80
var serverErrors = < plugin.AnalysisError > [];
81
- for (var error in errors) {
82
- var processor = analyzer.ErrorProcessor .getProcessor (options, error);
83
- // Check if there's a severity override in the configs
81
+ for (final error in errors) {
82
+ final processor = analyzer.ErrorProcessor .getProcessor (options, error);
84
83
final configSeverity = configSeverities? [error.errorCode.name];
85
84
86
- if (processor != null ) {
87
- var severity = processor.severity;
88
- // Errors with null severity are filtered out.
89
- if (severity != null ) {
90
- // Config severities override processor severities
91
- serverErrors.add (convertAnalysisError (
92
- error,
93
- lineInfo: lineInfo,
94
- severity: configSeverity ?? severity,
95
- ));
96
- }
97
- } else {
98
- // If no processor, still check for config severities
99
- serverErrors.add (convertAnalysisError (
100
- error,
101
- lineInfo: lineInfo,
102
- severity: configSeverity,
103
- ));
85
+ // Config severities override processor severities
86
+ final severity = configSeverity ?? processor? .severity;
87
+
88
+ // Errors with null severity or NONE are filtered out.
89
+ if (severity == null || severity == analyzer.ErrorSeverity .NONE ) {
90
+ continue ;
104
91
}
92
+
93
+ serverErrors.add (convertAnalysisError (
94
+ error,
95
+ lineInfo: lineInfo,
96
+ severity: severity,
97
+ ));
105
98
}
106
99
return serverErrors;
107
100
}
0 commit comments