Skip to content

Commit a8fac62

Browse files
authored
feat: rename ignore-failures to ignore-retrieval-failures (#858)
1 parent bd81172 commit a8fac62

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

lib/src/commands/packages/commands/check/commands/licenses.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ class PackagesCheckLicensesCommand extends Command<int> {
3939
_pubLicense = pubLicense ?? PubLicense() {
4040
argParser
4141
..addFlag(
42-
'ignore-failures',
43-
help: 'Ignore any license that failed to be retrieved.',
42+
'ignore-retrieval-failures',
43+
help: 'Disregard licenses that failed to be retrieved.',
4444
negatable: false,
4545
)
4646
..addMultiOption(
@@ -90,7 +90,7 @@ class PackagesCheckLicensesCommand extends Command<int> {
9090
usageException('Too many arguments');
9191
}
9292

93-
final ignoreFailures = _argResults['ignore-failures'] as bool;
93+
final ignoreFailures = _argResults['ignore-retrieval-failures'] as bool;
9494
final dependencyTypes = _argResults['dependency-type'] as List<String>;
9595
final allowedLicenses = _argResults['allowed'] as List<String>;
9696
final forbiddenLicenses = _argResults['forbidden'] as List<String>;

test/src/commands/packages/commands/check/commands/licenses_test.dart

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ const _expectedPackagesCheckLicensesUsage = [
1818
'\n'
1919
'Usage: very_good packages check licenses [arguments]\n'
2020
'-h, --help Print this usage information.\n'
21-
''' --ignore-failures Ignore any license that failed to be retrieved.\n'''
21+
''' --ignore-retrieval-failures Disregard licenses that failed to be retrieved.\n'''
2222
''' --dependency-type The type of dependencies to check licenses for.\n'''
2323
'\n'
2424
''' [direct-dev] Check for direct dev dependencies.\n'''
2525
''' [direct-main] (default) Check for direct main dependencies.\n'''
2626
''' [transitive] Check for transitive dependencies.\n'''
2727
'\n'
28-
''' --allowed Whitelist of allowed licenses.\n'''
28+
' --allowed Whitelist of allowed licenses.\n'
2929
''' --forbidden Blacklist of not allowed licenses.\n'''
3030
'\n'
3131
'Run "very_good help" to see global options.'
@@ -161,8 +161,8 @@ void main() {
161161
},
162162
);
163163

164-
group('ignore-failures', () {
165-
const ignoreFailuresArgument = '--ignore-failures';
164+
group('ignore-retrieval-failures', () {
165+
const ignoreRetrievalFailuresArgument = '--ignore-retrieval-failures';
166166

167167
group('reports licenses', () {
168168
test(
@@ -183,7 +183,11 @@ void main() {
183183
.thenThrow(exception);
184184

185185
final result = await commandRunner.run(
186-
[...commandArguments, ignoreFailuresArgument, tempDirectory.path],
186+
[
187+
...commandArguments,
188+
ignoreRetrievalFailuresArgument,
189+
tempDirectory.path,
190+
],
187191
);
188192

189193
final errorMessage =
@@ -224,7 +228,11 @@ void main() {
224228
.thenThrow(error);
225229

226230
final result = await commandRunner.run(
227-
[...commandArguments, ignoreFailuresArgument, tempDirectory.path],
231+
[
232+
...commandArguments,
233+
ignoreRetrievalFailuresArgument,
234+
tempDirectory.path,
235+
],
228236
);
229237

230238
const errorMessage =
@@ -264,7 +272,11 @@ void main() {
264272
when(() => pubLicense.getLicense(any())).thenThrow(error);
265273

266274
final result = await commandRunner.run(
267-
[...commandArguments, ignoreFailuresArgument, tempDirectory.path],
275+
[
276+
...commandArguments,
277+
ignoreRetrievalFailuresArgument,
278+
tempDirectory.path,
279+
],
268280
);
269281

270282
final packageNames = verify(() => pubLicense.getLicense(captureAny()))

0 commit comments

Comments
 (0)