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

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

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: 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: packages/analyzer/lib/src/services/lint.dart
diff --git a/analyzer/lib/src/services/lint.dart b/packages/analyzer/lib/src/services/lint.dart
similarity index 88%
rename from analyzer/lib/src/services/lint.dart
rename to packages/analyzer/lib/src/services/lint.dart
index 9dd51a0e41319bdf55d7645305ae528d9a6fc415..5efc3eae5b4cfdef094b747c3fa4a547fb78fa0a 100644
--- a/analyzer/lib/src/services/lint.dart
+++ b/packages/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.
@@ -27,8 +32,8 @@ 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;
@@ -37,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(() {
« no previous file with comments | « packages/analyzer/lib/src/plugin/plugin_configuration.dart ('k') | packages/analyzer/lib/src/string_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698