Commit Graph

177 Commits

Author SHA1 Message Date
Jacob MacDonald 3e623d7df1 Add --build-summary-only-unlinked flag, which makes the output summary be an unlinked summary instead of a linked one.
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2796953002 .
2017-04-04 12:22:20 -07:00
Brian Wilkerson dd49e79f74 Add context information to driver and add hooks for plugin management
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2795743002 .
2017-04-03 10:13:45 -07:00
Devon Carew b51d1fd8e3 Use ansi color in the dartanalyzer cli output.
BUG=
R=brianwilkerson@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2775633002 .
2017-03-25 15:02:47 -07:00
Jennifer Messerly f3f814b899 fixes #29095, machine mode escapes newline/returns
R=skybrian@google.com

Review-Url: https://codereview.chromium.org/2770493003 .
2017-03-21 19:31:36 -07:00
Nate Bosch 56ad714d6b Correct --persistent_worker arg constraint check
Previously the args were normalized to change an arg with `=` into
separate args. That normalization was removed in
https://github.com/dart-lang/sdk/commit/e321439470ec016e9532afe57b7f2891c0282d83

This fixes an issue with using the analyzer in worker mode on the
current SDK.

- Allow the case where there are 3 args and one of them starts with
  --dart-sdk rather than require it to be the entire string
- Split into two bools with more descriptive names and refactor from an
  if/else chain into a composed condition

R=jakemac@google.com

Review-Url: https://codereview.chromium.org/2733953005 .
2017-03-08 12:10:27 -08:00
danrubel 0c290ae456 echo analysis options information if dartanalyzer --verbose is specified
With this change, if the dartanalyzer --verbose option is specified
then you will see additional output indicating which analysis options
file was read:

Loaded analysis options from /path/to/.analysis_options

In addition, if there are any command line flags that specify/override
an analysis option then you will see something similar to this:

Analysis options: strong = true

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2726783002 .
2017-02-28 17:49:43 -08:00
danrubel 130f43fe7b fix failing bazel workspace relative path test
Review-Url: https://codereview.chromium.org/2720593002 .
2017-02-26 11:14:14 -08:00
danrubel 994a3a2b20 Revert "debug failing test"
This reverts commit c78ea8c231.

Review-Url: https://codereview.chromium.org/2721473002 .
2017-02-26 11:08:19 -08:00
danrubel c78ea8c231 debug failing test
Review-Url: https://codereview.chromium.org/2721453002 .
2017-02-26 09:47:58 -08:00
danrubel 37a6a49744 cleanup --batch-mode sourceFiles
BuildMode, the dartanalyzer driver used when the "--build-mode" option
is supplied, expects sourceFiles in the format "<uri>|<filepath>",
but the rest of the dartanalyzer code base does not understand this format.
This change updates BuildMode to rewrite sourceFiles,
stripping the "<uri>|" prefix, so that it does not cause problems
with code that does not expect this format.

Fix https://github.com/dart-lang/sdk/issues/28889

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2720493002 .
2017-02-26 08:54:51 -08:00
danrubel c04f6a2ab1 fix dartanalyzer find options in bazel workspace
- add dartanalyzer test for bazel workspace
- ensure call to getAnalysisOptions passes an absolute path
- update BasicWorkspace to have an absolute normalized path similar to BazelWorkspace

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2719703005 .
2017-02-26 08:52:55 -08:00
Konstantin Shcheglov 91d62cb226 Remove addFile() invocations in analyzer_cli.
Now that we always get errors when we ask for the result, we don't need
adding these files. This makes analysis of shared tests about 15-20% faster.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2711233002 .
2017-02-23 14:41:31 -08:00
danrubel abee739921 rework analyzer_cli to use ContextBuilder getAnalysisOptions
This is a follow on to https://codereview.chromium.org/2716693003
that refactors analyzer_cli to use ContextBuilder.
As a result, dartanalyzer now correctly finds the default
flutter analysis options when the project references package:flutter
but does not contain an analysis options file.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2710313002 .
2017-02-23 16:52:26 -05:00
danrubel 289888cd0e enhance ContextBuilder getAnalysisOptions to handle lints
This updates ContextBuilder to process the --lints command line option:
* --[no-]lints enables (or disables) lints
* if --lints but no lints specified in analysis options
    then the default set of lints is used
* if --no-lints then lints are turned off
    regardless of what is specified in the analysis options
* if neither --lints nor --no-lints are specified
    then lints are turned on iff analysis options specifies lints

My next step is to update analyzer_cli to use ContextBuilder getAnalysisOptions

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2716693003 .
2017-02-23 16:23:43 -05:00
Devon Carew cf1e1cd2cf Re-land minor tweaks to the analyzer cli's usage text.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2717563003 .
2017-02-23 12:59:43 -08:00
Devon Carew 9dd2a6d452 Revert "Tweaks to the analyzer_cli."
This reverts commit a7ac08d0e7.

BUG=

Review-Url: https://codereview.chromium.org/2709163005 .
2017-02-23 09:39:25 -08:00
Devon Carew a7ac08d0e7 Tweaks to the analyzer_cli.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2709013005 .
2017-02-23 09:02:49 -08:00
Devon Carew 1da570c215 Remove and hide analyzer cli flags.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2713723003 .
2017-02-22 14:09:41 -08:00
Devon Carew 46cacfeae9 Some improvements to the command-line analyzer's output.
BUG=
R=brianwilkerson@google.com, danrubel@google.com

Review-Url: https://codereview.chromium.org/2704103002 .
2017-02-22 12:35:09 -08:00
Devon Carew e415b50ff1 Remove some unused flags for the analyzer cli's build mode.
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2709633006 .
2017-02-22 10:35:49 -08:00
Devon Carew 6e9adf2624 Remove older deprecated flags; more cleanup to the cli help args.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2692203010 .
2017-02-17 13:30:37 -08:00
Devon Carew b4be2c9b1f Options cleanup for the command-line analyzer.
BUG=
R=pquitslund@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2695923012 .
2017-02-17 06:18:55 -08:00
Konstantin Shcheglov e8c2978437 Use only MemoryByteStore in analyzer_cli.
Unfortunately evicting from cache makes it slow to use in potentially
short running cli tool.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2698993002 .
2017-02-16 14:07:42 -08:00
Konstantin Shcheglov b7f17423da Revert "Revert "Reapply "Switch to the new analysis driver in analyzer_cli."""
This reverts commit 64df435361.

Originally landed as https://github.com/dart-lang/sdk/commit/cda7520e5c19425637351be5eae04af7e3136111
No new changes.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2698263002 .
2017-02-16 09:43:31 -08:00
Konstantin Shcheglov 72463adf20 If the state location is not accessible, use MemoryByteStore.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2697653004 .
2017-02-15 08:37:22 -08:00
Zach Anderson 64df435361 Revert "Reapply "Switch to the new analysis driver in analyzer_cli.""
This reverts commit 623d2868a9.

Review-Url: https://codereview.chromium.org/2692073004 .
2017-02-14 15:21:53 -08:00
Konstantin Shcheglov 623d2868a9 Reapply "Switch to the new analysis driver in analyzer_cli."
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2696083002 .
2017-02-14 14:41:42 -08:00
Konstantin Shcheglov 25bc8ddd68 Fix for reporting not analyzed parts with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2695863003 .
2017-02-14 14:18:03 -08:00
Konstantin Shcheglov e97042bec3 Revert "Switch to the new analysis driver in analyzer_cli."
This reverts commit cda7520e5c.

There is a couple of integration tests for embedder analyzer_cli which
are failing, and I cannot find the solution quickly.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2695823005 .
2017-02-14 12:35:46 -08:00
Konstantin Shcheglov cda7520e5c Switch to the new analysis driver in analyzer_cli.
Our internal users use the new analysis driver, and we're enabling it
for everyone in 1.23, AFAIK.

We disable using the file system byte store during internal testing
because we don't want accidentally change analyzer code, run tests
and get all green only because we forgot to update DATA_VERSION.

R=brianwilkerson@google.com, whesse@google.com
BUG=

Review-Url: https://codereview.chromium.org/2694083002 .
2017-02-14 09:04:26 -08:00
danrubel 167107e94c fix dartanalyzer sdk setup
Separate analysis options initialization from context setup
so that analysis options can be used to correctly setup the SDK
in strong mode.

Fix https://github.com/dart-lang/sdk/issues/28507

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2678633002 .
2017-02-04 12:08:53 -05:00
Konstantin Shcheglov 39a5e660cd Call addFile() before getErrors() to actually get errors.
With this change we have only 7 failing shared tests.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2662693002 .
2017-01-27 15:11:09 -08:00
Konstantin Shcheglov 8cca41772d Implement AnalysisDriver.getSourceKind() and use it in analyzer-cli.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2658983004 .
2017-01-27 14:29:44 -08:00
Konstantin Shcheglov 6bb8a923d3 Use AnalysisDriver.getErrors() to get cached errors for already analyzed files.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2656233004 .
2017-01-27 13:26:45 -08:00
Konstantin Shcheglov a3cc5fe7f7 Implement using AnalysisDriver in analyzer_cli. Disabled.
It's not ready to be enabled yet.

There are 11 failing tests in tests/language, and 174 in tests/co19.

It also works about 5 times slower.

But I'd like to land it to make parallel changes to AnalysisDriver and
analyzer_cli to make it pass more tests and be faster.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2657903006 .
2017-01-26 10:16:52 -08:00
Konstantin Shcheglov d142d80af7 Make analyzer_cli batch mode asynchronous.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2659463003 .
2017-01-26 07:25:23 -08:00
Konstantin Shcheglov b206c84210 Reland c9e1b88 and 56726fc with a DDC fix.
Revert "Revert "Use single InputPackagesResultProvider, without SdkSummaryResultProvider.""

This reverts commit b701ad6453.

R=brianwilkerson@google.com, vsm@google.com
BUG=

Review-Url: https://codereview.chromium.org/2647323006 .
2017-01-24 09:13:26 -08:00
Vijay Menon b701ad6453 Revert "Use single InputPackagesResultProvider, without SdkSummaryResultProvider."
This reverts commit c9e1b888a3.

Revert "Remove parent from SummaryResynthesizer."

This reverts commit 56726fcce0.

TBR=scheglov@google.com

Review-Url: https://codereview.chromium.org/2648213007 .
2017-01-24 06:21:38 -08:00
Konstantin Shcheglov c9e1b888a3 Use single InputPackagesResultProvider, without SdkSummaryResultProvider.
Each SummaryResynthesizer is now responsible for creating its TypeProvider.
And with the new AnalysisDriver we stop using SDK CachePartition.

For now we add SDK's summary bundle into SummaryDataStore.
Eventually we will get rid of it and add individual SDK libraries.

R=brianwilkerson@google.com, paulberry@google.com, vsm@google.com
BUG=

Review-Url: https://codereview.chromium.org/2652823002 .
2017-01-23 16:54:17 -08:00
Dan Rubel 13bd1ad0bf DDC/AnalyzerCLI common cmdline option processing
Refactor DDC and Analyzer CLI command line option processing
to use common createContextBuilderOptions method
and ContextBuilderOptions to hold common options.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2584293003 .
2016-12-19 16:24:20 -05:00
danrubel a105d89e2b refactor DDC and Analyzer CLI parser option declaration
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2580933002 .
2016-12-15 14:10:09 -05:00
danrubel e321439470 cleanup Analyzer CLI and DDC arg parsing
This removes the need to split arguments on '='
before calling the extractDefinedVariables method.

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2581723002 .
2016-12-15 12:16:20 -05:00
danrubel 5b84611856 refactor DDC to support --ignore-unrecognized-flags
* add --ignore-unrecognized-flags to DDC
* refactor Analyzer CLI to use same filterUnknownArguments functionality
* remove now unused CommandLineParser and associated tests

R=brianwilkerson@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2578113002 .
2016-12-15 10:46:09 -05:00
danrubel 2c62510f5f move CommandLineParser into analyzer for reuse by DDC
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2578733002 .
2016-12-14 16:31:45 -05:00
danrubel 1417eec66e move extractDefinedVariables from analyzer cli to analyzer
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2571583007 .
2016-12-14 13:22:41 -05:00
Dan Rubel 5aa30397d7 update DDC and analyzer cli preprocessArgs
* refactor Analyzer CLI and DDC to use common preprocessArgs method
* throw clear exception if trailing @file not found or cannot be read
* update preprocessArgs method to always return new list

R=brianwilkerson@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2572813002 .
2016-12-13 14:37:22 -05:00
Dan Rubel 665a12d1b5 add verbose option to show hidden options
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2570053002 .
2016-12-13 11:17:23 -05:00
Brian Wilkerson 756cfc963d Fix warnings
Review-Url: https://codereview.chromium.org/2564323002 .
2016-12-11 16:53:13 -08:00
Brian Wilkerson 86c62a6bad Remove the command-line plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2565993002 .
2016-12-11 10:59:19 -08:00
Brian Wilkerson a01afcd1d1 Remove the options plugin
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2569603002 .
2016-12-11 08:38:29 -08:00