pub struct ProjectConfig {
pub effect_policies: HashMap<String, EffectPolicy>,
pub check_suppressions: Vec<CheckSuppression>,
pub independence_mode: IndependenceMode,
pub shape_layers: Vec<ShapeLayerFingerprint>,
pub shape_expected: Vec<ShapeExpected>,
}Expand description
Project-level configuration loaded from aver.toml.
Fields§
§effect_policies: HashMap<String, EffectPolicy>Effect namespace → policy. Absence of a key means “allow all”.
check_suppressions: Vec<CheckSuppression>Check-time warning suppressions.
independence_mode: IndependenceModeHow ?! products handle branch failure.
shape_layers: Vec<ShapeLayerFingerprint>Per-project layer fingerprints for aver shape. Empty = use the
built-in v0 baseline.
shape_expected: Vec<ShapeExpected>Path-glob → expected-layer declarations for aver shape --lint.
Empty = --lint is a no-op (nothing to flag against).
Implementations§
Source§impl ProjectConfig
impl ProjectConfig
Sourcepub fn load_from_dir(dir: &Path) -> Result<Option<Self>, String>
pub fn load_from_dir(dir: &Path) -> Result<Option<Self>, String>
Try to load aver.toml from the given directory.
Returns Ok(None) if the file does not exist.
Returns Err if the file exists but is malformed (parse errors, bad types).
Sourcepub fn parse(content: &str) -> Result<Self, String>
pub fn parse(content: &str) -> Result<Self, String>
Parse the TOML content into a ProjectConfig.
Sourcepub fn shape_expected_for(&self, file_path: &str) -> Option<&str>
pub fn shape_expected_for(&self, file_path: &str) -> Option<&str>
True when at least one [[shape.expected]] glob matches file_path.
--lint consults this to decide whether the file has a declared
expected layer to compare against.
Sourcepub fn is_check_suppressed(&self, slug: &str, file_path: &str) -> bool
pub fn is_check_suppressed(&self, slug: &str, file_path: &str) -> bool
Returns true if a diagnostic with the given slug at file_path
is suppressed by any [[check.suppress]] rule.
Sourcepub fn check_http_host(
&self,
method_name: &str,
url_str: &str,
) -> Result<(), String>
pub fn check_http_host( &self, method_name: &str, url_str: &str, ) -> Result<(), String>
Check whether an HTTP call to url_str is allowed by the policy.
Returns Ok(()) if allowed, Err(message) if denied.
Trait Implementations§
Source§impl Clone for ProjectConfig
impl Clone for ProjectConfig
Source§fn clone(&self) -> ProjectConfig
fn clone(&self) -> ProjectConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more