Add inline semicolon-separated list support for list-based CLI parameters#410
Conversation
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
|
@copilot rework these changes on top of current main |
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
|
@copilot now make sure to add the necessary tests for the changes - also make sure to rebase again to have a working set of tests to compare against |
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Added 9 comprehensive tests for the inline list argument parsing functionality and rebased on latest main (commit 87fd970). Tests cover:
Also fixed .NET Framework 4.7.2 compatibility issue. All 3,280 tests pass. |
WalkthroughThis pull request extends the command-line interface to accept dual input formats for three options: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 61-70: Update the README option descriptions for the flags (-a /
--allowed-license-types, -ignore / --ignored-packages, -mapping /
--licenseurl-to-license-mappings, -file-mapping /
--licensefile-to-license-mappings, -override / --override-package-information,
-d / --license-information-download-location, -o / --output, -err /
--error-only, -include-ignored / --include-ignored-packages, -exclude-projects /
--exclude-projects-matching) so each description is a complete sentence with an
explicit subject and ends with a period; for example change fragments like
"Allowed license types. Can be either..." into full sentences such as "Specifies
allowed license types. You can provide a JSON file..."; apply the same style to
the ignored-packages, mapping, file-mapping, override, download-location,
output, error-only, include-ignored-packages, and exclude-projects descriptions.
In `@src/NuGetLicense/LicenseValidationHandler.cs`:
- Around line 217-219: The ArgumentException thrown in
LicenseValidationHandler.cs (the ternary return that reads inputJsonFile via
_fileSystem.File.ReadAllText and currently throws "Please provide an input file
using --input or --input-file-json") references a non-existent CLI flag; update
the exception message to mention the correct flag name "--json-input" (e.g.,
"Please provide an input file using --json-input") so the guidance from the
throw in that method matches the actual CLI option.
- Around line 173-180: The split-and-trim logic for inline values currently
returns entries that become empty after trimming; update the handling in
LicenseValidationHandler (the block that splits 'value' into 'parts') to remove
any entries that are empty or whitespace-only after Trim before returning. After
trimming each element of 'parts', filter out entries where
string.IsNullOrEmpty(parts[i]) (or use an equivalent Where/FindAll on the
trimmed values) so the returned array contains only non-empty
license/package/project tokens.
🧹 Nitpick comments (2)
docs/ignored-packages-json.md (2)
5-5: Consider rephrasing for improved clarity.The current phrasing "Even though packages are ignored" could be more natural. Consider:
-**Note:** Even though packages are ignored, their transitive dependencies are not ignored unless explicitly listed. +**Note:** When packages are ignored, their transitive dependencies are not ignored unless explicitly listed.or
-**Note:** Even though packages are ignored, their transitive dependencies are not ignored unless explicitly listed. +**Note:** Ignoring a package does not ignore its transitive dependencies unless they are explicitly listed.
11-27: Consider documenting error handling and file path behavior.The JSON file section would benefit from clarifying:
- What happens when the JSON file contains invalid JSON
- Whether relative and absolute file paths are supported
Suggested addition after line 21:
The JSON file must contain a valid JSON array. If the file contains invalid JSON, the tool will report an error and exit. File paths can be relative (to the current directory) or absolute.This aligns with the PR objective to document error handling for invalid JSON.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@copilot In Be sure to also update the help texts exposed by the code |
Co-authored-by: sensslen <3428860+sensslen@users.noreply.github.com>
Updated all option descriptions in both README.md and Program.cs to use complete sentences with explicit subjects and periods (commit 068d349). Changes include:
Example transformation:
All descriptions now follow consistent style with explicit subjects ("Specifies", "When set") and end with periods. |
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|



Implementation Plan: Support Inline List Arguments
GetAllowedLicenses()to support both file and inline formatsGetIgnoredPackages()to support both file and inline formatsGetExcludedProjects()to support both file and inline formatsOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Summary by CodeRabbit
New Features
Documentation
Tests
Chores