{"id":15755377,"url":"https://github.com/hmarr/codeowners-rs","last_synced_at":"2025-03-13T16:32:03.246Z","repository":{"id":66955393,"uuid":"559617672","full_name":"hmarr/codeowners-rs","owner":"hmarr","description":"🔒 A fast Rust library and CLI for GitHub's CODEOWNERS files","archived":false,"fork":false,"pushed_at":"2023-10-18T18:43:23.000Z","size":182,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T20:22:32.045Z","etag":null,"topics":["codeowners","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmarr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"codeowners-cli/Cargo.toml","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-30T17:08:39.000Z","updated_at":"2025-01-05T13:20:16.000Z","dependencies_parsed_at":"2024-10-25T06:49:36.995Z","dependency_job_id":"04e449c9-f097-4f88-9b27-5a345a80889a","html_url":"https://github.com/hmarr/codeowners-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fcodeowners-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fcodeowners-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fcodeowners-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fcodeowners-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmarr","download_url":"https://codeload.github.com/hmarr/codeowners-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243441501,"owners_count":20291482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codeowners","rust"],"created_at":"2024-10-04T08:21:35.681Z","updated_at":"2025-03-13T16:32:03.240Z","avatar_url":"https://github.com/hmarr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codeowners-rs\n\nA fast Rust library and CLI for GitHub's [CODEOWNERS file](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax).\n\n[![crates.io](https://img.shields.io/crates/v/codeowners-rs.svg)](https://crates.io/crates/codeowners-rs)\n[![docs.rs](https://img.shields.io/badge/docs.rs-codeowners--rs-blue?logo=docs.rs)](https://docs.rs/codeowners-rs)\n[![CI](https://github.com/hmarr/codeowners-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/hmarr/codeowners-rs/actions/workflows/ci.yml)\n\n## Highlights\n\n- Processes large, complex CODEOWNERS files quickly by constructing an NFA from the set of rules. Rather than matching each rule against each path, the NFA is traversed once for each path. The CLI tool also parallelizes path matching.\n- Includes a fast, hand-written parser for CODEOWNERS files. The resulting parse tree includes comments and byte offsets for all syntax components, making it suitable for writing syntax highlighters or providing syntax-aware diagnostic information.\n\n## Example usage\n\n```rust\nuse codeowners_rs::{parse, RuleSet};\n\nlet ruleset = parse(\"\n*.rs @github/rustaceans\n/docs/**/*.md @github/docs-team\n\").into_ruleset();\n\nfor path in \u0026[\"src/main.rs\", \"docs/README.md\", \"README.md\"] {\n   let owners = ruleset.owners(path);\n   println!(\"{}: {:?}\", path, owners);\n}\n```\n\nSee the full documentation on [docs.rs](https://docs.rs/codeowners-rs).\n\n## CLI usage\n\n```\n$ codeowners --help\nUsage: codeowners [OPTIONS] [PATHS]...\n\nArguments:\n  [PATHS]...\n\nOptions:\n  -f, --file \u003cCODEOWNERS_FILE\u003e\n          Path to a CODEOWNERS file. If omitted, the following locations will be tried: ./CODEOWNERS, ./.github/CODEOWNERS\n  -p, --paths-from \u003cPATHS_FROM_FILE\u003e\n          Match paths from this file rather than walking the directory tree\n  -o, --owners \u003cOWNERS\u003e\n          Filter results to files owned by this owner. May be used multiple times to match multiple owners\n  -u, --unowned\n          Filter results to show unowned files. May be used with -o\n  -t, --threads \u003cTHREADS\u003e\n          Concurrency. If set to 0, a sensible value based on CPU count will be used [default: 0]\n  -h, --help\n          Print help information\n  -V, --version\n          Print version information\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmarr%2Fcodeowners-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmarr%2Fcodeowners-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmarr%2Fcodeowners-rs/lists"}