Skip to content

Commit 47c5a83

Browse files
committed
Update goldens
1 parent 3eaed86 commit 47c5a83

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

lib/src/command/lish.dart

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ class LishCommand extends PubCommand {
125125
valueHelp: 'dir',
126126
);
127127
argParser.addFlag(
128-
'fatal-warnings',
129-
help: 'When disabled, exit 0 even if there are warnings in --dry-run',
130-
defaultsTo: true,
128+
'ignore-warnings',
129+
help: 'Do not treat warnings as fatal.',
130+
negatable: false,
131+
defaultsTo: false,
131132
);
133+
132134
}
133135

134136
Future<void> _publishUsingClient(
@@ -305,11 +307,10 @@ the \$PUB_HOSTED_URL environment variable.''');
305307
usageException('Cannot use both --to-archive and --force.');
306308
}
307309

308-
if (argResults.wasParsed('fatal-warnings') && !dryRun) {
309-
usageException(
310-
'`--no-fatal-warnings` can only be used with `--dry-run`.',
311-
);
310+
if (argResults.wasParsed('ignore-warnings') && !dryRun) {
311+
usageException('`--ignore-warnings` can only be used with `--dry-run`.');
312312
}
313+
313314
}
314315

315316
Future<_Publication> _publicationFromEntrypoint() async {
@@ -501,7 +502,8 @@ the \$PUB_HOSTED_URL environment variable.''');
501502
: _publicationFromArchive(_fromArchive));
502503
if (dryRun) {
503504
log.message(publication.warningsCountMessage);
504-
if (publication.warningCount != 0 && argResults.flag('fatal-warnings')) {
505+
if (publication.warningCount != 0 &&
506+
!argResults.flag('ignore-warnings')) {
505507
overrideExitCode(DATA);
506508
}
507509
return;

test/lish/fatal_warnings_test.dart renamed to test/lish/ignore_warnings_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void main() {
2727
});
2828

2929
test(
30-
'dry-run with --no-fatal-warnings and warnings exits with SUCCESS',
30+
'dry-run with --ignore-warnings and warnings exits with SUCCESS',
3131
() async {
3232
(await servePackages()).serve('foo', '1.0.0');
3333
await d
@@ -39,14 +39,14 @@ void main() {
3939
.create();
4040

4141
await runPub(
42-
args: ['publish', '--dry-run', '--no-fatal-warnings'],
42+
args: ['publish', '--dry-run', '--ignore-warnings'],
4343
output: contains('Package has 1 warning.'),
4444
exitCode: exit_codes.SUCCESS,
4545
);
4646
},
4747
);
4848

49-
test('--no-fatal-warnings without --dry-run is a usage error', () async {
49+
test('--ignore-warnings without --dry-run is a usage error', () async {
5050
(await servePackages()).serve('foo', '1.0.0');
5151
await d
5252
.validPackage(
@@ -57,9 +57,9 @@ void main() {
5757
.create();
5858

5959
await runPub(
60-
args: ['publish', '--no-fatal-warnings'],
60+
args: ['publish', '--ignore-warnings'],
6161
error: contains(
62-
'`--no-fatal-warnings` can only be used with `--dry-run`.',
62+
'`--ignore-warnings` can only be used with `--dry-run`.',
6363
),
6464
exitCode: exit_codes.USAGE,
6565
);

test/testdata/goldens/help_test/pub publish --help.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Usage: pub publish [options]
1010
-f, --force Publish without confirmation if there are no errors.
1111
--skip-validation Publish without validation and resolution (this will ignore errors).
1212
-C, --directory=<dir> Run this in the directory <dir>.
13-
--[no-]fatal-warnings Treat warnings as fatal.
13+
--[no-]fatal-warnings When disabled, exit 0 even if there are warnings in --dry-run
1414
(defaults to on)
1515

1616
Run "pub help" to see global options.

0 commit comments

Comments
 (0)