Files
sdk/pkg
Martin Kustermann b888da751e Revert "analyzer: separate unused_element_parameter from unused_element"
This reverts commit c1976b097d.

Reason for revert: It seems this change caused failures on Flutter
HHH bot. Example log can be found at [0]:
```
| lib/src/super_reader/super_reader.dart:615:14: Error: Final field 'showDebugLeaderBounds' is not initialized.
| Try to initialize the field in the declaration or in every constructor.
|   final bool showDebugLeaderBounds;
|              ^^^^^^^^^^^^^^^^^^^^^

```
Looking at the sources it seems that may be related to the
`// ignore: unused_element` analyzer directive:

```
   602	/// A [SuperReaderDocumentLayerBuilder] that builds a [SelectionLeadersDocumentLayer], which positions
   603	/// leader widgets at the base and extent of the user's selection, so that other widgets
   604	/// can position themselves relative to the user's selection.
   605	class _SelectionLeadersDocumentLayerBuilder implements SuperReaderDocumentLayerBuilder {
   606	  const _SelectionLeadersDocumentLayerBuilder({
   607	    required this.links,
   608	    // ignore: unused_element
   609	    this.showDebugLeaderBounds = false,
   610	  });
   611
   612	  /// Collections of [LayerLink]s, which are given to leader widgets that are
   613	  /// positioned at the selection bounds, and around the full selection.
   614	  final SelectionLayerLinks links;
   615
   616	  /// Whether to paint colorful bounds around the leader widgets, for debugging purposes.
   617	  final bool showDebugLeaderBounds;
```

So tentatively reverting this CL.

[0] https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8739650477551803313/+/u/Run_customer_testing_tests/stdout

Original change's description:
> analyzer: separate unused_element_parameter from unused_element
>
> Fixes https://github.com/dart-lang/sdk/issues/49025
>
> This allows users to blanket ignore unused_element_parameter without
> ignoring unused_element. They are reported in distinct situations so it
> is valid to separate them.
>
> Tested: Presubmit CI
> Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
> Change-Id: I4844a6a0e0a67cd5e37ed8735b1526e174deb950
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378500
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Phil Quitslund <pquitslund@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Change-Id: Ibbba75fe56601c7c4b5535c9142cf94c2dd80b91
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380460
Commit-Queue: Martin Kustermann <kustermann@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-08-14 08:05:37 +00:00
..
2024-08-13 18:48:08 +00:00
2024-08-06 22:32:18 +00:00

Package validation

The packages in pkg/ are automatically validated on the LUCI CI bots. The validation is largely done by the tools/package_deps package; it can be tested locally via:

dart tools/package_deps/bin/package_deps.dart

Packages which are published

There are several packages developed in pkg/ which are published to pub. Validation of these packages is particularly important because the pub tools are not used for these packages during development; we get our dependency versions from the DEPS file. It's very easy for the dependencies specified in a package's pubspec file to get out of date wrt the packages and versions actually used.

In order to better ensure we're publishing correct packages, we validate some properties of the pubspec files on our CI system. These validations include:

  • that the dependencies listed in the pubspec are used in the package
  • that all the packages used by the source are listed in the pubspec
  • that we don't use relative path deps to pkg/ or third_party/ packages

Packages which are not published

For packages in pkg/ which we do not intend to be published, we put the following comment in the pubspec.yaml file:

# This package is not intended for consumption on pub.dev. DO NOT publish.
publish_to: none

These pubspecs are still validated by the package validation tool. The contents are more informational as the pubspecs for these packages are not consumed by the pub tool or ecosystem.

We validate:

  • that the dependencies listed in the pubspec are used in the package
  • that all the packages used by the source are listed in the pubspec
  • that a reference to a pkg/ package is done via a relative path dependency