Skip to main content

Which rules a review applies

Every review applies the active rules of three scopes: Global → Repository → Directory.
  • Global rules apply to every repository.
  • Repository rules apply to every pull request in that repository.
  • Directory rules apply when the pull request is reviewed with that directory scope’s settings, which happens when it touches exactly one directory scope. The rules of the repository’s other directory scopes do not apply.
  • A pull request that touches no directory scope, or two or more, is reviewed with the repository’s settings. In that case the rules of all of the repository’s directory scopes apply too, to every file in the pull request.
A rule written at a parent scope is always inherited by the scopes below it. A rule that appears at two scopes with identical instructions runs once.
Reviews apply active rules from parent scopes even if the Kody Rules page shows them as disabled locally. To stop a rule from applying, pause it at the scope where it was created or narrow its Path where that field is available.

In the app

On the Kody Rules page, rules inherited from higher scopes are listed next to the scope’s own rules, marked with the scope they come from. They are read-only there: open the rule and use View, or go to the scope where it was created to edit it. Filters → View shows or hides Inherited from Global, Inherited from Repository and Disabled Rules.

Inheritable

On a rule at any scope, open Advanced settings in the rule dialog and turn off Inheritable (on by default).
  • The rule is no longer listed as inherited in the scopes below it.
  • A review still applies it at every scope as described above.

Override and disable for this scope

At a repository or directory scope, open an inherited rule (View) and turn on Override and disable for this scope.
  • The rule shows as Disabled at that scope, and is hidden when Disabled Rules is unchecked in Filters → View.
  • It does not show as disabled in scopes below, which keep their own setting.
  • A review still applies the rule.
To stop a rule from applying, pause or delete it at the scope where it was created.

Centralized config

A rule file in a centralized config repository can carry the same settings:
inheritable and exclude behave as described above. include has no control in the app and no effect on a review; a rule with a non-empty include list is not shown in the inherited list.