Skip to content

Commit a0f6384

Browse files
committed
Update goldens
1 parent 3eaed86 commit a0f6384

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

lib/src/command/lish.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ 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,
131131
);
132132
}
133133

@@ -305,10 +305,8 @@ the \$PUB_HOSTED_URL environment variable.''');
305305
usageException('Cannot use both --to-archive and --force.');
306306
}
307307

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

@@ -501,7 +499,8 @@ the \$PUB_HOSTED_URL environment variable.''');
501499
: _publicationFromArchive(_fromArchive));
502500
if (dryRun) {
503501
log.message(publication.warningsCountMessage);
504-
if (publication.warningCount != 0 && argResults.flag('fatal-warnings')) {
502+
if (publication.warningCount != 0 &&
503+
!argResults.flag('ignore-warnings')) {
505504
overrideExitCode(DATA);
506505
}
507506
return;

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

Lines changed: 5 additions & 7 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,10 +57,8 @@ void main() {
5757
.create();
5858

5959
await runPub(
60-
args: ['publish', '--no-fatal-warnings'],
61-
error: contains(
62-
'`--no-fatal-warnings` can only be used with `--dry-run`.',
63-
),
60+
args: ['publish', '--ignore-warnings'],
61+
error: contains('`--ignore-warnings` can only be used with `--dry-run`.'),
6462
exitCode: exit_codes.USAGE,
6563
);
6664
});

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)