Overview
A directory scope applies its own code review settings to one or more folders of a repository. Use it for monorepos, where areas have different standards or owners. Kody uses a single configuration per pull request: Directory → Repository → Global.Learn how settings flow between levels in Config Inheritance & Overrides.
How it works
- A directory scope can hold one folder or several. All of its folders share the same settings.
- Folders can be at any depth, for example
api/src/services. - You can add as many directory scopes as you need.
- A folder belongs to one directory scope only. Folders inside a folder that already has a scope are not selectable.
Selection rules
Kody checks which directory scopes the pull request touches:- One scope touched: uses that scope’s settings. Files outside any scope do not change this.
- No scope touched: uses the repository’s settings, or Global if the repository has none.
- Two or more scopes touched: uses the repository’s settings, or Global if the repository has none.
Kody uses one configuration per pull request to keep reviews predictable. Mixing configurations causes conflicts.
Examples
- Single configured directory
- No configured directories
- Multiple configured directories
You added a scope for
src/microservice-alpha. A pull request changes files in src/microservice-alpha and in unconfigured folders.Uses the microservice-alpha settings.Setup
- In the sidebar, pick the repository in the scope picker at the top of the Code review group.
- Open the picker again and choose Add directory scope at the bottom.
- In the Add directory scope dialog, tick the folders under Select directories. They are listed under Selected directories. Click Add directory scope.
- Pick the new scope. It appears indented under its repository in the picker. Change settings on any page and click Save settings.
kodus-config.yml and directory scopes
- Kody reads
kodus-config.ymlfrom the root of the repository’s default branch only. It never reads akodus-config.ymlplaced inside a folder. - It reads the root file only when Prefer kodus-config.yml settings is on at the repository scope. The switch also appears at directory scope, but it does not change a review: turning it on there does not make Kody read a file for that directory, and turning it off does not stop the repository’s file from applying.
- A setting overridden on the directory scope takes precedence over the same setting in the repository’s file.
- To keep a directory scope’s settings in files, use a centralized config repository, where a
kodus-config.ymlin the scope’s folder is synced into the directory scope’s settings.