Description
As we roll out more automation around publishing packages we've hit a few hiccups wrt automated package validation. Specifically, we generally run dart pub publish --dry-run
as part of PR validation, and fail the PR if the dry run reports any issues.
Problems arise when the validation failures are intentional; for instance, a tight constraint on another package, or, publishing using a pre-release SDK. We still want to do general publishing validation - we'd like to run most of the consistently checks. But we'd like to ignore specific ones (a blanket 'ignore-all-issues' - or not running the validation at all - could hide problems we would want to know about).
A potential option here is to support 'ignore' comment syntax in pubspec files. So something like:
# ignore_for_file: tight_version_contraints
# ignore_for_file: pre_release_publishing
name: foo_package
...
Additional context:
- have a way to configure publishing dry run checks ecosystem#64
- Publish is not running on a push? ecosystem#75
- update publishing automation integration webdev#2002
And some sample validation failures:
* Your dependency on "dwds" should allow more than one version. For example:
dependencies:
dwds: ^18.0.0
Constraints that are too tight will make it difficult for people to use your package
along with other packages that also depend on "dwds".
* Packages with an SDK constraint on a pre-release of the Dart SDK should themselves be published as a pre-release version. If this package needs Dart version 3.0.0-188.0.dev, consider publishing the package as a pre-release instead.
See https://dart.dev/tools/pub/publishing#publishing-prereleases For more information on pre-releases.