Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require action to bypass pub publish warnings #2535

Open
jonasfj opened this issue Jun 16, 2020 · 2 comments
Open

Require action to bypass pub publish warnings #2535

jonasfj opened this issue Jun 16, 2020 · 2 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@jonasfj
Copy link
Member

jonasfj commented Jun 16, 2020

To bypass a warning in pub publish we should perhaps require a flag like pub publish --by-pass-<name>-warning.

It is very plausible that not all warnings warrants a --by-pass-<name>-warning flag.
Perhaps the authors warning below is a good example of a warning that doesn't require explicit by-passing.

But publishing a package that contains generated dartdoc contents should probably require --by-pass-dartdoc-warning flag. This is almost always harmful, as it takes up a lot of space.

Example

[retry]$pub publish
Publishing retry 3.0.0+1 to https://pub.dartlang.org:
|-- CHANGELOG.md
|-- LICENSE
|-- README.md
|-- analysis_options.yaml
|-- example
|   '-- main.dart
|-- lib
|   '-- retry.dart
|-- mono_pkg.yaml
|-- pubspec.yaml
'-- test
    '-- retry_test.dart
Package validation found the following potential issue:
* Your pubspec.yaml includes an "authors" section which is no longer used
  and may be removed.

Uploads to pub.dev are subject to https://pub.dev/policy

Package has 1 warning.
If you wish to publish anyways by pass the warning with:
  pub publish --by-pass-authors-warning
@jonasfj
Copy link
Member Author

jonasfj commented Jun 16, 2020

@sigurdm suggested that perhaps the flag should require the warning be present.
So passing --expect-authors-warning will allow publishing with the warning, but forbid publishing if the warning is not present.

This way publishing scripts won't build up a lot of unnecessary --by-pass-X-warning flags, because such flags must be removed once the warning is no-longer present.

@passsy
Copy link

passsy commented Feb 12, 2021

That's a fantastic idea and would help me continue running pub publish -n on CI.

Currently, I'm facing the pre-release warning, which is nice, but I explicitly don't want to fail on this because I'm publishing a preview which is completely fine according to the documentation.

I'd love to have an --by-pass-prerelease-warning flag

| Package validation found the following potential issue:
| * 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 2.12.0-0, consider publishing the package as a pre-release instead.
|   See https://dart.dev/tools/pub/publishing#publishing-prereleases For more information on pre-releases.
| 
| Package has 1 warning.
[Dart CI/lint]   ❌  Failure - Verify package completness
Error: exit with `FAILURE`: 65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants