-
Notifications
You must be signed in to change notification settings - Fork 907
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
Conversation
3570985
to
a8bb1e9
Compare
a8bb1e9
to
e31ebb1
Compare
e31ebb1
to
86135c7
Compare
src/chocolatey/infrastructure.app/commands/ChocolateyRuleCommand.cs
Outdated
Show resolved
Hide resolved
@AdmiringWorm overall, this looks really good, and would be happy to get this merged in. While reviewing, I did make some changes, which I have added as a standalone commit. Let's have a chat about the changes tomorrow, and decide whether to move forward with them. |
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.
There was an unused `ex` in a catch block, which goes against out coding conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@AdmiringWorm and I met today, and during a pairing session decided that the suggested changes make sense. These have now been rebased into the existing commits, and will continue with the merge, once the CI builds pass. |
Description Of Changes
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.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
choco rules
(also trychoco rule list
). You should then see something similar tochoco rule get --name CHCR0002
. You should then see something similar tochoco rule CHCR0002
)choco rules -r
. You should then see something similar tochoco rule --name missing
. You should see something similar tochoco rule get --name missing
. You should see something similar tochoco rule get --name CHCR0001 -r
. You should see something similar as point 3, with just the specified rule outputted.choco rule get --name missing -r
. No rules should be outputted, and no error occurring.Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #3381