Commit Graph

166 Commits

Author SHA1 Message Date
Konstantin Shcheglov e20704c3b0 CQ. Move PackageConfigFileBuilder to analyzer_testing.
Move PackageConfigFileBuilder into the analyzer_testing public API and
deprecate the copy exposed from package:analyzer. The builder is only
used by test infrastructure, so keeping it in analyzer_testing makes the
ownership clearer and avoids exposing test-only utilities from analyzer.

Update the builder API to accept a rootFolder instead of a rootPath.
This lets callers pass the resource-provider folder directly, so the
generated rootUri is derived from the same file-system abstraction that
created the test files. This avoids accidentally passing POSIX paths
where resource provider paths are required, such as on Windows.

Update existing test utilities and callers to import the new library and
pass Folder objects. Remove the production analysis server dependency on
the builder by emitting the temporary plugin package config JSON
directly.

Change-Id: I46b14710626e0d6d5884afcdc5a05b23077acfc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/499081
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-29 13:18:35 -07:00
Sam Rawlins 683ef059f5 Add a --no-plugins option to prevent analyzer plugins from running
Fixes https://github.com/dart-lang/sdk/issues/62353

Change-Id: I902badd0a7a072b98691d88ad7b382828227b1fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-12 11:28:17 -08:00
Sam Rawlins a08b18bf55 DAS: Use a shared mock in plugin_watcher_test
Change-Id: I9a97e5dc5da3a9551e3016b4f203dcb635197d54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471888
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-01-09 12:37:36 -08:00
Sam Rawlins 92bebe661b DAS plugins: Begin storing analytics data
This data is collected on shutdown, the same as the legacy analytics data.

This is implementation for some of the analytics we want to collect,
specified at go/dart-analyzer-plugin-analytics.

* How many plugins are enabled for each context?
* How many lint rules are registered for each plugin?
* How many warning rules are registered for each plugin?
* How many fixes are registered for each plugin?
* How many assists are registered for each plugin?

Change-Id: I36c176737c194550e1947985576ed461fd8a1bf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-05 21:28:18 -08:00
Sam Rawlins 29b942c3f0 DAS plugins: Cache AOT snapshot
Fixes https://github.com/dart-lang/sdk/issues/61684

This caching is based largely on the `--depfile` feature offered by
`dart compile`, which is based on a Ninja depfile concept
(https://ninja-build.org/manual.html#_depfile), which spits out a file
(`depfile.txt` here) which lists all of the input files which were
required to build an AOT snapshot.

The process is essentially:

1. If an AOT snapshot is found, maybe use it as a cached snapshot!
  a. If the `pubspec.yaml` modification timestamp is newer, re-compile!
  b. If the `.dart_tool/package_config.json` modification timestamp is
     newer, re-compile!
  c. If the `bin/plugin.dart` modification timestamp is newer,
     re-compile!
  d. If the `bin/depfile.txt` file is missing or malformed, re-compile!
  e. If any files mentioned in `bin/depfile.txt` have a newer
     modification timestamp, or don't exist, or are an otherwise bad
     path, re-compile!
  f. Otherwise, save a dozen seconds and use the cached snapshot.

Change-Id: Icc747198f8af76d256ac915685473d6f529a3cef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464602
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-03 13:02:20 -08:00
Sam Rawlins 5a9ea6d9ed DAS: Fix broken test on windows
Test introduced by https://dart-review.googlesource.com/c/sdk/+/465662

Change-Id: Ibe66b836c69bfee2665499c010249019a5f7d8d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465820
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-02 18:27:02 -08:00
Sam Rawlins 808f5acf21 DAS: Use ProcessRunner in PluginManager, for testability
Work towards https://github.com/dart-lang/sdk/issues/61684

PluginManager needs to be more testable before implementing the caching feature. This CL lays the groundwork.

We add ProcessManager.runSync, and a handler for that in MockProcessHandler. Then we can add tests which call `PluginManager.filesFor` with `isLegacy: false`, and `dart pub upgrade` will not be run on the real filesystem.

Change-Id: I7b8877d985296741e51543c10a7cb87c8a43c116
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/465662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-02 14:09:45 -08:00
Brian Wilkerson b8b41cbbba Add support for logging communications from plugins
I believe that this is the final piece to having all of the information
needed by the replay tool.

Change-Id: I367d628302c06397706172ba65c0de64972a2a34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459543
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-11-04 14:44:40 -08:00
Sam Rawlins d05ef6e303 analyzer: Make all ContextRootImpl fields final
This includes the `excludedGlobs`, `optionsFile`, and `packagesFile`
fields. In each case of setting the field's value after instantiation,
the code happens _right_ after instantiation, so they can just be
set in the constructor and be final.

Change-Id: If39e8ebd8a52f4bfc81a016bff2f40d00db16a3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/455862
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-10-19 20:41:29 -07:00
Sam Rawlins cff98f605b DAS: Tidy the code around watch events / plugins in the server
* Rename `PluginSession.interestingFiles` to `.interestingFileGlobs`.
  This confused me for a bit, though the doc comment is accurate.
* `PluginManager.broadcastWatchEvent` was needlessly async and
  needlessly returned a Future. It can just return the List of Futures.
* In addition, the implementation of this method is made simpler; the
  previous very long if-condition is broken into a series of
  `if (foo) continue` statements, which allows for nice promotion and
  allows the large comment to sit next to the condition to which it is
  referring.

Change-Id: I77e8f7476b38d21f4c1a991045333d1e19a54143
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452200
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-10-07 09:08:54 -07:00
Sam Rawlins 33f664940a Bump DAS to use Dart SDK 3.9.0
Change-Id: I04bc285d822a657adb5573c6de3eb38655ab0fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448232
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-09-03 12:56:29 -07:00
Sam Rawlins 26102c5d52 DAS plugins: Wire up initial screen for new plugins.
This renames the old screen, "Legacy plugins" and adds a new screen,
"Plugins". On the new plugins screen, we ask the plugins isolate(s) for
their plugins details, and print the following, for eadh plugin:

* the plugin's name
* the names of the registered lint rules
* the names of the registered warning rules
* the IDs and "messages" of the registered assists
* the IDs and "messages" and associated diagnostic codes of the
  registered quick fixes

More to come in follow ups:

* The resolved versions of plugin packages (coming from package_config.json)

Change-Id: Ic3dc4c5bffa64fd4da4097c042a847cc064e41ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/447763
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-09-02 08:38:32 -07:00
Sam Rawlins 649944c76d DAS plugins: Rename PluginInfo to PluginIsolate; move to separate library
Work towards https://github.com/dart-lang/sdk/issues/61386

A few distinct changes:

* Rename PluginInfo to PluginIsolate
* Move PluginInfo and PluginSession to a new library,
  plugin_isolate.dart. PluginSession is _essentially_ a private class
  to PluginIsolate, so it's good to co-locate them.
* Move PluginInfo tests and PluginSession tests to a new library.
* Extract out shared parent class for PluginManager tests,
  PluginIsolate tests, and PluginSession tests.

Change-Id: Ib0c638b8797f51c57c07e277acdaea6d8202f957
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/446960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-08-26 19:02:42 -07:00
Sam Rawlins 456e81eacc DAS: Remove a mock PluginInfo; can use the real one instead
Change-Id: I4c1cdb879f5f0d3370752721298a9b089db5e849
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445523
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-08-16 09:17:29 -07:00
Sam Rawlins 24a54eb1f4 DAS: Remove unnecessary PluginInfo subclasses; privatize members
I don't know the history here, but there was a BuiltInPluginInfo
subclass, which has no instances (dead code), and a
DiscoveredPluginInfo class. So I deleted the former, and merged the
latter into the superclass, PluginInfo.

I also made a few members private, in PluginInfo, PluginManager, and
PluginSession. I modernized comments along the way.

This all paves the way for adding information to PluginInfo about
_new_ plugins, for use in the diagnostics pages.

Change-Id: Ib7c5deebd43e5636141ed36ddb3d5da7cf325883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/445405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-08-15 09:50:30 -07:00
Sam Rawlins 701c6113c2 analyzer: Simplify interface of WorkspacePackage, use File for root
Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I56c14bc941e1204b9d9cc13086f5ed92a1228585
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428623
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-15 11:35:42 -07:00
Sam Rawlins c4c9854b9b analyzer_testing: Move ResourceProviderMixin to analyzer_testing
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I31932409e495369793dd16c017385c98b86cf44c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427480
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 16:56:29 -07:00
Sam Rawlins 3021cc4913 analyzer: Move PackageConfigFileBuilder to public API.
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I3df2cd374f6b3ef9e027f0e07c748be6ea21ebb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427586
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 10:57:55 -07:00
Sam Rawlins 739ca671af Deprecate MemoryResourceProvider.convertPath in favor of extension
Work towards https://github.com/dart-lang/sdk/issues/55660

The comment for `MemoryResourceProvider.convertPath` includes:

> This is a utility method for testing; paths passed in to other
> methods in this class are never converted automatically.

and indeed, the actual impl of this method is found in an extension,
in analyzer's test_utilities/ directory. It seems to me better to
leave a testing utility as a testing utility, and not expose it in
the public API of MemoryResourceProvider.

Additionally, the extension method is used by `ResourceProviderMixin`,
which is moving to the public analyzer_testing package. It is illegal
to have a circular non-dev dependency between the analyzer package
and the analyzer_testing package.

The migration for the ~half dozen test files that use this method is
to call the extension method directly. Sometimes with an extension
override, and sometimes without.

Change-Id: I9c2e18600461134bfd91c082b3af0d5079600f0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426984
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-07 13:10:03 -07:00
Danny Tuppeny 5803acf31f [analysis_server] Update plugin tests to work through test runner
This removes a use of `Platform.script` so the tests work through the test runner. It also extracts some common code between this and the other integration tests to remove some duplication.

Change-Id: Ia9d441424789ea99decb071f7fdc6c71c8e54a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419860
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2025-04-02 09:06:09 -07:00
Sam Rawlins 641ec4c515 DAS: report exceptions caught in plugin isolate as plugin exceptions
This change means that during `dart analyze`, an exception caught in a plugin isolate will be printed to the terminal, and the process will
exit (similar to the support for when the isolate has static errors).

Change-Id: I31b1ebe7a71a331274d4f1dc1ea1b94f33e2329b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415981
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-18 10:03:22 -07:00
Sam Rawlins 3f4a341fea DAS plugins: Log an isolate-spawning exception to terminal
Change-Id: Iafe061914a34d883b2683b5edae0ee73f75325c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413320
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-03 14:39:03 -08:00
Sam Rawlins ca31648dbb Support 'new' analyzer plugins in dart analyze.
This change allows the LegacyAnalysisServer to understand when the
plugin isolate (if there is one) is analyzing or not. There are a few
primary concepts:

* The plugin isolate (PluginServer) notifies the analysis server, when
  analyzing all files in a context collection, and analyzing changed
  files, that it is analyzing, and later that it isn't.
* The NotificationManager tracks whether the plugin isolate is analyzing
  or not, based on the last status.
* The PluginManager tracks whether new plugins are initialized or not.
  This is determined by the work done by the PluginWatcher. If no
  plugins are configured, then plugins are declared to be "initialized".
  Otherwise, the AnalysisServer sets their status to be "initialized"
  after receiving the first status notification from the plugin isolate.
* The LegacyAnalysisServer now uses the additional "are plugins
  analyzing" signal, held in NotificationManager, and the "are plugins
  initializing" signal, held in PluginManager, to determine whether to
  notify the client that analysis is complete.


Change-Id: Ie2b6a6048f074d7a26d7d5d07622a17c30fcab96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405444
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-31 10:44:36 -08:00
Sam Rawlins b08eb9d21a DAS plugins: Launch a shared plugin, configured from analysis options
This change is the final piece in enabling plugins in the new style to
be launched from a specification in analysis options.

Work towards https://github.com/dart-lang/sdk/issues/53402

* We support both one legacy analyzer plugin (the current max), and
  a set of new analyzer plugins, which are combined and launched in one
  shared plugin isolate.
* Make PluginLocator.pluginMap private.
* Add a parameter to PluginManager.addPluginToContextRoot:
  isLegacyPlugin. This method is used for both legacy and new plugins,
  but has slightly different behavior, finding where the plugin files
  are.

Change-Id: I6644aecd4283eea22586ffd051a01b0ec8987fc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-12-10 16:14:49 +00:00
Sam Rawlins fbf331e0dd DAS: reformat source code with tall-style
Change-Id: I42b4a44fd6a2197e499e8623274b3cd1a4b5556f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394003
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-06 23:04:00 +00:00
Sam Rawlins 1033027175 Tidy some legacy plugin code
* Update comments to be modern and reference "package config files"
  rather than "packages files"
* Remove commented out code that we aren't going to uncomment.
* Rename PluginFiles.packages.
* Simplify `PluginManager._computeFiles` to use less nesting, and use
  early `throw` statements, rather than storing data in local
  and choosing late whether an exception should be thrown with the
  stored data.

Change-Id: I7d5da0e299962d8887f2222137478a2fd96671b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392960
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-10-31 19:12:30 +00:00
Sam Rawlins 97871aeab5 analyzer: Use less AnalysisOptionsImpl
In many cases, AnalysisOptions is sufficient.

* ResolvedCorrectionProducer will be public API for someone writing an
  analyzer plugin; it should not expose an AnalysisOptionsImpl. Luckily
  the only need for the Impl, today, is in the "ignore diagnostic" fixes
  so we can cast in there. (We could also expose the `file` and the
  `unignorableNames` fields.)
* Some other spots only cast in order to access one of the 'strict'
  fields, but all of those have been made public.
* AnalysisOptionsImpl.enabledLegacyPluginNames can be made final.
* Many other users don't need AnalysisOptionsImpl, or only need it to
  pass it to other code that _does_ need it. In many of those cases it
  makes sense to look at an object as an AnalysisOptions, and let the
  code that needs a field from Impl to do a cast.

Change-Id: I3640934fb9d93c9b95f15a22457af604e420c7a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-10-29 14:22:58 +00:00
Sam Rawlins b1416116b7 analyzer: rename most API references to 'plugins' to 'legacy plugins'
Change-Id: I56217045ff9d4da8a5a556cd709e0f63a507884f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384964
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-12 21:25:56 +00:00
Sam Rawlins 5ee4eb52e6 DAS plugins: Add plugin package generator
This generator will be used create shared plugin package entrypoints from
plugin configurations.

Work towards https://github.com/dart-lang/sdk/issues/53402

Change-Id: If5c6aeb7bc7845311975928fba1cb9c8d273423c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384681
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-09-11 16:54:29 +00:00
Danny Tuppeny 916272331b [analysis_server] Remove the singleton uriConverter and pass explicitly to all toJson/fromJson methods
This avoids accidentally using the converter when talking to plugins, (at least for now) URIs are never expected, and file paths should always be used regardless of which mode the server is in.

This unfortunately touches a _lot_ of code, so I've pushed in many separate patch sets to Gerrit.

Fixes https://github.com/Dart-Code/Dart-Code/issues/5156

Change-Id: I312c3e2cbc35a05a078aaa0138aec7288b3c7dd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373745
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-07-02 14:15:11 +00:00
Brian Wilkerson d080550294 Do not report a crash for a user error
Bug: https://github.com/dart-lang/sdk/issues/55188
Change-Id: Ia7305b19518e87296bf58732a4192e9a9be4bb3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357212
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-03-14 15:13:18 +00:00
Danny Tuppeny 2bf9fefa90 [analyzer] Move convertPath from MemoryResourceProvider to an extension
+ make the implementation of ResourceProviderMixin methods not depend on MemoryResourceProvider.

This is a step towards being able to share more code between tests that use different kinds of ResourceProviders. Although ResourceProviderMixin  currently still has a MemoryResourceProvider, all of the methods themselves can work against any ResourceProvider.

convertPath was moved to an extension in test_utilities (rather than to the base ResourceProvider) because it seems quite test-specific (it assumes any absolute paths are relative to drive C - something we'll need to update to use for non-memory tests.

Change-Id: Ibb3cfb31ebbdac6410868f0395bd19f9ce7b0e18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-05 19:16:23 +00:00
pq 46beb2d8b8 default to an empty analysis options object (vs. null)
Change-Id: Ib2e830e97b1bd853d00055f20ab2919624f48a72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345823
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-12 22:34:58 +00:00
Sam Rawlins 6b6f333e00 analyzer: Do not overwrite an original exception when a plugin crashes
Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.

Some other tidying in the test file:

* inline `byteStorePath`, only used once.
* simplify `_packagesFileContent` and `_getPackagesFileContent`
  into a static getter.
* simplify `_defaultPluginContent` into a const String, so it can
  be used as a function parameter default value

The diff is way bigger than the functional changes, because we sort
elements.


This reverts commit aa6b6470e3.

Change-Id: I9dc533710255534ec27454712a1a64facf5dd12d
Cq-Include-Trybots: luci.dart.try:analyzer-win-release-try,flutter-analyze-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345367
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-01-10 17:47:52 +00:00
Samuel Rawlins aa6b6470e3 Revert "analyzer: Do not overwrite an original exception when a plugin crashes"
This reverts commit 7784cf3f94.

Reason for revert: broke windows bot

Original change's description:
> analyzer: Do not overwrite an original exception when a plugin crashes
>
> Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.
>
> Some other tidying in the test file:
>
> * inline `byteStorePath`, only used once.
> * simplify `_packagesFileContent` and `_getPackagesFileContent`
>   into a static getter.
> * simplify `_defaultPluginContent` into a const String, so it can
>   be used as a function parameter default value
>
> The diff is way bigger than the functional changes, because we sort
> elements.
>
> Change-Id: I193316316750e80268b684fdc1abe558a77994fe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>

Change-Id: Ibeb761afebad4fb4166cec756743dbb35d323e7d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345143
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 23:49:57 +00:00
Sam Rawlins 7784cf3f94 analyzer: Do not overwrite an original exception when a plugin crashes
Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.

Some other tidying in the test file:

* inline `byteStorePath`, only used once.
* simplify `_packagesFileContent` and `_getPackagesFileContent`
  into a static getter.
* simplify `_defaultPluginContent` into a const String, so it can
  be used as a function parameter default value

The diff is way bigger than the functional changes, because we sort
elements.

Change-Id: I193316316750e80268b684fdc1abe558a77994fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-01-05 00:27:30 +00:00
pq 440ea59ee0 enable flutter_style_todos in server
Change-Id: I4921d538e1498e66c8cab2d84dfcad21d1a7b555
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335952
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-14 21:08:12 +00:00
pq 9e6c856c27 migrate to getAnalysisOptionsForFile(file)
This migrates the bulk of the calls to `.analysisOptions`. I'll tackle the remainder in a few follow-ups.

Change-Id: I0f4c78d88938feecaba7202e0dc299dc17e2bb35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334647
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-11-08 21:48:38 +00:00
Konstantin Shcheglov 38546e90ab Pre-fix unreachable_from_main for instance members.
https://github.com/dart-lang/linter/pull/4441

Change-Id: I55afa6b7d78bc1114ce97c1b5bebcf7a8bca5b98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307975
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-06-09 22:39:27 +00:00
Konstantin Shcheglov 6055524426 Use File instead of String path in AbstractContextTest.
Change-Id: I30ea3f08f8954e4d642aaf070e0da313013ad153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/308162
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-06-08 19:21:31 +00:00
pq 05965ef720 + fix dangling library comments
Change-Id: Ia857fec46ddf83d307cd19450cea88aab8c86a38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294430
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-04-11 20:17:38 +00:00
pq ad2da86f18 linter 1.33.0 rc
Some notes.

* There are a number of tests that should get decoupled from the linter being pulled into `DEPS`.  Instead of depending on the state of lints there, we should update the tests instead to use a more hermetic environment.  (See for example `options_rule_validator_test.dart` for how that might look.)


Downstream (blocking) fixes:

* https://github.com/flutter/flutter/pull/119736
* https://github.com/flutter/gallery/pull/878


Change-Id: I5671b0abde3eeda75513abaaf9fef3bcd5115f9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280054
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-02-07 20:56:35 +00:00
Konstantin Shcheglov 4eb511da43 Replace more Bazel with Blaze, some simplifications.
Change-Id: I096860e17ce56c2f602718f11706f24989c1f65b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-15 19:50:46 +00:00
Konstantin Shcheglov f3d919308f Use different marker file to identifier Blaze workspace.
Bug: https://github.com/dart-lang/sdk/issues/49629
Change-Id: I8f1496735373494745a79d502488a217e3c71223
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-10 19:58:43 +00:00
Konstantin Shcheglov 43065920cc Rename Bazel to Blaze - files, classes, methods.
No changes to implementation yet, we still look for both Blaze and Bazel.

Bug: https://github.com/dart-lang/sdk/issues/49629
Change-Id: Iaf1b1cc2c9a8cf28d8bbfb5541819a1f5c8a3de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254343
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-10 16:00:18 +00:00
Ahmed Ashour 85700570f6 Fix typos
Fixes #49241

TEST=ci

Change-Id: I6117bf816fc8c4613cce66927f952fef75632725
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248120
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-06-15 11:08:28 +00:00
Ahmed Ashour a6fcb56901 Fix typos
Fixes #49094

TEST=ci

Change-Id: I23cdcb5ad2fc83e5e91d80e34b66af186c0cb923
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245820
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-05-24 09:10:51 +00:00
Konstantin Shcheglov 359e597cec Switch Workspace to Packages.
PackageMapUriResolver is still based on Map.

Change-Id: I7d68f9dbc7d970b22c8e1a01d8e816b3e5723f34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/244047
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-05-09 22:42:32 +00:00
Konstantin Shcheglov 20b560226e Rename newFile2() to newFile().
Change-Id: I1c2a4f15dee607a0a6241dfaf2d764a7d284389b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241510
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-04-19 02:59:57 +00:00
pq 16b436151a migrate server to recommended lints
See: https://github.com/dart-lang/sdk/issues/48785

Change-Id: I1bec40cc0b52e5df5f07c35ec993e08c56a59cbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240907
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-04-12 13:34:12 +00:00