dart-sdk/pkg
Sam Rawlins 85f9e45434 linter: Mark 'errors'-related rules with finer-grained categories
Work towards https://github.com/dart-lang/linter/issues/4991

Here I just take all of the existing rules marked with
`Category.errors` (which are not removed or deprecated), and re-examine
what category or categories they fall into.

I add new categories:

* "binary size" (not super accurate for JS-compile apps, but "binary"
  is still a common industry term for the JS app that is delivered to
  the browser)
* "documentation comment maintenance"
* "error-prone"
* "language feature usage"
* "memory leaks" (note, different from "binary size"; mostly
   memory-leak related but may contain other things?)
* "non-performant"
* "unintentional"
* "unused code"

For multiple rules, I considered adding a "best practices" category
too, but this also seems tragically vague. But for rules like
"control_flow_in_finally", "avoid_catches_without_on_clauses", etc.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I043a509120e7347283d6ab10e8eb73859830abc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371921
Reviewed-by: Marya Belanger <mbelanger@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-07-02 15:22:28 +00:00
..
_fe_analyzer_shared Bump version to 3.6 2024-07-02 00:02:19 +00:00
_js_interop_checks [dart2wasm/ddc/dart2js] Lower Function.toJS and JSExportedDartFunction.toDart 2024-06-26 23:06:36 +00:00
_macros add type parameters when creating augmentations 2024-06-21 07:57:33 +00:00
analysis_server [analysis_server] Remove the singleton uriConverter and pass explicitly to all toJson/fromJson methods 2024-07-02 14:15:11 +00:00
analysis_server_client [analysis_server] Remove the singleton uriConverter and pass explicitly to all toJson/fromJson methods 2024-07-02 14:15:11 +00:00
analysis_server_plugin DAS: Move DartChangeWorkspace to the analysis_server_plugin package 2024-06-26 02:17:59 +00:00
analyzer linter: Mark 'errors'-related rules with finer-grained categories 2024-07-02 15:22:28 +00:00
analyzer_cli CQ. Make FileSource API, move to lib/source. 2024-06-03 00:36:59 +00:00
analyzer_plugin [analysis_server] Remove the singleton uriConverter and pass explicitly to all toJson/fromJson methods 2024-07-02 14:15:11 +00:00
analyzer_utilities Convert the analyzer package to use the new location for mock packages 2024-06-24 17:53:45 +00:00
async_helper
bisect_dart
build_integration
compiler [dart2js] Remove asserts in ConstConditionalSimplifier 2024-06-27 19:12:02 +00:00
dart2js_info
dart2js_runtime_metrics
dart2js_tools
dart2native [dartdev] Add --depfile option to dart compile 2024-05-23 12:58:29 +00:00
dart2wasm [dart2wasm] Add copyright header to generate_wasm.dart 2024-07-02 13:59:45 +00:00
dart_internal Bump dart_internal again to work with the latest dev builds. 2024-05-02 23:06:47 +00:00
dart_service_protocol_shared
dartdev [ CLI ] Update checkArtifactExists check to allow for Links in addition to Files 2024-06-26 17:18:17 +00:00
dds Revert "Reapply "[ Service ] Start DDS and serve DevTools when the VM service is started via dart:developer"" 2024-07-01 18:30:28 +00:00
dds_service_extensions
dev_compiler [dartdevc] Moving DDC Set implementations into DDC's private runtime. 2024-07-02 07:27:12 +00:00
dtd Expose DTD constructor to pass a StreamChannel directly 2024-06-24 18:38:26 +00:00
dtd_impl [dtd] Allow passing an explicit port to DTD 2024-06-17 14:58:19 +00:00
expect Reland "Tweak expect.dart library." 2024-04-26 15:28:26 +00:00
front_end [CFE] Auto-add coverage-ignore comments 2024-06-28 13:01:39 +00:00
frontend_server [dartdevc] Moving DDC Set implementations into DDC's private runtime. 2024-07-02 07:27:12 +00:00
heap_snapshot
js Add topics to pubspec.yaml 2024-06-13 13:02:54 +00:00
js_ast Reland "Tweak expect.dart library." 2024-04-26 15:28:26 +00:00
js_runtime
js_shared
json package:json - drop vendored packages, prep to release 2024-05-24 15:41:05 +00:00
kernel Bump version to 3.6 2024-07-02 00:02:19 +00:00
language_versioning_2_12_test
linter linter: Mark 'errors'-related rules with finer-grained categories 2024-07-02 15:22:28 +00:00
macros add type parameters when creating augmentations 2024-06-21 07:57:33 +00:00
meta Fixed @doNotSubmit to prohibit same-library, allow nested functions. 2024-07-02 00:10:23 +00:00
mmap
modular_test
native_stack_traces
reload_test
scrape
server_plugin
smith [test] isVmAotConfiguration in custom configurations take 2 2024-06-27 18:31:35 +00:00
sourcemap_testing Bump collection to c90b19f07b48391f3b1b4c39dd06ef0177f8e07c 2024-06-11 17:27:21 +00:00
status_file [status_files] Cleanup status files 2024-06-12 10:21:23 +00:00
telemetry [pkg/analysis_server] remove use of package:usage 2024-05-07 22:11:29 +00:00
test_runner [test_runner/vm] Provide some troubleshooting info when missing vm test runner 2024-06-27 16:42:49 +00:00
testing
vm [vm,aot] Fix type check in implicit setter of a covariant field 2024-06-25 14:34:20 +00:00
vm_service [vm] Remove transition_sentinel and detection of cyclic initialization of legacy static fields 2024-06-27 18:29:58 +00:00
vm_service_interface
vm_service_protos
vm_snapshot_analysis
wasm_builder [wasm_builder] Avoid generating unreachable instructions 2024-06-28 07:51:26 +00:00
.gitignore
analysis_options.yaml
BUILD.gn
OWNERS
pkg.dart
pkg.status [VM] Add RecordCoverage to InstanceCall and StaticCall 2024-06-17 10:47:58 +00:00
README.md

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