A Ruby CLI tool for validating GitHub CODEOWNERS files.
gem install codeowners-validator- Ruby must be installed
- A
CODEOWNERSfile must exist
codeowners-validator <subcommand> [options] [CODEOWNERS_PATH]CODEOWNERS_PATH を省略した場合、カレントディレクトリの CODEOWNERS を使用します。
| Subcommand | Description |
|---|---|
duplicate |
Detect duplicate pattern definitions |
ghost |
Detect patterns pointing to non-existent files or directories |
uncovered |
Detect files not covered by any CODEOWNERS pattern |
| Option | Description |
|---|---|
-q, --quiet |
Suppress output; communicate results via exit status only |
Exit status: 0 = ok / 1 = issues found
Checks if the same path pattern appears in multiple lines.
codeowners-validator duplicate CODEOWNERSDuplicate CODEOWNERS entries detected:
/app/models
- @team-a at lines 10
- @team-b at lines 25
Total duplicate groups: 1
Reports patterns in CODEOWNERS that do not match any actual file or directory.
codeowners-validator ghost CODEOWNERSGhost CODEOWNERS patterns detected:
/lib/does_not_exist/foo.rb @owner at line 3
/no/such/dir/ @owner at line 6
Total ghost patterns: 2
Reports files in the repository that do not match any CODEOWNERS pattern. The .git/ directory is excluded by default.
codeowners-validator uncovered CODEOWNERSUncovered files detected:
- config/settings.yml
- scripts/deploy.sh
Total uncovered files: 2
bundle install
bundle exec rspec