https://github.com/softprops/codeowners
a rust crate for working with CODEOWNERS files
https://github.com/softprops/codeowners
codeowners github ownership
Last synced: 3 months ago
JSON representation
a rust crate for working with CODEOWNERS files
- Host: GitHub
- URL: https://github.com/softprops/codeowners
- Owner: softprops
- License: mit
- Created: 2017-07-21T05:44:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-09T10:19:33.000Z (over 5 years ago)
- Last Synced: 2025-04-09T10:49:13.828Z (3 months ago)
- Topics: codeowners, github, ownership
- Language: Rust
- Size: 588 KB
- Stars: 11
- Watchers: 2
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# codeowners [](https://travis-ci.org/softprops/codeowners) [](https://coveralls.io/github/softprops/codeowners?branch=master) [](LICENSE) [](https://crates.io/crates/codeowners) [](https://github.com/softprops/codeowners/actions)
> A Github [CODEOWNERS](https://help.github.com/articles/about-codeowners/) answer sheet
[Documentation](https://softprops.github.io/codeowners)
## installation
Add the following to your `Cargo.toml` filter
```toml
[dependencies]
codeowners = "0.1"
```## Usage
Typical use involves resolving a CODEOWNERS file, parsing it, then querying target paths
```rust
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-2019