Expand description
Generate CODEOWNERS files for GitHub, GitLab, and Bitbucket.
This crate provides a builder-based API for generating CODEOWNERS files that define code ownership rules for your repository.
§Example
use cuenv_codeowners::{Codeowners, Platform, Rule};
let codeowners = Codeowners::builder()
.platform(Platform::Github)
.default_owners(["@org/core-team"])
.rule(Rule::new("*.rs", ["@rust-team"]))
.rule(Rule::new("/docs/**", ["@docs-team"]).section("Documentation"))
.build();
let content = codeowners.generate();
// Write to .github/CODEOWNERS or wherever appropriate§Platform Support
- GitHub: Uses
.github/CODEOWNERSpath and# Sectioncomment syntax - GitLab: Uses
CODEOWNERSpath and[Section]syntax for sections - Bitbucket: Uses
CODEOWNERSpath and# Sectioncomment syntax
§Provider Support
The provider module provides a trait-based abstraction for syncing
CODEOWNERS files. Use [provider::detect_provider] to auto-detect the
platform and get the appropriate provider.
§Features
serde: Enable serde serialization/deserialization for all typesschemars: Enable JSON Schema generation (impliesserde)
Modules§
- provider
- CODEOWNERS sync providers for different platforms.
Structs§
- Codeowners
- CODEOWNERS file configuration and generator.
- Codeowners
Builder - Builder for
Codeowners. - Rule
- A single code ownership rule.
Enums§
- Platform
- Target platform for CODEOWNERS file generation.