Commit Graph

137 Commits

Author SHA1 Message Date
Devon Carew
4764550f9f fail flutter analyze when there are errors (#4117) 2016-05-23 14:39:42 -07:00
Ian Hickson
10c861d6e9 Track number of pending dartdocs too (#4088) 2016-05-20 16:47:44 -07:00
Devon Carew
40c0d6ea12 Consolidate observatory code (#3892)
* 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
2016-05-12 18:15:23 -07:00
Jason Simmons
32846de9f8 Remove ArtifactStore and move flutterRoot into Cache (#3883) 2016-05-12 15:54:35 -07:00
Jason Simmons
a590ee2671 Remove BuildConfigurations (#3879)
Artifacts from local engine builds will be found based on the --local-engine flag
2016-05-12 12:22:15 -07:00
pq
46d32794f9 Analyze update to use in-memory package map.
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.
2016-05-09 09:59:16 -07:00
pq
2df43d50d3 Merge branch 'master' into analysis_rework 2016-05-06 08:58:49 -07:00
pq
eb215c14ac Review cleanup. 2016-05-05 15:16:27 -07:00
Devon Carew
a999366482 remove the analyze --benhcmark-expected option (#3755) 2016-05-05 14:26:21 -07:00
pq
3b882fc449 Updated arg default handling and .dartignore support. 2016-05-05 13:25:59 -07:00
pq
e808125c5b Dead code cleanup. 2016-05-05 12:35:52 -07:00
pq
a59a713f75 Analysis re-work to use analyzer APIs.
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 :)
2016-05-05 12:08:58 -07:00
Devon Carew
1d4cda5d13 fix the benchmark file written by the analyze command (#3725) 2016-05-04 10:01:39 -07:00
Devon Carew
26ed1e71f9 simplify the analysis benchmarking code (#3588)
* simplify the analysis benchmarking code

* review comments
2016-04-28 10:25:26 -07:00
Devon Carew
c69f4396e3 add a benchmarking mode to flutter analyze (#3569)
* add a benchmarking mode to flutter analyze

* change arg names
2016-04-26 14:09:16 -07:00
Ian Hickson
b1e684ea63 Fix crash in analyzer if preamble isn't set. (#3525) 2016-04-25 11:25:29 -07:00
Devon Carew
ace1a64bfd don't print installing device twice (#3520) 2016-04-25 09:25:47 -07:00
Devon Carew
731c5903c2 cache the source lines when running analyze (#3436) 2016-04-20 11:26:24 -07:00
Ian Hickson
a9eddd4860 Also analyze the driver host entry points. (#3395) 2016-04-18 16:33:03 -07:00
Ian Hickson
424a6b1d6a Handle files disappearing during analysis (#3390) 2016-04-18 15:19:32 -07:00
pq
4ff0e842e2 Analyze CLI option to specify a custom Dart SDK.
Handy for testing against specific local SDK builds.

(Note that the option is hidden.)
2016-04-18 09:03:31 -07:00
Devon Carew
4678c12098 find all repo packages (#3368)
* find all repo packages

* .dartignore
2016-04-15 20:25:57 -07:00
pq
de25ea22f7 Adding @optionalTypeArgs.
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! :)
2016-04-14 10:03:46 -07:00
Devon Carew
b172dd5a1a run pub for analyze and test (#3310)
* 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
2016-04-13 19:55:28 -07:00
pq
f270c3d069 Migrate enable-strict-call-checks flag to options file.
As per https://github.com/dart-lang/sdk/issues/25723, moves last command-line flag to `.analysis_options`.
2016-04-11 14:05:44 -07:00
pq
937f0eaf12 Analyze Command lint cleanup.
The push to dev-4 allows us to cleanup a few more bits:
  * `api_docs` lint message special casing (lint fixed)
  * `allowedIdentifiersPattern` (lint fixed)
2016-04-11 11:18:15 -07:00
Devon Carew
7ad1e38eac Fix windows crash (#3236)
* better messaging about windows support

* fix lints
2016-04-11 08:34:01 -07:00
Ian Hickson
5291b37fc7 Track how many public Flutter members lack docs
* 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.
2016-04-04 12:18:13 -07:00
Devon Carew
18d29583d0 pubspec normalization; remove den 2016-04-01 08:33:22 -07:00
Devon Carew
fe37825fd5 run pub with --no-package-symlinks 2016-03-29 19:02:14 -07:00
Adam Barth
522030bdda Remove two flutter analyze regular expressions
We can work around these in code rather than by post-processing the analyzer
output.
2016-03-28 16:33:39 -07:00
Kris Giesing
bb5a82a726 Allow independent rendering pipelines
Fixes #2723
2016-03-24 14:59:21 -07:00
pq
8b321d7de0 Remove analyze tear-off regexp.
In the spirit of https://github.com/flutter/flutter/issues/1220, remove the tear-off regexp in favor of in-line suppressions (if needed).
2016-03-21 11:28:11 -07:00
Devon Carew
f1cdf6df39 refactor; fix apk warning 2016-03-21 09:24:56 -07:00
Hixie
ce4e9cd690 Only require documentation for libraries. 2016-03-18 11:16:12 -07:00
pq
370840ef1f More flutter analyze regexp cleanup
Runs clean on the repo.  Moving ahead, we can manage exceptions via `.analysis_options` or specific source-level ignores.
2016-03-14 15:02:55 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Ian Hickson
d745e20853 Even more types 2016-03-14 09:41:54 -07:00
Adam Barth
95fc5ae070 [rename fixit] *Component* -> *Widget*
This patch renames StatelessComponent to StatelessWidget and
StatefulComponent to StatefulWidget.

Fixes #2308
2016-03-12 12:34:05 -08:00
Hixie
6795efacab Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-12 00:37:31 -08:00
Ian Hickson
43b0104114 Revert "Merge pull request #2639 from Hixie/always_specify_types"
This reverts commit f41b3411da, reversing
changes made to e33d8d9621.

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
2016-03-12 00:34:37 -08:00
Hixie
d162d98c79 Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-11 18:27:32 -08:00
Devon Carew
29df9f5582 show the error code in flutter analyze --watch 2016-03-11 15:59:20 -08:00
pq
0aa07baf70 Migrate flutter analyze config to options.
More groundwork to get `analyze` and IDE output to agree.

See: https://github.com/dart-lang/sdk/issues/25723
2016-03-11 14:52:07 -08:00
Phil Quitslund
b9f28e6f75 Merge pull request #2615 from pq/analyze_cleanup
Analyze command cleanup.
2016-03-11 14:25:24 -08:00
pq
a2dac85f87 Re-added conflictingNamesPattern. 2016-03-11 13:12:07 -08:00
Devon Carew
94157c91e9 regenerate the i18n files 2016-03-11 10:58:30 -08:00
pq
aedef5139b Analyze command cleanup.
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...
2016-03-11 10:35:17 -08:00
Ian Hickson
1b9cd52081 Enable ALL THE LINTS
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
2016-03-10 23:15:31 -08:00
Devon Carew
b9fafc1765 adjust a regex for intl files 2016-03-10 14:21:23 -08:00
Devon Carew
780e4e6212 move the analysis_options to a file 2016-03-10 13:47:20 -08:00
Hixie
c7339de6bc Enable always_declare_return_types lint
And fix a zillion omissions this uncovered.
2016-03-09 17:57:39 -08:00
Hixie
8950d3ccc4 Make flutter analyze useful for package conflicts
Also, resolve our package conflict, since reflectable has been fixed.
2016-03-09 17:41:05 -08:00
Hixie
5810cd80bd Avoid 'as' keyword
It has performance implications in release mode.

We'll enable the lint once https://github.com/dart-lang/linter/issues/195 is fixed.
2016-03-09 15:00:55 -08:00
Devon Carew
52efc7fb68 implement --watch for flutter analyze 2016-03-07 13:46:42 -08:00
Ian Hickson
047276a666 Random fixes to dartdocs, http lib, analyzer
This is a variety of trivial fixes that I collected while going through the dartdocs.
This does contain some non-comment changes.
2016-03-03 23:56:40 -08:00
Devon Carew
d911aaa6d0 refactot the stop command to not use DeviceStore 2016-03-03 00:22:40 -08:00
Yegor Jbanov
6d35481cfa add smoke driver test; find by tooltip; retry predicate 2016-02-29 16:50:47 -08:00
Hixie
ba918fea26 flutter analyze: handle missing files 2016-02-26 18:59:07 -08:00
Hixie
a9040433ad Handle lines getting shorter during analysis 2016-02-26 15:37:43 -08:00
Hixie
a33e256ab8 Handle conflicting 'library' identifiers
Also, handle the new directory structure of the flutter repo.
2016-02-26 10:58:39 -08:00
pq
fdb2819e1e Ignore errors via analysis options.
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! :)
2016-02-25 13:49:05 -08:00
pq
b69d249460 Enumerate lints for analysis in synthesized options file.
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.
2016-02-23 15:07:55 -08:00
Devon Carew
d5a6fceee5 add a summary option to the doctor class 2016-02-17 09:33:45 -08:00
Devon Carew
2dbceafbc6 introduce globals scoped to the app's context 2016-02-09 22:03:13 -08:00
Adam Barth
3c8cbef973 Rationalize RenderViewport and RenderVirtualViewport
These classes now share more code and have feature parity.
2016-02-09 10:30:52 -08:00
Devon Carew
d6b4759fee tweak the output for the analyze command 2016-01-30 22:06:26 -08:00
Devon Carew
d7fbf5302d use status(), error(), and trace() for logging
rename to printTrace(), printStatus(), and printError()
2016-01-28 12:44:17 -08:00
Ian Hickson
5494323db9 Move us to HashSet to avoid the overhead of tracking the order 2016-01-23 18:13:13 -08:00
Ian Hickson
62673cf67b Merge pull request #1286 from Hixie/better-analyze
Make 'flutter analyze' support analyzing arbitrary files
2016-01-17 22:34:13 -08:00
Ian Hickson
1f6ed67bd9 Make 'flutter analyze' support analyzing arbitrary files
Before we didn't know how to find the packages of random files. Now we do.
2016-01-16 13:38:47 -08:00
Ian Hickson
9eb978443b Prepare flutter analyze for dart 1.14 2016-01-16 11:28:13 -08:00
Devon Carew
0f55ebe503 fixes to flutter analyze for the latest dev sdk 2016-01-12 19:04:19 -08:00
Eric Seidel
9257682b01 Remove stray period added from web editor. 2016-01-12 17:09:15 -08:00
Eric Seidel
a6e8fccb90 Correct display error for flutter analyze timing
Fixes #1213.
2016-01-12 17:08:38 -08:00
Eric Seidel
001c107858 Teach analyze how to print out the total time spent
Makes it more obvious that flutter analyze takes a long time.

@Hixie
2016-01-12 09:20:36 -08:00
Ian Hickson
7151fdd054 Move flutter tests from packages/unit to packages/flutter/test 2015-12-16 08:00:57 -08:00
Hixie
0a6b0f9b0b Always import our packages when analyzing. 2015-12-14 12:56:31 -08:00
Hixie
889a1e8eb3 Analyze more tests. 2015-12-14 11:06:42 -08:00
Ian Hickson
0290622bc6 Analyzer improvements
- strengthen analyzer against error messages that point past the
  bottom of the file.

- ignore any errors in intl's auto-generated files.
2015-12-03 19:52:23 -08:00
Adam Barth
9662d49e12 Clean up code organization in flutter_tools
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.
2015-11-28 21:16:55 -08:00
Ian Hickson
92a6212007 dev/update_packages.dart --upgrade
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.
2015-11-27 20:01:13 -08:00
Adam Barth
4cd1fb177a Fix analyzer warnings in updater package
This class was renamed to MojoEventSubscription.
2015-11-20 13:12:27 -08:00
Hixie
56b9245b1a Allowing us to have a single error seems silly. 2015-11-17 11:08:46 -08:00
Hixie
8ab229f89c Make the analyzer actually work.
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.
2015-11-12 15:41:04 -08:00
Hixie
4a5713acc8 Delete analyzer temporary directories 2015-11-12 13:11:41 -08:00
Hixie
a0227cab15 flutter analyze command
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.
2015-11-12 12:23:29 -08:00