You can customize Greptile’s behavior by providing “custom context” for the bot to follow. Context can include custom rules, style guides or docs, and miscellanous information that Greptile may find useful.
Each rule, guide, etc. can be scoped to only apply to certain repos and certain filepaths/patterns.
Types of Custom Context
There are three types of custom context:
Custom Rules
You can define rules such as “use loops instead of list comprehension”, and Greptile will enforce this rule across your PRs.
Examples:
Use consistent and meaningful naming conventions in GraphQL code
Follow idiomatic Go patterns and conventions
Handle errors consistently and explicitly
Style Guides & Docs
You can point Greptile to your existing style guides and docs, and Greptile will use those as context when reviewing your PRs.
Other Context
There is also free-form space for you to explain any idiosyncracies with your team or codebase to personalize Greptile.
Here is an example:
Ensure billing logic follows these rules:
- User accounts should be deactivated after 90 days of inactivity
- Orders over $1000 require manager approval
- Refunds must be processed within 48 hours
- Premium users should have priority queue access
Scopes
Each type of context, rules, guides, and “other”, can be scoped to apply to specific repos and specific file patterns.
For example, I might want to enforce use of prop types
but only in acme/web_app
and only in files matching the pattern src/frontend/*.tsx
.
If you don’t explicitly define a scope, Greptile will intelligently determine when the rule/stylegude etc. should be applied.
Learning
Greptile can infer rules by observing other developers in your team commenting on PRs, as well as from interaction data such as replies to Greptile comments and 👍/👎 reactions to Greptile comments.
Greptile’s latest learnings can be found on the custom context page on the Greptile dashboard.