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

(#3381) Add new rule command #3382

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

AdmiringWorm
Copy link
Member

@AdmiringWorm AdmiringWorm commented Jan 15, 2024

Description Of Changes

This adds a new command called ´rulewith an alias ofrules` to be able to view any Validation Rules that have been implemented by Chocolatey CLI, or the details of a specific view.

Motivation and Context

To give visibility to users an what will happen/validated when they package their Chocolatey CLI package, as well intended enhanced functionality that will be implemented outside Chocolatey CLI that can reuse this same command.

Testing

  1. Run choco rules (also try choco rule list). You should then see something similar to
    image
  2. Run choco rule get --name CHCR0002. You should then see something similar to
    image (_repeat with choco rule CHCR0002)
  3. Run choco rules -r. You should then see something similar to
    image
  4. Run choco rule --name missing. You should see something similar to
    image
  5. Run choco rule get --name missing. You should see something similar to
    image
  6. Run choco rule get --name CHCR0001 -r. You should see something similar as point 3, with just the specified rule outputted.
  7. Run choco rule get --name missing -r. No rules should be outputted, and no error occurring.

Operating Systems Testing

  • Windows 10

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

Fixes #3381

This adds a new command called ´rule` with an alias of `rules` to be
able to view any Validation Rules that have been implemented by
Chocolatey CLI, or the details of a specific view.

This allows a user to see what is implemented when they are packaging
their Chocolatey CLI package. This is intended to be used in the future
to enhance other functionality.
The Rule Service interface was missing the ability to get
all available rules that have been implemented.

This commit updates the interface to include this method.
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.

Add command to allow viewing any rules implemented by Chocolatey CLI or an extension
1 participant