Crates.io | codeowners |
lib.rs | codeowners |
version | 0.1.3 |
source | src |
created_at | 2017-07-24 04:19:02.26288 |
updated_at | 2017-11-19 18:05:17.47308 |
description | Rust bindings for Github CODEOWNERS files |
homepage | https://github.com/softprops/codeowners |
repository | https://github.com/softprops/codeowners |
max_upload_size | |
id | 24777 |
size | 20,420 |
A Github CODEOWNERS answer sheet
Add the following to your Cargo.toml
filter
[dependencies]
codeowners = "0.1"
Typical use involves resolving a CODEOWNERS file, parsing it, then querying target paths
extern crate codeowners;
use std::env;
fn main() {
if let (Some(owners_file), Some(path)) =
(env::args().nth(1), env::args().nth(2)) {
let owners = codeowners::from_path(owners_file);
match owners.of(&path) {
None => println!("{} is up for adoption", path),
Some(owners) => {
for owner in owners {
println!("{}", owner);
}
}
}
}
}
Doug Tangren (softprops) 2017