The CLI behaviors live in src/cli.rs.
- Generate CODEOWNERS: Builds
.github/CODEOWNERSfrom multiple ownership sources. See mappers insrc/ownership/mapper/. - Answer per-file ownership: The
for-filecommand returns the owner of a given file even if the checked-inCODEOWNERSis not up to date.
- Fast but potentially inaccurate:
Runner::for_file_from_codeowners(insrc/runner.rs) parses the existingCODEOWNERSfile to find a file’s owner. It’s very fast, but can be wrong ifCODEOWNERSis stale. - Accurate but slow:
Runner::for_fileis correct but can take up to ~4 seconds on large repositories because it effectively determines ownership for many files and then returns the single result needed.
Ownership resolution is complex because definitions often live in other files (packages, team configs, globs, etc.).
Implement a faster for_file that remains accurate.
- Performance: Under 1 second on large codebases (e.g.,
$HOME/workspace/large). - Correctness: All existing tests must continue to pass.
- Compatibility: No changes to the external behavior of the
for-fileCLI command.