|
2 | 2 | This is a CLI tool to generate [GitHub `CODEOWNERS` files](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) from an existing project assuming certain conventions around file annotations and Ruby/Javascript packages. |
3 | 3 | It's also the [oxidation](https://wiki.mozilla.org/Oxidation) of an existing [CLI tool](https://github.com/rubyatscale/code_ownership) written in Ruby. |
4 | 4 |
|
| 5 | +Targeting a large project, `codeowners` can be signifcantly faster than `codeownership`: |
| 6 | + |
| 7 | +| Command | Mean [s] | Min [s] | Max [s] | Relative | |
| 8 | +|:---|---:|---:|---:|---:| |
| 9 | +| `codeowners-rs validate` | 7.397 ± 0.143 | 7.091 | 7.621 | 1.00 | |
| 10 | +| `codeownership validate` | 45.265 ± 0.495 | 44.845 | 46.563 | 6.12 ± 0.14 | |
| 11 | + |
5 | 12 | ### Documentation |
6 | 13 |
|
7 | 14 | ```text |
@@ -30,6 +37,52 @@ Options: |
30 | 37 | Print version |
31 | 38 | ``` |
32 | 39 |
|
| 40 | +#### for-file |
| 41 | + |
| 42 | +Finds the owner of a given file. |
| 43 | + |
| 44 | +``` text |
| 45 | +$ codeowners for-file javascript/packages/PayrollFlow/index.tsx |
| 46 | +
|
| 47 | +Team: Payroll |
| 48 | +Team YML: config/teams/payroll.yml |
| 49 | +Description: Owner annotation at the top of the file, Owner defined in `javascript/packages/PayrollFlow/package.json` with implicity owned glob: `javascript/packages/PayrollFlow/**/**` |
| 50 | +
|
| 51 | +``` |
| 52 | + |
| 53 | +#### for-team |
| 54 | + |
| 55 | +Finds code ownership information for a given team. |
| 56 | + |
| 57 | +``` text |
| 58 | +$ codeowners for-team Payroll |
| 59 | +
|
| 60 | +# Code Ownership Report for `Payroll` Team |
| 61 | +
|
| 62 | +## Annotations at the top of file |
| 63 | +/javascript/packages/PayrollFlow/index.tsx |
| 64 | +/ruby/app/models/payroll.rb |
| 65 | +
|
| 66 | +## Team-specific owned globs |
| 67 | +This team owns nothing in this category. |
| 68 | +
|
| 69 | +## Owner in .codeowner |
| 70 | +/ruby/app/payroll/**/** |
| 71 | +
|
| 72 | +## Owner metadata key in package.yml |
| 73 | +/ruby/packages/payroll_flow/**/** |
| 74 | +
|
| 75 | +## Owner metadata key in package.json |
| 76 | +/javascript/packages/PayrollFlow/**/** |
| 77 | +
|
| 78 | +## Team YML ownership |
| 79 | +/config/teams/payroll.yml |
| 80 | +
|
| 81 | +## Team owned gems |
| 82 | +/gems/payroll_calculator/**/** |
| 83 | +``` |
| 84 | + |
| 85 | + |
33 | 86 | ### Adoption |
34 | 87 | This is an experimental port that might never be supported, use at your own risk and be prepared to fallback to the Ruby implementation if it stops working, if you still wish to adopt it, here are the instructions: |
35 | 88 |
|
|
0 commit comments