codeowners

Crates.iocodeowners
lib.rscodeowners
version0.1.3
sourcesrc
created_at2017-07-24 04:19:02.26288
updated_at2017-11-19 18:05:17.47308
descriptionRust bindings for Github CODEOWNERS files
homepagehttps://github.com/softprops/codeowners
repositoryhttps://github.com/softprops/codeowners
max_upload_size
id24777
size20,420
cargo (github:rustpq:cargo)

documentation

https://softprops.github.io/codeowners

README

codeowners Build Status Coverage Status Software License crates.io

A Github CODEOWNERS answer sheet

Documentation

installation

Add the following to your Cargo.toml filter

[dependencies]
codeowners = "0.1"

Usage

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

Commit count: 43

cargo fmt