Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vulnerable option to dotnet list package #13318

Merged

Conversation

drewgillies
Copy link
Contributor

@drewgillies drewgillies commented Sep 2, 2020

Added --vulnerable option to dotnet list package CLI. Also removed most of the "policing" around other option combinations:

  • --include-prerelease, --highest-minor, and highest-patch are only supposed to be used in combination with the --outdated option, but they're just ignored by the NuGet Xplat CLI otherwise, and we'll do the same here.
  • --config and --source are only supposed to be used in combination with --vulnerable, --outdated and --deprecated reports, but they're also just ignored by the NuGet Xplat CLI, so we'll ignore them here.
  • --vulnerable, --outdated and --deprecated all must be used mutually exclusively, and combining them is nonsense--we throw in the NuGet Xplat CLI in this case, and we'll continue to throw here.

/// these options must not be used, so error is thrown.
/// </summary>
/// <param name="option"></param>
private void CheckForOutdatedOrDeprecated(string option)
private void CheckForOnlineOptions(string option)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: what does "Online" mean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Options that require online lookups to services for their information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(code removed per main comment above)

{
if (!_appliedCommand.HasOption("deprecated") && !_appliedCommand.HasOption("outdated"))
if (!_appliedCommand.HasOption("deprecated") && !_appliedCommand.HasOption("outdated") && !_appliedCommand.HasOption("vulnerable"))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test coverage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@drewgillies drewgillies force-pushed the add-cli-list-package-vulnerable branch from fb9c6c0 to c5fc6b8 Compare September 4, 2020 07:24
@drewgillies drewgillies requested a review from wli3 September 21, 2020 04:20
@drewgillies drewgillies force-pushed the add-cli-list-package-vulnerable branch from c5fc6b8 to a3daf70 Compare September 21, 2020 22:24
@drewgillies drewgillies force-pushed the add-cli-list-package-vulnerable branch from a3daf70 to ea4fde6 Compare September 23, 2020 04:33
@drewgillies drewgillies marked this pull request as ready for review September 23, 2020 04:38
@marcpopMSFT
Copy link
Member

@drewgillies merging this into master for 6.0. If you want this included in 5.0.2xx, you'll need to port it over once we have that servicing branch (~1 month out)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants