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

Unified Diff: pkg/analyzer/lib/src/services/lint.dart

Issue 2522543007: Remove uses of configuration data (Closed)
Patch Set: clean-up Created 4 years, 1 month 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/lib/src/generated/error.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/services/lint.dart
diff --git a/pkg/analyzer/lib/src/services/lint.dart b/pkg/analyzer/lib/src/services/lint.dart
index 795b0322053fbe68a94c11bdc8185d5ef067ed7b..097a8df3bfe1412c8511fdf01ffcdff76c39cc9b 100644
--- a/pkg/analyzer/lib/src/services/lint.dart
+++ b/pkg/analyzer/lib/src/services/lint.dart
@@ -9,15 +9,6 @@ import 'dart:collection';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/task/model.dart';
-import 'package:analyzer/task/model.dart';
-
-const List<Linter> _noLints = const <Linter>[];
-
-/// The descriptor used to associate lints with analysis contexts in
-/// configuration data.
-final ResultDescriptor<List<Linter>> CONFIGURED_LINTS_KEY =
- new ResultDescriptorImpl('configured.lints', _noLints);
/// Shared lint registry.
LintRegistry lintRegistry = new LintRegistry();
@@ -25,11 +16,14 @@ LintRegistry lintRegistry = new LintRegistry();
/// Return lints associated with this [context], or an empty list if there are
/// none.
List<Linter> getLints(AnalysisContext context) =>
- context.getConfigurationData(CONFIGURED_LINTS_KEY) ?? _noLints;
+ context.analysisOptions.lintRules;
/// Associate these [lints] with the given [context].
void setLints(AnalysisContext context, List<Linter> lints) {
- context.setConfigurationData(CONFIGURED_LINTS_KEY, lints);
+ AnalysisOptionsImpl options =
+ new AnalysisOptionsImpl.from(context.analysisOptions);
+ options.lintRules = lints;
+ context.analysisOptions = options;
}
/// Implementers contribute lint warnings via the provided error [reporter].
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/lib/src/task/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698