Project Boundary
Where to Place greptile.json
You can configure Greptile by adding a greptile.json file at the root of your project boundary.
The project boundary is the context path shown in the review summary.
Example
If your review summary shows:
Run with Greptile v3 — Context used: //depot/linux/arch/alphaThen the configuration file must be placed at:
How Greptile Determines the Project Boundary
Greptile determines the boundary based on the onboarded paths involved in the review. Case A: Review Spans Multiple Onboarded Paths If://depot/project/frontendis onboarded//depot/project/backendis onboarded//depot/projectis also onboarded
- Greptile finds the nearest common parent
- Since
//depot/projectis onboarded, it becomes the project boundary - The configuration used will be:
//depot/project/frontendbecomes the project boundary- The configuration used will be:
Key Rules
Greptile:- Uses the nearest common parent path
- Only considers parents that are also onboarded
- Loads the
greptile.jsonfile from the resolved project boundary
greptile.json
Configuration Parameters
All parameters are optional.Ignore Patterns
TheignorePatterns field uses .gitignore syntax to exclude files from review. Patterns are separated by \n (newline characters) in the JSON string. Paths are relative to the project boundary.
Custom Context
ThecustomContext field provides additional context for code reviews:
rules - Specific coding rules to enforce
- Define coding standards or project-specific requirements
- Each rule includes a
scope(glob patterns) andrule(string)
files - Reference depot documentation files
- Point to existing style guides or reference files using Perforce depot paths
- Includes
path(e.g.,//depot/projects/my_project/style_guide.md),description, andscope
other - General instructions or context
- Additional background information or high-level guidance
- Includes
contentand optionalscope
Scope Targeting
Each context item supports an optionalscope array using glob patterns. For Perforce, scope patterns work with depot paths: