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

Unified Diff: pkg/analyzer_cli/lib/src/error_severity.dart

Issue 2933753002: Run the sorter to reduce code churn (Closed)
Patch Set: Created 3 years, 6 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 | « pkg/analyzer_cli/lib/src/error_formatter.dart ('k') | pkg/analyzer_cli/test/driver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/lib/src/error_severity.dart
diff --git a/pkg/analyzer_cli/lib/src/error_severity.dart b/pkg/analyzer_cli/lib/src/error_severity.dart
index 4344bbaaa11142356866b1b150193839df270e83..79a21117f335eb30e22852738641f7766bc22a10 100644
--- a/pkg/analyzer_cli/lib/src/error_severity.dart
+++ b/pkg/analyzer_cli/lib/src/error_severity.dart
@@ -8,28 +8,6 @@ import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/generated/engine.dart' hide AnalysisResult;
import 'package:analyzer_cli/src/options.dart';
-/// Check various configuration options to get a desired severity for this
-/// [error] (or `null` if it's to be suppressed).
-ErrorSeverity determineProcessedSeverity(AnalysisError error,
- CommandLineOptions commandLineOptions, AnalysisOptions analysisOptions) {
- ErrorSeverity severity =
- computeSeverity(error, commandLineOptions, analysisOptions);
- // Skip TODOs categorically unless escalated to ERROR or HINT (#26215).
- if (error.errorCode.type == ErrorType.TODO &&
- severity == ErrorSeverity.INFO) {
- return null;
- }
-
- // TODO(devoncarew): We should not filter hints here.
- // If not overridden, some "natural" severities get globally filtered.
- // Check for global hint filtering.
- if (severity == ErrorSeverity.INFO && commandLineOptions.disableHints) {
- return null;
- }
-
- return severity;
-}
-
/// Compute the severity of the error; however:
/// - if [options.enableTypeChecks] is false, then de-escalate checked-mode
/// compile time errors to a severity of [ErrorSeverity.INFO].
@@ -57,3 +35,25 @@ ErrorSeverity computeSeverity(
return error.errorCode.errorSeverity;
}
+
+/// Check various configuration options to get a desired severity for this
+/// [error] (or `null` if it's to be suppressed).
+ErrorSeverity determineProcessedSeverity(AnalysisError error,
+ CommandLineOptions commandLineOptions, AnalysisOptions analysisOptions) {
+ ErrorSeverity severity =
+ computeSeverity(error, commandLineOptions, analysisOptions);
+ // Skip TODOs categorically unless escalated to ERROR or HINT (#26215).
+ if (error.errorCode.type == ErrorType.TODO &&
+ severity == ErrorSeverity.INFO) {
+ return null;
+ }
+
+ // TODO(devoncarew): We should not filter hints here.
+ // If not overridden, some "natural" severities get globally filtered.
+ // Check for global hint filtering.
+ if (severity == ErrorSeverity.INFO && commandLineOptions.disableHints) {
+ return null;
+ }
+
+ return severity;
+}
« no previous file with comments | « pkg/analyzer_cli/lib/src/error_formatter.dart ('k') | pkg/analyzer_cli/test/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698