Revert "Merge pull request #2639 from Hixie/always_specify_types"
This reverts commitf41b3411da, reversing changes made toe33d8d9621. This was a bad check-in due to my mangling uploading a new version of the branch from a different machine. This reverts https://github.com/flutter/flutter/pull/2639 and will be replaced by https://github.com/flutter/flutter/pull/2640
This commit is contained in:
@@ -37,7 +37,7 @@ import 'src/runner/flutter_command_runner.dart';
|
||||
/// Main entry point for commands.
|
||||
///
|
||||
/// This function is intended to be used from the [flutter] command line tool.
|
||||
Future<Null> main(List<String> args) async {
|
||||
Future main(List<String> args) async {
|
||||
bool help = args.contains('-h') || args.contains('--help');
|
||||
bool verbose = args.contains('-v') || args.contains('--verbose');
|
||||
bool verboseHelp = help && verbose;
|
||||
@@ -73,7 +73,7 @@ Future<Null> main(List<String> args) async {
|
||||
|
||||
if (result is int)
|
||||
exit(result);
|
||||
}, onError: (dynamic error, Chain chain) {
|
||||
}, onError: (error, Chain chain) {
|
||||
if (error is UsageException) {
|
||||
stderr.writeln(error);
|
||||
// Argument error exit code.
|
||||
|
||||
@@ -336,7 +336,6 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
|
||||
RegExp generalPattern = new RegExp(r'^\[(error|warning|hint|lint)\] (.+) \(([^(),]+), line ([0-9]+), col ([0-9]+)\)$');
|
||||
RegExp allowedIdentifiersPattern = new RegExp(r'_?([A-Z]|_+)\b');
|
||||
RegExp classesWithOptionalTypeArgumentsPattern = new RegExp(r'\b(GlobalKey|State|ScrollableState|Element|StatelessComponentElement|TypeMatcher)\b');
|
||||
RegExp constructorTearOffsPattern = new RegExp('.+#.+// analyzer doesn\'t like constructor tear-offs');
|
||||
RegExp conflictingNamesPattern = new RegExp('^The imported libraries \'([^\']+)\' and \'([^\']+)\' cannot have the same name \'([^\']+)\'\$');
|
||||
RegExp missingFilePattern = new RegExp('^Target of URI does not exist: \'([^\')]+)\'\$');
|
||||
@@ -389,11 +388,6 @@ class AnalyzeCommand extends FlutterCommand {
|
||||
} else if (level == 'lint' && errorMessage == 'Name non-constant identifiers using lowerCamelCase.') {
|
||||
if (allowedIdentifiersPattern.matchAsPrefix(sourceLine, colNumber-1) != null)
|
||||
shouldIgnore = true;
|
||||
} else if (level == 'lint' && errorMessage == 'Specify type annotations.') {
|
||||
// we want the type annotations on certain classes to be optional.
|
||||
// see https://github.com/dart-lang/linter/issues/196
|
||||
if (classesWithOptionalTypeArgumentsPattern.matchAsPrefix(sourceLine, colNumber-1) != null)
|
||||
shouldIgnore = true;
|
||||
} else if (constructorTearOffsPattern.allMatches(sourceLine).isNotEmpty) {
|
||||
shouldIgnore = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user