|
1 | 1 | # Codeowners |
| 2 | + |
2 | 3 | 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 | 4 | 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 | 5 |
|
5 | | -Targeting a large project, `codeowners` can be signifcantly faster than `codeownership`: |
| 6 | +Targeting a large project, `codeowners` can be signifcantly faster than [code_ownership](https://github.com/rubyatscale/code_ownership): |
6 | 7 |
|
7 | 8 | ``` text |
8 | 9 | $ hyperfine 'codeownership validate' 'codeowners validate' |
9 | | -Benchmark 1: codeownership validate |
10 | | - Time (mean ± σ): 44.389 s ± 0.219 s [User: 4.034 s, System: 22.216 s] |
11 | | - Range (min … max): 44.014 s … 44.738 s 10 runs |
| 10 | +Benchmark 1: codeownership validate (ruby gem https://github.com/rubyatscale/code_ownership) |
| 11 | + Time (mean ± σ): 47.991 s ± 1.220 s [User: 4.590 s, System: 24.379 s] |
| 12 | + Range (min … max): 46.777 s … 49.217 s 3 runs |
12 | 13 |
|
13 | | -Benchmark 2: codeowners validate |
14 | | - Time (mean ± σ): 7.521 s ± 0.080 s [User: 8.809 s, System: 44.343 s] |
15 | | - Range (min … max): 7.361 s … 7.603 s 10 runs |
| 14 | +Benchmark 2: codeowners gv (this repo) |
| 15 | + Time (mean ± σ): 4.263 s ± 0.025 s [User: 9.359 s, System: 3.273 s] |
| 16 | + Range (min … max): 4.246 s … 4.292 s 3 runs |
16 | 17 |
|
17 | 18 | Summary |
18 | | - codeowners validate ran |
19 | | - 5.90 ± 0.07 times faster than codeownership validate |
| 19 | + codeowners gv ran |
| 20 | + 11.26 ± 0.29 times faster than codeownership validate |
20 | 21 | ``` |
21 | 22 |
|
22 | 23 | | Command | Mean [s] | Min [s] | Max [s] | Relative | |
23 | 24 | |:---|---:|---:|---:|---:| |
24 | | -| `codeownership validate` | 44.389 ± 0.219 | 44.014 | 44.738 | 5.90 ± 0.07 | |
25 | | -| `codeowners validate` | 7.521 ± 0.080 | 7.361 | 7.603 | 1.00 | |
| 25 | +| `codeownership validate` | 47.991 ± 1.220 | 46.777 | 49.217 | 11.26 ± 0.29 | |
| 26 | +| `codeowners gv` | 4.263 ± 0.025 | 4.246 | 4.292 | 1.00 | |
26 | 27 |
|
27 | | -### Documentation |
| 28 | +## Documentation |
28 | 29 |
|
29 | 30 | ```text |
30 | 31 | A CLI to validate and generate Github's CODEOWNERS file |
@@ -52,9 +53,9 @@ Options: |
52 | 53 | Print version |
53 | 54 | ``` |
54 | 55 |
|
55 | | -#### Getting Started |
| 56 | +### Getting Started |
56 | 57 |
|
57 | | -See the [CONFIGURATION.md](CONFIGURATION.md) file for more information on how to codeowners. |
| 58 | +See the [CONFIGURATION.md](CONFIGURATION.md) file for more information on how to configure codeowners. |
58 | 59 |
|
59 | 60 | #### for-file |
60 | 61 |
|
@@ -103,24 +104,8 @@ This team owns nothing in this category. |
103 | 104 | /gems/payroll_calculator/**/** |
104 | 105 | ``` |
105 | 106 |
|
106 | | - |
107 | | -### Adoption |
108 | | -This is an experimental port, 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: |
109 | | - |
110 | | -```bash |
111 | | -# sets up a Rust toolchain |
112 | | -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
113 | | - |
114 | | -# Compile and install locally |
115 | | -gh repo clone rubyatscale/codeowners-rs |
116 | | -cd codeowners-rs |
117 | | -cargo install --path . |
118 | | - |
119 | | -# Set an environment variable that switches ZP's commit hook to use the globally installed binary |
120 | | -echo USE_CODEOWNERS_RS=true >> ~/.zshrc |
121 | | -``` |
122 | | - |
123 | 107 | ### Development |
| 108 | + |
124 | 109 | The CLI is written in Rust. Rust provides strong type gurantees and an great ecosystem of CLI libraries. To be able to compile the code locally, you'll need to setup a rust compiler (See https://rustup.rs/): |
125 | 110 |
|
126 | 111 | ```bash |
|
0 commit comments