pub struct SafetyConfig {
pub enabled: bool,
pub strict_mode: bool,
pub show_progress: bool,
pub parallel_checks: bool,
pub pre_commit: StageConfig,
pub pre_push: StageConfig,
pub publish: StageConfig,
pub bypass: BypassConfig,
}Expand description
Safety pipeline configuration
Fields§
§enabled: boolWhether safety pipeline is enabled
strict_mode: boolStrict mode - block operations on failure
show_progress: boolShow progress indicators
parallel_checks: boolRun checks in parallel when possible
pre_commit: StageConfigPre-commit configuration
pre_push: StageConfigPre-push configuration
publish: StageConfigPublish configuration
bypass: BypassConfigBypass configuration
Implementations§
Source§impl SafetyConfig
impl SafetyConfig
Sourcepub async fn load_or_default() -> Result<Self>
pub async fn load_or_default() -> Result<Self>
Load configuration from file, or return default if not found
§Errors
This function falls back to defaults on error and does not itself return errors.
Sourcepub async fn save(&self) -> Result<()>
pub async fn save(&self) -> Result<()>
Save configuration to file
§Errors
Returns an error if the config directory cannot be created, the configuration cannot be serialized, or the file cannot be written.
Sourcepub fn config_file_path() -> Result<PathBuf>
pub fn config_file_path() -> Result<PathBuf>
Get the path to the safety configuration file
§Errors
Returns an error if the config directory path cannot be resolved.
Sourcepub fn get_stage_config(&self, stage: PipelineStage) -> &StageConfig
pub fn get_stage_config(&self, stage: PipelineStage) -> &StageConfig
Get configuration for a specific stage
Sourcepub fn get_stage_config_mut(&mut self, stage: PipelineStage) -> &mut StageConfig
pub fn get_stage_config_mut(&mut self, stage: PipelineStage) -> &mut StageConfig
Get mutable configuration for a specific stage
Sourcepub fn is_check_enabled(&self, stage: PipelineStage, check: CheckType) -> bool
pub fn is_check_enabled(&self, stage: PipelineStage, check: CheckType) -> bool
Check if a specific check is enabled for a stage
Sourcepub fn get_timeout(&self, stage: PipelineStage) -> Duration
pub fn get_timeout(&self, stage: PipelineStage) -> Duration
Get timeout for a specific stage
Trait Implementations§
Source§impl Clone for SafetyConfig
impl Clone for SafetyConfig
Source§fn clone(&self) -> SafetyConfig
fn clone(&self) -> SafetyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SafetyConfig
impl Debug for SafetyConfig
Source§impl Default for SafetyConfig
impl Default for SafetyConfig
Source§impl<'de> Deserialize<'de> for SafetyConfig
impl<'de> Deserialize<'de> for SafetyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SafetyConfig
impl RefUnwindSafe for SafetyConfig
impl Send for SafetyConfig
impl Sync for SafetyConfig
impl Unpin for SafetyConfig
impl UnsafeUnpin for SafetyConfig
impl UnwindSafe for SafetyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more