Based on https://dart-review.googlesource.com/c/sdk/+/52340, but adds
the necessary plumbing through the test system to pass through
negations to strong and preview-dart-2. Also adds support for those
negations to the analyzer.
Change-Id: I9793ff28bb593d25bbb0a2ed8736b5b53e0a62d8
Reviewed-on: https://dart-review.googlesource.com/52461
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Move logic out into a ContextCache since we're not interested in caching
at least two if not three things (the options, the options path, and
optionally the builder).
Move some convenience methods around accessing contexts into a mixin.
Regarding some semantic decisions for finding analysis roots:
* treat the analysis_options.yaml file as the analysis root if it exists
* if it doesn't exist, assume the directory passed in is the root
* if custom options are provided, assume they "overwrite" the others
_in-place_.
Tests to confirm this logic via excludes configurations with & without
the yaml file specified, passing in the root in some cases and
subdirectories in others.
Also change to use PathFinder for handling wildcards in excludes.
Bug: 31343,31344
Change-Id: I400fe30a1ec379f9040f812fc0bd9481d42a13cf
Reviewed-on: https://dart-review.googlesource.com/41570
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
In CLI no batch, support analyzing multiple files in multiple contexts
Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
for each.
Requires knowing the source being analyzed while creating a context,
which gets a bit hacky with build mode, but seems to work as is.
Suggestions on a cleaner integration there are welcome!
Change-Id: I2648fdb80c0a36a05580ef7267350ffb847c43e9
Reviewed-on: https://dart-review.googlesource.com/42582
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit 126bfebb4e.
Reason for revert: Fails on windows due to forward slash paths, and seems to have one or two other secondary issues.
Original change's description:
> In CLI no batch, support analyzing multiple files in multiple contexts
>
> Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
> for each.
>
> Requires knowing the source being analyzed while creating a context,
> which gets a bit hacky with build mode, but seems to work as is.
> Suggestions on a cleaner integration there are welcome!
>
> Change-Id: Ia4e63fe01342f2299c96ca8d34ca983a9280a911
> Reviewed-on: https://dart-review.googlesource.com/41900
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
TBR=scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com
Change-Id: I0e90d8d4e2256b7087daeeb934ed14da57fd20df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/42540
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Support `dartanalyzer pkg/a/foo pkg/b/foo` and use a different context
for each.
Requires knowing the source being analyzed while creating a context,
which gets a bit hacky with build mode, but seems to work as is.
Suggestions on a cleaner integration there are welcome!
Change-Id: Ia4e63fe01342f2299c96ca8d34ca983a9280a911
Reviewed-on: https://dart-review.googlesource.com/41900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
(was reverted in https://dart-review.googlesource.com/c/sdk/+/40980
due to an analyzer bot breakage)
Original commit message:
Implement proper checking for callability of Function class.
There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks. This flag has been removed, since the new
behavior is now standard in Dart 2.0.
Fixes#31509
Change-Id: Ice5cf38bbc648badf7f2563ff930b69f9a799635
Reviewed-on: https://dart-review.googlesource.com/41120
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This reverts commit 6837dafcc3.
Reason for revert: Broke analyzer bots.
Original change's description:
> Implement proper checking for callability of Function class.
>
> There was some old (incorrect) logic for doing this, behind the flag
> enableStrictCallChecks. This flag has been removed, since the new
> behavior is now standard in Dart 2.0.
>
> Fixes#31509
>
> Change-Id: I4a6da34a4b85ea8409f6e0d14c377a586546056a
> Reviewed-on: https://dart-review.googlesource.com/40509
> Commit-Queue: Paul Berry <paulberry@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com,mfairhurst@google.com
Change-Id: Ib631ad16bc5e937ff914127d1c5330f3fcaff2c9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/40980
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
There was some old (incorrect) logic for doing this, behind the flag
enableStrictCallChecks. This flag has been removed, since the new
behavior is now standard in Dart 2.0.
Fixes#31509
Change-Id: I4a6da34a4b85ea8409f6e0d14c377a586546056a
Reviewed-on: https://dart-review.googlesource.com/40509
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
This CL deprecates the front-end API and moves it into src/api_prototype.
For now all usages have been updated to point to the new location,
but they should be updated to use custom-client invocations instead (e.g.
one specific way for DDC, another for dart2js etc.)
Bug:
Change-Id: I9b4f41f6ebf55d42510fd35240d942d1dc7292d6
Reviewed-on: https://dart-review.googlesource.com/24822
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
We need this to be able to access classes that are required by Fasta,
but come from VM patches.
R=brianwilkerson@google.com, paulberry@google.com
Bug:
Change-Id: I4d29e1dca42e016446516a2dab0fae138cb74548
Reviewed-on: https://dart-review.googlesource.com/16863
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This allows us to collect stats about language-style tests as follows:
./tools/test.py -m release -c dart2analyzer -r none --preview-dart-2 --report \
language language_2 corelib corelib_2
As of this morning, the command above has 87% of the tests passing.
Change-Id: I0f84211d5f33659d5923601267367be90c578107
Reviewed-on: https://dart-review.googlesource.com/3381
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
There is one warning which I'd like to fix in a separate CL.
The rest is because of package:test predicate().
I think Leaf fixed it in 3625f13698R=brianwilkerson@google.com
Bug:
Change-Id: I060f7ced55dbcc460185916251c47ebbd5c838d3
Reviewed-on: https://dart-review.googlesource.com/3404
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
There are many Bazel targets that have huge number of dependencies,
hundreds and thousands of them, and these dependencies are the same
as for other targets. So, we want to keep corresponding PackageBundle
instances, partially decoded, in memory and reuse.
R=brianwilkerson@google.com, paulberry@google.com
BUG=
Review-Url: https://codereview.chromium.org/3006543002 .
This change expects that build mode is always hermetic, i.e. the all
unlinked units that are used for linking are given us as inputs.
We need to separate computing unlinked units from linking, because
linking is synchronous, and access to unlinked units will becore
asynchronous when we switch to using Analysis Driver.
R=brianwilkerson@google.com, paulberry@google.com
BUG=
Review-Url: https://codereview.chromium.org/2994753002 .