Crate cuenv_codeowners

Crate cuenv_codeowners 

Source
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/CODEOWNERS path and # Section comment syntax
  • GitLab: Uses CODEOWNERS path and [Section] syntax for sections
  • Bitbucket: Uses CODEOWNERS path and # Section comment 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 types
  • schemars: Enable JSON Schema generation (implies serde)

Modules§

provider
CODEOWNERS sync providers for different platforms.

Structs§

Codeowners
CODEOWNERS file configuration and generator.
CodeownersBuilder
Builder for Codeowners.
Rule
A single code ownership rule.

Enums§

Platform
Target platform for CODEOWNERS file generation.