|
6 | 6 | A CLI tool for working with GitHub CODEOWNERS. |
7 | 7 |
|
8 | 8 | Things it does: |
9 | | -* Output who owns each file in your repo (ignoring files listed in `.gitignore`) |
10 | | -* Output who owns a single file |
11 | | -* Output ownership information at a specific git commit |
12 | | -* Output ownership information of staged files |
13 | | -* Outputs lots of lovely stats |
14 | | -* Outputs handy formats for integrations (CSV and JSONL) |
15 | | -* Validates that the provided owners are in the correct format for github |
| 9 | +* Calculate ownership stats |
| 10 | +* Find out who owns each and every file (ignoring files listed in `.gitignore`) |
| 11 | +* Find out who owns a single file |
| 12 | +* Find out who owns your staged files |
| 13 | +* Outputs in a bunch of script friendly handy formats for integrations (CSV and JSONL) |
| 14 | +* Validates that your CODEOWNERS file is valid |
16 | 15 |
|
17 | 16 | ## Installation |
18 | 17 | Install via npm globally then run |
@@ -82,7 +81,7 @@ Usage: github-codeowners audit [options] |
82 | 81 | list the owners for all files |
83 | 82 |
|
84 | 83 | Options: |
85 | | - -d, --dir <dirPath> path to VCS directory (default: "/Users/jjmschofield/projects/github/github-codeowners") |
| 84 | + -d, --dir <dirPath> path to VCS directory (default: "<current working directory>") |
86 | 85 | -c, --codeowners <filePath> path to codeowners file (default: "<dir>/.github/CODEOWNERS") |
87 | 86 | -o, --output <outputFormat> how to output format eg: simple, jsonl, csv (default: "simple") |
88 | 87 | -u, --unloved unowned files only (default: false) |
@@ -152,6 +151,30 @@ Options: |
152 | 151 | -h, --help output usage information |
153 | 152 | ``` |
154 | 153 |
|
| 154 | +### Validate |
| 155 | +Validates your CODEOWNERS file to find common mistakes, will throw on errors (such as malformed owners). |
| 156 | +```shell script |
| 157 | +$ cd <your awesome project> |
| 158 | +$ github-codeowners validate |
| 159 | +Found duplicate rules [ 'some/duplicate/rule @octocat' ] |
| 160 | +Found rules which did not match any files [ 'some/non-existent/path @octocat' ] |
| 161 | +... |
| 162 | +``` |
| 163 | + |
| 164 | +Full usage information: |
| 165 | +```shell script |
| 166 | +$ github-codeowners validate --help |
| 167 | +Usage: github-codeowners validate [options] |
| 168 | + |
| 169 | +Validates a CODOWNER file and files in dir |
| 170 | + |
| 171 | +Options: |
| 172 | + -d, --dir <dirPath> path to VCS directory (default: "<current working directory>") |
| 173 | + -c, --codeowners <filePath> path to codeowners file (default: "<dir>/.github/CODEOWNERS") |
| 174 | + -r, --root <rootPath> the root path to filter files by (default: "") |
| 175 | + -h, --help output usage information |
| 176 | +``` |
| 177 | + |
155 | 178 | ## Output Formats |
156 | 179 | Check `github-codeowners <command> --help` for support for a given command, however generally the following outputs are supported: |
157 | 180 | * `simple` - tab delimited - terminal friendly output |
|
0 commit comments