Resolve configuration for a specific project by layering defaults and project overrides. Resolution order (later layers override earlier): 1. Built-in defaults 2. `[defaults]` section 3. Project-level `.tsk/tsk.toml` (if provided) 4. `[project. ]` section (if present) After layer merging, resolves `squid_conf_path` to content if `squid_conf` was not set by any layer's inline `squid_conf` fi
(
&self,
project_name: &str,
project_config: Option<&SharedConfig>,
project_root: Option<&Path>,
)
| 49 | /// After layer merging, resolves `squid_conf_path` to content if `squid_conf` was |
| 50 | /// not set by any layer's inline `squid_conf` field. |
| 51 | pub fn resolve_config( |
| 52 | &self, |
| 53 | project_name: &str, |
| 54 | project_config: Option<&SharedConfig>, |
| 55 | project_root: Option<&Path>, |
| 56 | ) -> ResolvedConfig { |
| 57 | let mut resolved = ResolvedConfig::default(); |
| 58 | |
| 59 | // Apply defaults layer |
| 60 | self.apply_shared_config(&mut resolved, &self.defaults); |
| 61 | |
| 62 | // Apply project-level .tsk/tsk.toml layer (if provided) |
| 63 | if let Some(config) = project_config { |
| 64 | self.apply_shared_config(&mut resolved, config); |
| 65 | } |
| 66 | |
| 67 | // Apply user [project.<name>] layer (highest priority) |
| 68 | if let Some(user_project_config) = self.project.get(project_name) { |
| 69 | self.apply_shared_config(&mut resolved, user_project_config); |
| 70 | } |
| 71 | |
| 72 | // Resolve squid_conf_path to content if squid_conf was not set by any layer |
| 73 | if resolved.squid_conf.is_none() { |
| 74 | resolved.squid_conf = |
| 75 | self.resolve_squid_conf_path(project_name, project_config, project_root); |
| 76 | } |
| 77 | |
| 78 | resolved |
| 79 | } |
| 80 | |
| 81 | /// Resolves squid_conf_path to file content, checking config layers in priority order. |
| 82 | /// Within each layer, squid_conf (already merged as scalar) takes priority over squid_conf_path. |