MCPcopy Index your code
hub / github.com/commitdev/zero / SummarizeParameters

Function SummarizeParameters

internal/config/moduleconfig/module_config.go:236–251  ·  view source on GitHub ↗

SummarizeParameters receives all parameters gathered from prompts during `Zero init` and based on module definition to construct the parameters for each module for zero-project.yml filters out parameters defined as OmitFromProjectFile: true

(module ModuleConfig, allParams map[string]string)

Source from the content-addressed store, hash-verified

234// and based on module definition to construct the parameters for each module for zero-project.yml
235// filters out parameters defined as OmitFromProjectFile: true
236func SummarizeParameters(module ModuleConfig, allParams map[string]string) map[string]string {
237 moduleParams := make(projectconfig.Parameters)
238 // Loop through all the prompted values and find the ones relevant to this module
239 for parameterKey, parameterValue := range allParams {
240 for _, moduleParameter := range module.Parameters {
241 if moduleParameter.Field == parameterKey {
242 if moduleParameter.OmitFromProjectFile {
243 flog.Debugf("Omitted %s from %s", parameterKey, module.Name)
244 } else {
245 moduleParams[parameterKey] = parameterValue
246 }
247 }
248 }
249 }
250 return moduleParams
251}
252
253// SummarizeConditions based on conditions from zero-module.yml
254// creates and returns slice of conditions for project config

Callers 1

InitFunction · 0.92

Calls 1

DebugfFunction · 0.92

Tested by

no test coverage detected