* rename service_protocol.dart to protocol_discovery.dart
* add a wrapper around the obs. protocol
* use json-rpc in run
* consolidate obs. code; implement flutter run --benchmark
* review comments
Updates the analyze command to pass a package map to analysis rather than a file path.
This allows us to avoid creating a needless temporary `.packages` file and host directory and saves us a trip to disk to retrieve the contents when building our URI resolvers for analysis.
Introduces a new Dart analysis wrapper that works directly with the analyzer API (in favor of shelling out to a separate process).
Some consequences:
* we no longer need to fear parts (simplifying our dart file gathering)
* we can filter by error code (when needed), rather than by error strings
* no more IO scraping
* no need to generate `main()` or to run with `--package-warnings`
* we now specify an analyzer (and linter) version in the pubspec (we’ll want to make sure this doesn’t diverge too far from the analyzer shipped with the SDK but it does give us some room to play with experimental builds)
* no more (re)scanning of error source files (and so no more source cache)
* should generally be a bit simpler and easier to maintain
* runs a bit faster :)
With the new dev build we've got the updated linter and so can use the `@optionalTypeArgs` annotation (in `meta 0.12.0`).
Bonus: this lets us clean up one more Regexp in the `analyze` command! :)
* run pub for analyze and test
* don't run pub when doing repo analysis
* move logic for when to run pub into the commands
* re-write ternary expression
The push to dev-4 allows us to cleanup a few more bits:
* `api_docs` lint message special casing (lint fixed)
* `allowedIdentifiersPattern` (lint fixed)
* Enable the lint require documentation.
* Track how many public Flutter members lack docs
* Rename the .analysis_options file
This makes Atom happier in the flutter_tools package.
Removing some special-casing in pursuit of aligning `flutter analyze` output with that provided by server/IDEs. Specifically:
* strong-hints (stale, no longer supported)
* "analyzer says" comment handling in favor of `//ignore`s
* `conflictingNamePattern` --- no longer needed
Next up some of the error filter regexps...
Well, all the easy ones, anyway.
For some reason `// ignore:` isn't working for me so I've disabled
lints that need that. Also disabled those that require a ton of work
(which I'm doing, but not in this PR, to keep it reviewable).
This adds:
- avoid_init_to_null
- library_names
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- sort_constructors_first
- sort_unnamed_constructors_first
- unnecessary_getters_setters
Migrates error suppression from regexps to analysis options.
* Ignore TODOs.
* Ignore strong mode field and method overrides (see `InvalidFieldOverride` and `InvalidMethodOverride` in `strong/info.dart`.
* Remove stale regexp to capture refs to dead `dart:ui_internals` URI.
* Remove stale regexp to capture dead strong mode "will need runtime check to cast to type" error (https://github.com/dart-lang/sdk/issues/24542).
5 regexp downs, another small handful (~4) to go! :)
This enables us to exclude `library_names` pending a new stable SDK push (see notes: https://github.com/flutter/flutter/pull/1996). Also excluded are a few lints who's feedback was just getting regexp'ed out. Moving forward, this will allow us to selectively enable specific lints of interest as well.
1) Moved basic utility code into base/ directory to make it clear which code
doesn't depend on Flutter-specific knowldge.
2) Move the CommandRunner subclasses into a runner/ directory because these
aren't commands themselves.
Add an --upgrade flag to the dev/update_packages.dart flag which runs
'pub upgrade' instead of 'pub get'. Tell people to use this when using
'flutter analyze' since 'pub get' doesn't have the same guarantee of
getting everything in sync.
Turns out that ignoring all error lines that match the empty string is a
poor way to go.
Also, we have to update all the example packages now too, since we
analyze them. So just have travis use our update script.
Also, remove flutter_tools' old travis stuff. It's now part of a bigger
repo.
Also, make travis use the dev Dart SDK, since we need the new analyzer.
Stable is way too out of date, e.g. it still complains about libraries
not having names and mixins using 'super', and the strong mode hints are
even more aggressive than on dev.
Other changes in this patch:
- Make the 'flutter' tool say "Updating flutter tool..." when it calls
pub get, to avoid confusion about what the pub get output is about.
- Make the bash flutter tool call pub get when the revision has
changed. (This was already happening on Windows.)
- Fix a raft of bugs found by the analyzer.
- Fix some style nits in various bits of code that happened to be near
things the analyzer noticed.
- Remove the logic in "flutter test" that would run "pub get", since
upon further reflexion it was determined it didn't work anyway.
We'll probably have to add better diagnostics here and say to run the
updater script.
- Remove the native velocity tracker script, since it was testing code
that has since been removed.
Notes on ignored warnings:
- We ignore warnings in any packages that are not in the Flutter repo or
in the author's current directory.
- We ignore various irrelevant Strong Mode warnings. We still enable
strong mode because even though it's not really relevant to our needs,
it does (more or less accidentally) catch a few things that are
helpful to us.
- We allow CONSTANTS_LIKE_THIS, since we get some of those from other
platforms that we are copying for sanity and consistency.
- We allow one-member abstract classes since we have a number of them
where it's perfectly reasonable.
- We unfortunately still ignore warnings in mojom.dart autogenerated
files. We should really fix those but that's a separate patch.
- We verify the actual source file when we see the 'Name non-constant
identifiers using lowerCamelCase.' lint, to allow one-letter variables
that use capital letters (e.g. for physics expressions) and to allow
multiple-underscore variable names.
- We ignore all errors on lines that contain the following magic
incantation and a "#" character:
// analyzer doesn't like constructor tear-offs
- For all remaining errors, if the line contains a comment of the form
// analyzer says "..."
...then we ignore any errors that have that "..." string in them.