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

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

Issue 1392143002: Add context to OptionsProcessor callback API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Master merge Created 5 years, 2 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
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 5601c4ab095f153f4753aa2f08dc26cfae8554ba..5efc3eae5b4cfdef094b747c3fa4a547fb78fa0a 100644
--- a/pkg/analyzer/lib/src/services/lint.dart
+++ b/pkg/analyzer/lib/src/services/lint.dart
@@ -10,6 +10,11 @@ import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/visitors.dart';
+/// A registry containing mappings of contexts to their associated configured
+/// lints.
+final Map<AnalysisContext, List<Linter>> lintRegistry =
+ <AnalysisContext, List<Linter>>{};
+
/// Implementers contribute lint warnings via the provided error [reporter].
abstract class Linter {
/// Used to report lint warnings.
@@ -28,6 +33,7 @@ abstract class Linter {
/// See [LintCode].
class LintGenerator {
/// A global container for contributed linters.
+ @deprecated // Use lintRegistry.
static final List<Linter> LINTERS = <Linter>[];
final Iterable<CompilationUnit> _compilationUnits;
@@ -36,7 +42,7 @@ class LintGenerator {
LintGenerator(this._compilationUnits, this._errorListener,
[Iterable<Linter> linters])
- : _linters = linters != null ? linters : LINTERS;
+ : _linters = linters ?? LINTERS;
void generate() {
PerformanceStatistics.lint.makeCurrentWhile(() {

Powered by Google App Engine
This is Rietveld 408576698