Skip to content

Commit 5259cf2

Browse files
committed
docs: Add benchmarks and example output
1 parent 6ade3bd commit 5259cf2

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
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.
33
It's also the [oxidation](https://wiki.mozilla.org/Oxidation) of an existing [CLI tool](https://github.com/rubyatscale/code_ownership) written in Ruby.
44

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+
512
### Documentation
613

714
```text
@@ -30,6 +37,52 @@ Options:
3037
Print version
3138
```
3239

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+
3386
### Adoption
3487
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:
3588

0 commit comments

Comments
 (0)