### Docs: OWNERSHIP File Syntax ###
Full article: https://youtrack.jetbrains.com/articles/PAT-A-107

OWNERSHIP files describe which group (defined in https://codeowners.labs.jb.gg/) owns files under a specific directory.

## Syntax ##

Minimal syntax:
```
owner 'Owner Group Name'

# Empty lines are ignored
# Lines started with '#' are ignored and should be used for comments
```

Rules defined in the OWNERSHIP file are applied to the respective directory and subdirectories.
In the minimal example below, the group owns:
- The directory where the OWNERSHIP file is placed
- Files in that directory, including the OWNERSHIP file itself
- Files and directories in the subdirectories

If required, you can define OWNERSHIP more granularly by adding patterns preceding the `owner 'Name'` definition:

```
# 'IntelliJ Platform' owns exactly Editor.java
/Editor.java
# And all Kotlin files under the current directory tree
/**/*.kt
owner 'IntelliJ Platform'

/UltimateLicenceCheck.kt
owner 'Ultimate Licencing'
```

Pattern rules:
- One line - one pattern
- Every pattern must start with a forward slash '/'
- A pattern can be an exact file path relative to the OWNERSHIP file directory
- Or a glob pattern respecting .gitignore pattern rules (https://git-scm.com/docs/gitignore#_pattern_format)
- Negation patterns are not supported

When a file matches several patterns inside one OWNERSHIP file, the latest matching pattern wins.

## Ownership calculation ##

- The closest matching OWNERSHIP file in the directory tree wins
- If the closest OWNERSHIP file exists but does not match the file, resolution falls back to a parent OWNERSHIP file that does match

Example:

```
├── OWNERSHIP      # owner 'IntelliJ Platform'
└── platform
    ├── OWNERSHIP  # owner 'VFS VFS'
    └── src
        └── VFS.kt
```

Ownership resolution for VFS.kt:
- '/platform/src/' - no OWNERSHIP, proceed to the parent dir
- '/platform/' - OWNERSHIP found (closest, matches)
- Owner resolved, 'IJPL VFS'

## Authoring guidance ##
- Prefer placing OWNERSHIP files inside the directories they describe instead of collecting many directory rules in one higher-level file
- This keeps ownership aligned when directories move, because OWNERSHIP files move with the directories
- This also reduces merge conflicts

