pub trait CodeOwnersProvider: Send + Sync {
// Required methods
fn output_path(&self) -> &str;
fn section_style(&self) -> SectionStyle;
fn sync(
&self,
repo_root: &Path,
projects: &[ProjectOwners],
dry_run: bool,
) -> Result<SyncResult>;
fn check(
&self,
repo_root: &Path,
projects: &[ProjectOwners],
) -> Result<CheckResult>;
}Expand description
Trait for CODEOWNERS sync providers.
Each platform implements this trait to provide platform-specific sync behavior. Implementations determine the output path and section formatting style.
Required Methods§
Sourcefn output_path(&self) -> &str
fn output_path(&self) -> &str
Get the output path for the CODEOWNERS file.
Examples: .github/CODEOWNERS (GitHub), CODEOWNERS (GitLab)
Sourcefn section_style(&self) -> SectionStyle
fn section_style(&self) -> SectionStyle
Get the section formatting style.
Sourcefn sync(
&self,
repo_root: &Path,
projects: &[ProjectOwners],
dry_run: bool,
) -> Result<SyncResult>
fn sync( &self, repo_root: &Path, projects: &[ProjectOwners], dry_run: bool, ) -> Result<SyncResult>
Sync CODEOWNERS from project configurations.
Aggregates ownership rules from all projects and writes the appropriate CODEOWNERS file(s) for this platform.
§Arguments
repo_root- Root directory of the repositoryprojects- List of projects with their ownership configurationsdry_run- If true, don’t write files, just report what would happen
§Errors
Returns an error if file operations fail or configuration is invalid.