pub struct CodeownersBuilder { /* private fields */ }Expand description
Builder for Codeowners.
§Example
use cuenv_codeowners::{Codeowners, Platform, Rule};
let codeowners = Codeowners::builder()
.platform(Platform::Github)
.header("Code ownership rules")
.default_owners(["@org/maintainers"])
.rule(Rule::new("*.rs", ["@rust-team"]))
.rules([
Rule::new("/docs/**", ["@docs-team"]),
Rule::new("/ci/**", ["@devops"]),
])
.build();Implementations§
Source§impl CodeownersBuilder
impl CodeownersBuilder
Sourcepub fn path(self, path: impl Into<String>) -> Self
pub fn path(self, path: impl Into<String>) -> Self
Set a custom output path.
Overrides the platform’s default path.
Sourcepub fn header(self, header: impl Into<String>) -> Self
pub fn header(self, header: impl Into<String>) -> Self
Set a custom header comment.
The header will be added at the top of the file with # prefixes.
Sourcepub fn default_owners(
self,
owners: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn default_owners( self, owners: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Set default owners for all files.
This creates a * @owner1 @owner2 rule at the top of the file.
Sourcepub fn rules(self, rules: impl IntoIterator<Item = Rule>) -> Self
pub fn rules(self, rules: impl IntoIterator<Item = Rule>) -> Self
Add multiple rules.
Sourcepub fn build(self) -> Codeowners
pub fn build(self) -> Codeowners
Build the Codeowners configuration.
Trait Implementations§
Source§impl Clone for CodeownersBuilder
impl Clone for CodeownersBuilder
Source§fn clone(&self) -> CodeownersBuilder
fn clone(&self) -> CodeownersBuilder
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodeownersBuilder
impl Debug for CodeownersBuilder
Source§impl Default for CodeownersBuilder
impl Default for CodeownersBuilder
Source§fn default() -> CodeownersBuilder
fn default() -> CodeownersBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodeownersBuilder
impl RefUnwindSafe for CodeownersBuilder
impl Send for CodeownersBuilder
impl Sync for CodeownersBuilder
impl Unpin for CodeownersBuilder
impl UnwindSafe for CodeownersBuilder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)