Skip to main content

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/alpha
Then the configuration file must be placed at:
Greptile will use this file when reviewing changes within that boundary.

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/frontend is onboarded
  • //depot/project/backend is onboarded
  • //depot/project is also onboarded
And the review includes files from both:
Then:
  • Greptile finds the nearest common parent
  • Since //depot/project is onboarded, it becomes the project boundary
  • The configuration used will be:
Case B: Review Is Limited to a Single Onboarded Path If the review only contains files from:
And that path is onboarded, then:
  • //depot/project/frontend becomes 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.json file from the resolved project boundary
greptile.json

Configuration Parameters

All parameters are optional.

Ignore Patterns

The ignorePatterns 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

The customContext 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) and rule (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, and scope
other - General instructions or context
  • Additional background information or high-level guidance
  • Includes content and optional scope

Scope Targeting

Each context item supports an optional scope array using glob patterns. For Perforce, scope patterns work with depot paths:
Additional scope examples: