| 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
|
| deleted file mode 100644
|
| index e5297e44f1c46418ef37f446f81516243f2ef863..0000000000000000000000000000000000000000
|
| --- a/pkg/analyzer/lib/src/services/lint.dart
|
| +++ /dev/null
|
| @@ -1,63 +0,0 @@
|
| -// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
| -// for details. All rights reserved. Use of this source code is governed by a
|
| -// BSD-style license that can be found in the LICENSE file.
|
| -
|
| -library lint;
|
| -
|
| -import 'package:analyzer/analyzer.dart';
|
| -import 'package:analyzer/src/generated/utilities_general.dart';
|
| -import 'package:analyzer/src/generated/engine.dart';
|
| -import 'package:analyzer/src/generated/source.dart';
|
| -import 'package:analyzer/src/visitors.dart';
|
| -
|
| -
|
| -/// Implementers contribute lint warnings via the provided error [reporter].
|
| -abstract class Linter {
|
| - /// Used to report lint warnings.
|
| - /// NOTE: this is set by the framework before visit begins.
|
| - ErrorReporter reporter;
|
| -
|
| - /// Return a visitor to be passed to compilation units to perform lint
|
| - /// analysis.
|
| - /// Lint errors are reported via this [Linter]'s error [reporter].
|
| - AstVisitor getVisitor();
|
| -}
|
| -
|
| -/// Traverses a library's worth of dart code at a time to generate lint warnings
|
| -/// over the set of sources.
|
| -///
|
| -/// See [LintCode].
|
| -class LintGenerator {
|
| -
|
| - /// A global container for contributed linters.
|
| - static final List<Linter> LINTERS = <Linter>[];
|
| -
|
| - final Iterable<CompilationUnit> _compilationUnits;
|
| - final AnalysisErrorListener _errorListener;
|
| - final Iterable<Linter> _linters;
|
| -
|
| - LintGenerator(this._compilationUnits, this._errorListener,
|
| - [Iterable<Linter> linters])
|
| - : _linters = linters != null ? linters : LINTERS;
|
| -
|
| - void generate() {
|
| - TimeCounter_TimeCounterHandle timeCounter =
|
| - PerformanceStatistics.lint.start();
|
| - try {
|
| - _compilationUnits.forEach((cu) {
|
| - if (cu.element != null) {
|
| - _generate(cu, cu.element.source);
|
| - }
|
| - });
|
| - } finally {
|
| - timeCounter.stop();
|
| - }
|
| - }
|
| -
|
| - void _generate(CompilationUnit unit, Source source) {
|
| - ErrorReporter errorReporter = new ErrorReporter(_errorListener, source);
|
| - _linters.forEach((l) => l.reporter = errorReporter);
|
| - Iterable<AstVisitor> visitors = _linters.map((l) => l.getVisitor());
|
| - unit.accept(new DelegatingAstVisitor(visitors.where((v) => v != null)));
|
| - }
|
| -}
|
|
|