Commit Graph

38 Commits

Author SHA1 Message Date
Konstantin Shcheglov f45ff0fb71 Issue 46031. Support for multiple directories as analyzer cli inputs.
Bug: https://github.com/dart-lang/sdk/issues/46031
Change-Id: I1f09a7460a46bb78dbae2ea750b303d17eaee9c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-05-19 15:53:27 +00:00
Konstantin Shcheglov 37a91c04b1 Fix PathFilter created when the analysis options file with excludes is not in the context root.
Change-Id: I242473d5fddbe5e3abaa994766959e207453ffb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197114
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2021-04-28 16:48:13 +00:00
Konstantin Shcheglov 2eef1aa1ad Prepare analyzer_cli/ tests for turning Null Safety on by default.
Bug: https://github.com/dart-lang/sdk/issues/43777
Change-Id: I0699915c45369fac5590a6ada4a8ded186612947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-10-28 17:34:30 +00:00
pq da6c506f2c add pubspec linting to dartanalyzer cli
Fixes: https://github.com/dart-lang/sdk/issues/43529

Change-Id: Iab96c2ca7945491e29aeabd70cb260bdb77f491f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168380
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-10-19 18:51:57 +00:00
Sam Rawlins fffa3ac5d4 analyzer_cli: Enforce strict-inference
Change-Id: Idd8a8cdd1e72be5f4d0f1edabdc8254b801d17ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-07-21 03:39:24 +00:00
Konstantin Shcheglov 2efeca700f Rename the folder with sky_engine test package.
R=brianwilkerson@google.com

Change-Id: I38d71292096b53ef932b0c2d3b6dd7f61706e023
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128762
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-17 20:20:09 +00:00
Konstantin Shcheglov f14301b0df Stop supporting _sdkext, look for _embedder.yaml only in sky_engine package.
Change-Id: I20d30ef0e07ec617d5d8b9fb2e5fb97a7fc9930f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128320
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-13 02:15:28 +00:00
Brian Wilkerson a10f6aac38 Finish cleaning up the copyright notices in the analyzer_cli package
Change-Id: I4de3c9e17b4e569c32470ffd1c2061749d3184ed
Reviewed-on: https://dart-review.googlesource.com/c/88439
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-06 19:16:31 +00:00
Konstantin Shcheglov 1b8f3026bf Remove most of isStrongModeError: false, update language_2 tests.
https://github.com/dart-lang/sdk/issues/33022
https://github.com/dart-lang/sdk/issues/28823
https://github.com/dart-lang/sdk/issues/11124

Change-Id: I44427cdab25aae356ec89d677fa142d23d7b42c7
Reviewed-on: https://dart-review.googlesource.com/71428
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-08-29 02:06:45 +00:00
Devon Carew 188ef5e3d5 Analyze all the pkg/ code on the bots.
Bug: https://github.com/dart-lang/sdk/issues/29318
Change-Id: Iccb16ddbccbb43fa7a12eb818c2dde3a75700b97
Reviewed-on: https://dart-review.googlesource.com/64663
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-07-12 16:35:03 +00:00
Brian Wilkerson ea94e65b43 Make preview-dart-2 imply strong-mode
Change-Id: Ifa230f9e64a538e222557ea471dc728ad3dd01d7
Reviewed-on: https://dart-review.googlesource.com/46300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2018-03-13 17:15:39 +00:00
Mike Fairhurst 748cfdff7e Refactor to efficiently find analysis roots correctly fix #31343 & #31344.
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>
2018-03-05 23:51:00 +00:00
Paul Berry 421db9c69c Re-land "Implement proper checking for callability of Function class."
(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>
2018-02-14 11:30:23 +00:00
Paul Berry 35aea15097 Revert "Implement proper checking for callability of Function class."
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>
2018-02-13 19:56:35 +00:00
Paul Berry 6837dafcc3 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>
2018-02-13 14:19:08 +00:00
Devon Carew 5d0056df88 Make the exit code for dartanalyzer more deterministic.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2857203002 .
2017-05-03 11:38:35 -07:00
danrubel c8784af933 rename .analysis_options --> analysis_options.yaml
See https://github.com/dart-lang/sdk/issues/28385

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

Review-Url: https://codereview.chromium.org/2839383003 .
2017-04-30 18:33:10 -04:00
pq 1d4d0d769f CLI support for enableAssertInitializers.
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2809793004 .
2017-04-12 10:38:30 -07:00
Jacob Richman a993294503 Format all analyzer packages
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2753923003 .
2017-03-16 16:11:43 -07: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
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
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
Konstantin Shcheglov 7e9f4ba34c Make the test's dart:core import dart:async in tests.
SDK's version does it, and we probably don't want to protect aginst
something what happens only in tests, but is not expected actually.

R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2696013004 .
2017-02-14 13:31:18 -08:00
Leaf Petersen 0c2bf046f1 Add FutureOr to analyzer_cli test async.dart.
Fixes https://github.com/dart-lang/sdk/issues/28653 .

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

Review-Url: https://codereview.chromium.org/2675203006 .
2017-02-06 17:08:33 -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
Dan Rubel aff6b796f3 update analyzer cli to support include directive in analysis options file
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2541933002 .
2016-11-30 15:16:55 -05:00
Konstantin Shcheglov 92ee0b2488 Fix for the new hint in super_mixin_example.dart in analyzer_cli.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2364763002 .
2016-09-22 15:03:06 -07:00
pq 43bbf11dd8 SDK ext test fix (add missing packages file).
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1988603003 .
2016-05-17 13:49:04 -07:00
Brian Wilkerson 44836f8538 Support the name analysis_options.yaml for analysis options files
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1975963002 .
2016-05-13 07:33:06 -07:00
pq 7913968725 Fix CLI SDK option config timing (#26129).
Fixes: https://github.com/dart-lang/sdk/issues/26129

The issue was that we were creating the SDK and populating its options (notably `strong-mode`) *before* options processors were called.  The result was that client code analysis contexts and SDK contexts were getting configured differently causing confusion when client code was getting analyzed with a non-strong-mode SDK.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1962403002 .
2016-05-10 13:35:40 -07:00
pq 082edc9fa3 Suppress TODOs (#26215).
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1870123002 .
2016-04-08 08:54:59 -07:00
Brian Slesinsky 9e21594c2a add --x-package-warnings-prefix option to dartanalyzer
This is similar to --package-warnings, except that diagnostics will
only be reported for Dart packages matching the given prefix.

Also added the number of source files analyzed and the number of
errors generated to performance report.

Cleanup: simplified code for triggering diet parsing.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1806263004 .
2016-03-21 11:37:49 -07:00
pq 9b1fa223a8 Embedded libs key rename to defuse server landmine.
1.13 stable builds of the SDK contain a version of server that fails catastrophically when analyzing source that imports packages that define embedded libraries. Since we can't pragmatically require more recent SDKs for flutter development we have been prevented from landing embedded libs in the flutter engine.  By renaming the key we use to identify contributed libraries, this change avoids the issue.  Old versions of server will simply ignore the new key and new ones will process it properly.  Win-win!

BUG=
R=danrubel@google.com

Review URL: https://codereview.chromium.org/1643023002 .
2016-01-29 09:52:04 -08:00
pq 3d3c9c5af4 CLI support for embedders (#25380).
Background here: https://github.com/dart-lang/sdk/issues/25380

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1631763007 .
2016-01-26 11:33:14 -08:00
pq 8887cd69f0 Fix analyzer_cli error overrides (#24452).
Brings `analyzer_cli` inline with server wrt processing errors configured in `.analysis_options`.

Note some added complexity due to interactions with flags that globally escalate warnings/hints to errors.

https://github.com/dart-lang/sdk/issues/24452

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1529243002 .
2015-12-16 12:44:38 -08:00
pq 9ae1265ff5 analyzer_cli move to SDK.
Tracking bug: https://github.com/dart-lang/sdk/issues/24731

Note, dartium build changes are in a separate CL: https://codereview.chromium.org/1453413006/

Some tests had to be disabled for want of mockito in the SDK; tracking their reimplementation is here: https://github.com/dart-lang/sdk/issues/24994

BUG=24731
R=whesse@google.com

Review URL: https://codereview.chromium.org/1459683003 .
2015-11-19 14:52:54 -08:00
pq 5cc9a288bb Revert "Move analyzer_cli into the SDK."
This reverts commit a573ed31f1.

BUG=
R=whesse@google.com

Review URL: https://codereview.chromium.org/1462143002 .
2015-11-19 11:28:52 -08:00
pq a573ed31f1 Move analyzer_cli into the SDK.
Build changes to follow.

Tracking bug: https://github.com/dart-lang/sdk/issues/24731

BUG=24731
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1464553003 .
2015-11-19 11:11:17 -08:00