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

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

Issue 1720963003: Initial hermetic package analyzer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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_cli/lib/src/driver.dart » ('j') | pkg/analyzer_cli/lib/src/package_analyzer.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/lib/src/analyzer_impl.dart
diff --git a/pkg/analyzer_cli/lib/src/analyzer_impl.dart b/pkg/analyzer_cli/lib/src/analyzer_impl.dart
index 75cbe52ac4a944851cc9ba2e792f875943f5f7b1..56eaa2fbec13b396221be7e6333f8b1270788a61 100644
--- a/pkg/analyzer_cli/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer_cli/lib/src/analyzer_impl.dart
@@ -224,35 +224,8 @@ class AnalyzerImpl {
formatter.formatErrors(errorInfos);
}
- /// Check various configuration options to get a desired severity for this
- /// [error] (or `null` if it's to be suppressed).
- ProcessedSeverity _processError(AnalysisError error) {
- ErrorSeverity severity = computeSeverity(error, options, context);
- bool isOverridden = false;
-
- // First check for a filter.
- if (severity == null) {
- // Null severity means the error has been explicitly ignored.
- return null;
- } else {
- isOverridden = true;
- }
-
- // If not overridden, some "natural" severities get globally filtered.
- if (!isOverridden) {
- // Check for global hint filtering.
- if (severity == ErrorSeverity.INFO && options.disableHints) {
- return null;
- }
-
- // Skip TODOs.
- if (severity == ErrorType.TODO) {
- return null;
- }
- }
-
- return new ProcessedSeverity(severity, isOverridden);
- }
+ ProcessedSeverity _processError(AnalysisError error) =>
+ processError(error, options, context);
LibraryElement _resolveLibrary() {
return _resolveLibraryTag.makeCurrentWhile(() {
@@ -303,6 +276,37 @@ class AnalyzerImpl {
// Not found.
return null;
}
+
+ /// Check various configuration options to get a desired severity for this
+ /// [error] (or `null` if it's to be suppressed).
+ static ProcessedSeverity processError(AnalysisError error,
+ CommandLineOptions options, AnalysisContext context) {
+ ErrorSeverity severity = computeSeverity(error, options, context);
+ bool isOverridden = false;
+
+ // First check for a filter.
+ if (severity == null) {
+ // Null severity means the error has been explicitly ignored.
+ return null;
+ } else {
+ isOverridden = true;
+ }
+
+ // If not overridden, some "natural" severities get globally filtered.
+ if (!isOverridden) {
+ // Check for global hint filtering.
+ if (severity == ErrorSeverity.INFO && options.disableHints) {
+ return null;
+ }
+
+ // Skip TODOs.
+ if (severity == ErrorType.TODO) {
+ return null;
+ }
+ }
+
+ return new ProcessedSeverity(severity, isOverridden);
+ }
}
/// This [Logger] prints out information comments to [outSink] and error messages
« no previous file with comments | « no previous file | pkg/analyzer_cli/lib/src/driver.dart » ('j') | pkg/analyzer_cli/lib/src/package_analyzer.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698