MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / load_from_path

Method load_from_path

src/project_config/mod.rs:14–29  ·  view source on GitHub ↗

Load and parse config from a specific path

(path: &Path)

Source from the content-addressed store, hash-verified

12impl ProjectConfig {
13 /// Load and parse config from a specific path
14 pub(crate) fn load_from_path(path: &Path) -> Result<Self> {
15 let config_content = fs::read(path)
16 .with_context(|| format!("Failed to read config file at {}", path.display()))?;
17
18 let config: Self = serde_yaml::from_slice(&config_content).with_context(|| {
19 format!(
20 "Failed to parse CodSpeed project config at {}",
21 path.display()
22 )
23 })?;
24
25 // Validate the config
26 config.validate()?;
27
28 Ok(config)
29 }
30
31 /// Validate the configuration
32 ///

Callers

nothing calls this directly

Calls 1

validateMethod · 0.80

Tested by

no test coverage detected