Remove some flutter specific analysis code.

Change-Id: Ib48f8527c40d9f9cb9349cadcf94e7bc82330222
Reviewed-on: https://dart-review.googlesource.com/49831
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index e111a67..ac0d78b 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -17,7 +17,6 @@
 import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analyzer/instrumentation/file_instrumentation.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
-import 'package:analyzer/src/context/builder.dart';
 import 'package:analyzer/src/dart/sdk/sdk.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/sdk.dart';
@@ -199,12 +198,6 @@
   static const String FILE_READ_MODE = "file-read-mode";
 
   /**
-   * The name of the flag used when analyzing the flutter repository.
-   * See comments in source for `flutter analyze --watch`.
-   */
-  static const FLUTTER_REPO = "flutter-repo";
-
-  /**
    * The name of the option used to print usage information.
    */
   static const String HELP_OPTION = "help";
@@ -321,8 +314,6 @@
     }
     analysisServerOptions.useCFE = results[USE_CFE];
 
-    ContextBuilderOptions.flutterRepo = results[FLUTTER_REPO];
-
     telemetry.Analytics analytics = telemetry.createAnalyticsInstance(
         'UA-26406144-29', 'analysis-server',
         disableForSession: results[SUPPRESS_ANALYTICS_FLAG]);
@@ -501,10 +492,6 @@
         help: "enable sending instrumentation information to a server",
         defaultsTo: false,
         negatable: false);
-    parser.addFlag(FLUTTER_REPO,
-        help: 'used by "flutter analyze" to enable specific lints'
-            ' when analyzing the flutter repository',
-        hide: false);
     parser.addFlag(HELP_OPTION,
         help: "print this help message without starting a server",
         abbr: 'h',
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index 5b3e1db..7be888a 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -28,7 +28,6 @@
 import 'package:analyzer/src/generated/workspace.dart';
 import 'package:analyzer/src/lint/registry.dart';
 import 'package:analyzer/src/plugin/resolver_provider.dart';
-import 'package:analyzer/src/services/lint.dart';
 import 'package:analyzer/src/source/package_map_resolver.dart';
 import 'package:analyzer/src/summary/summary_sdk.dart';
 import 'package:analyzer/src/task/options.dart';
@@ -487,18 +486,6 @@
           verbose('Using default lint rules');
         }
       }
-      if (ContextBuilderOptions.flutterRepo) {
-        // TODO(devoncarew): Should we still be auto-inserting this?
-        const lintName = 'public_member_api_docs';
-        Linter rule = options.lintRules.firstWhere(
-            (Linter lint) => lint.name == lintName,
-            orElse: () => null);
-        if (rule == null) {
-          rule = Registry.ruleRegistry
-              .firstWhere((Linter lint) => lint.name == lintName);
-          options.lintRules = new List.from(options.lintRules)..add(rule);
-        }
-      }
     } else {
       verbose('Using default analysis options');
     }
@@ -656,12 +643,6 @@
  */
 class ContextBuilderOptions {
   /**
-   * A flag indicating that the flutter repository is being analyzed.
-   * See comments in source for `flutter analyze --watch`.
-   */
-  static bool flutterRepo = false;
-
-  /**
    * The results of parsing the command line arguments as defined by
    * [defineAnalysisArguments] or `null` if none.
    */
diff --git a/pkg/analyzer/test/src/context/builder_test.dart b/pkg/analyzer/test/src/context/builder_test.dart
index 2601fcd..17789d4368 100644
--- a/pkg/analyzer/test/src/context/builder_test.dart
+++ b/pkg/analyzer/test/src/context/builder_test.dart
@@ -736,34 +736,6 @@
     _expectEqualOptions(options, expected);
   }
 
-  void test_getAnalysisOptions_default_flutter_repo() {
-    _defineMockLintRules();
-    AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
-    builderOptions.defaultOptions = defaultOptions;
-    AnalysisOptionsImpl expected = new AnalysisOptionsImpl();
-    expected.lint = true;
-    expected.lintRules = <Linter>[_mockLintRule, _mockPublicMemberApiDocs];
-    String packagesFilePath =
-        resourceProvider.convertPath('/some/directory/path/.packages');
-    createFile(packagesFilePath, 'flutter:/pkg/flutter/lib/');
-    String optionsFilePath = resourceProvider
-        .convertPath('/pkg/flutter/lib/analysis_options_user.yaml');
-    createFile(optionsFilePath, '''
-linter:
-  rules:
-    - mock_lint_rule
-''');
-    String projPath = resourceProvider.convertPath('/some/directory/path');
-    AnalysisOptions options;
-    try {
-      ContextBuilderOptions.flutterRepo = true;
-      options = builder.getAnalysisOptions(projPath);
-    } finally {
-      ContextBuilderOptions.flutterRepo = false;
-    }
-    _expectEqualOptions(options, expected);
-  }
-
   void test_getAnalysisOptions_default_noOverrides() {
     AnalysisOptionsImpl defaultOptions = new AnalysisOptionsImpl();
     defaultOptions.enableLazyAssignmentOperators = true;