Repository: VeryGoodOpenSource/very_good_cli
Pull request #858 (2023-10-17 08:35:32)

feat: rename `ignore-failures` to `ignore-retrieval-failures`
<!--
  Thanks for contributing!

  Provide a description of your changes below and a general summary in the title

  Please look at the following checklist to ensure that your PR can be accepted quickly:
-->

## Description

Renames `ignore-failures` to `ignore-retrieval-failures` since it causes some confusion, see[ @erickzanardo comment.](https://github.com/VeryGoodOpenSource/very_good_cli/pull/846#discussion_r1355623819)

## Type of Change

<!--- Put an `x` in all the boxes that apply: -->

- [X] ✨ New feature (non-breaking change which adds functionality)
- [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
- [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
- [X] 🧹 Code refactor
- [ ] ✅ Build configuration change
- [ ] 📝 Documentation
- [ ] 🗑️ Chore



Patch:
diff --git a/lib/src/commands/packages/commands/check/commands/licenses.dart b/lib/src/commands/packages/commands/check/commands/licenses.dart
index ca3db69..7d41a03 100644
--- a/lib/src/commands/packages/commands/check/commands/licenses.dart
+++ b/lib/src/commands/packages/commands/check/commands/licenses.dart
@@ -39,8 +39,8 @@ class PackagesCheckLicensesCommand extends Command<int> {
         _pubLicense = pubLicense ?? PubLicense() {
     argParser
       ..addFlag(
-        'ignore-failures',
-        help: 'Ignore any license that failed to be retrieved.',
+        'ignore-retrieval-failures',
+        help: 'Disregard licenses that failed to be retrieved.',
         negatable: false,
       )
       ..addMultiOption(
@@ -90,7 +90,7 @@ class PackagesCheckLicensesCommand extends Command<int> {
       usageException('Too many arguments');
     }
 
-    final ignoreFailures = _argResults['ignore-failures'] as bool;
+    final ignoreFailures = _argResults['ignore-retrieval-failures'] as bool;
     final dependencyTypes = _argResults['dependency-type'] as List<String>;
     final allowedLicenses = _argResults['allowed'] as List<String>;
     final forbiddenLicenses = _argResults['forbidden'] as List<String>;


Test patch:
diff --git a/test/src/commands/packages/commands/check/commands/licenses_test.dart b/test/src/commands/packages/commands/check/commands/licenses_test.dart
index 1f8491f..3da0f6b 100644
--- a/test/src/commands/packages/commands/check/commands/licenses_test.dart
+++ b/test/src/commands/packages/commands/check/commands/licenses_test.dart
@@ -18,14 +18,14 @@ const _expectedPackagesCheckLicensesUsage = [
       '\n'
       'Usage: very_good packages check licenses [arguments]\n'
       '-h, --help                           Print this usage information.\n'
-      '''    --ignore-failures                Ignore any license that failed to be retrieved.\n'''
+      '''    --ignore-retrieval-failures      Disregard licenses that failed to be retrieved.\n'''
       '''    --dependency-type                The type of dependencies to check licenses for.\n'''
       '\n'
       '''          [direct-dev]               Check for direct dev dependencies.\n'''
       '''          [direct-main] (default)    Check for direct main dependencies.\n'''
       '''          [transitive]               Check for transitive dependencies.\n'''
       '\n'
-      '''    --allowed                        Whitelist of allowed licenses.\n'''
+      '    --allowed                        Whitelist of allowed licenses.\n'
       '''    --forbidden                      Blacklist of not allowed licenses.\n'''
       '\n'
       'Run "very_good help" to see global options.'
@@ -161,8 +161,8 @@ void main() {
       },
     );
 
-    group('ignore-failures', () {
-      const ignoreFailuresArgument = '--ignore-failures';
+    group('ignore-retrieval-failures', () {
+      const ignoreRetrievalFailuresArgument = '--ignore-retrieval-failures';
 
       group('reports licenses', () {
         test(
@@ -183,7 +183,11 @@ void main() {
                 .thenThrow(exception);
 
             final result = await commandRunner.run(
-              [...commandArguments, ignoreFailuresArgument, tempDirectory.path],
+              [
+                ...commandArguments,
+                ignoreRetrievalFailuresArgument,
+                tempDirectory.path,
+              ],
             );
 
             final errorMessage =
@@ -224,7 +228,11 @@ void main() {
                 .thenThrow(error);
 
             final result = await commandRunner.run(
-              [...commandArguments, ignoreFailuresArgument, tempDirectory.path],
+              [
+                ...commandArguments,
+                ignoreRetrievalFailuresArgument,
+                tempDirectory.path,
+              ],
             );
 
             const errorMessage =
@@ -264,7 +272,11 @@ void main() {
           when(() => pubLicense.getLicense(any())).thenThrow(error);
 
           final result = await commandRunner.run(
-            [...commandArguments, ignoreFailuresArgument, tempDirectory.path],
+            [
+              ...commandArguments,
+              ignoreRetrievalFailuresArgument,
+              tempDirectory.path,
+            ],
           );
 
           final packageNames = verify(() => pubLicense.getLicense(captureAny()))