Creating a New Rule Set
To create a new rule set, head over to Rule Sets page and click the “Create a New Rule Set” button. This will reveal a modal where you can define:- A name for your rule set.
- The language/framework the rule set will apply to.
- Optionally, a project the rule set should be assigned with (helpful for sharing rule sets with team members who have access to a project).
Once created, you’ll be redirected to your new rule set where you can define the rules that make up that rule set.
Adding Rules to a Rule Set
Rules give you granular control over how Parrot should use certain language or framework features when generating snippets. There are two ways to add rules to a rule set:- If available, use a template rule provided by Parrot.
- Write your own custom rule.
Adding a Template Rule
Templated rules cannot be edited. If you want to make changes to a templated rule, add it manually following the “Adding a Custom Rule” steps below.
Templates are separated into four tabs:
- Syntax
- Style
- Naming
- Organization
Adding a Custom Rule
Custom rules can be added by using the input at the bottom-right of the Rule Set editor. To add a custom rule, type in your preference and then click the “Add Custom Rule” button.
Once added, your custom rulle will show up on the right-hand side of the Rule Set editor in the list above the custom rule input. If you’d like to make changes to a custom rule, just click into the input in the rule set list. If you’d like to remove a custom rule from your rule set, just click the red “x” button next to that rule in the list.