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

feature request: expose rule-id constants and a method for building rulesets programatically #203

Closed
TristanSpeakEasy opened this issue Dec 14, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@TristanSpeakEasy
Copy link
Contributor

Would love to be able to build a ruleset programmatically when using the API directly instead of via the CLI similar to how the default ruleset is built here: https://github.com/daveshanley/vacuum/blob/main/rulesets/rulesets.go#L251

Basically exposing the constants for the rule keys and maybe having a method that takes a map of rules and returns a ruleset that can be used in the ApplyRulesToRuleSet call

@daveshanley
Copy link
Owner

This is a good idea!

@daveshanley daveshanley self-assigned this Dec 14, 2022
@daveshanley daveshanley added the enhancement New feature or request label Dec 14, 2022
daveshanley added a commit that referenced this issue May 1, 2023
get all the default rules, and use the now exposed constants to create new ready to run RuleSets composed of custom rules.

Signed-off-by: Dave Shanley <dave@quobix.com>
@daveshanley daveshanley mentioned this issue May 1, 2023
daveshanley added a commit that referenced this issue May 1, 2023
get all the default rules, and use the now exposed constants to create new ready to run RuleSets composed of custom rules.

Signed-off-by: Dave Shanley <dave@quobix.com>
@daveshanley
Copy link
Owner

Now available in v0.1.0

All the constants have been exposed and a couple of functions are available

  • GetAllBuiltInRules()
  • CreateRuleSetFromRuleMap()

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

No branches or pull requests

2 participants