MCPcopy Create free account
hub / github.com/JordanCoin/codemap / Load

Function Load

config/config.go:208–220  ·  view source on GitHub ↗

Load reads .codemap/config.json from root. Returns zero-value ProjectConfig if the file is missing. Logs a warning to stderr and returns zero-value if JSON is malformed.

(root string)

Source from the content-addressed store, hash-verified

206// Returns zero-value ProjectConfig if the file is missing.
207// Logs a warning to stderr and returns zero-value if JSON is malformed.
208func Load(root string) ProjectConfig {
209 data, err := os.ReadFile(ConfigPath(root))
210 if err != nil {
211 return ProjectConfig{}
212 }
213
214 var cfg ProjectConfig
215 if err := json.Unmarshal(data, &cfg); err != nil {
216 fmt.Fprintf(os.Stderr, "Warning: malformed .codemap/config.json: %v\n", err)
217 return ProjectConfig{}
218 }
219 return cfg
220}
221
222// AssessSetup inspects .codemap/config.json and reports whether it should be
223// initialized or tuned before deeper Codemap analysis.

Callers 12

buildBlastRadiusBundleFunction · 0.92
mainFunction · 0.92
hookSessionStartFunction · 0.92
hookPromptSubmitFunction · 0.92
configShowFunction · 0.92
buildContextEnvelopeFunction · 0.92
TestLoad_MissingFileFunction · 0.85
TestLoad_ValidConfigFunction · 0.85
TestLoad_PartialConfigFunction · 0.85
TestLoad_MalformedJSONFunction · 0.85
TestLoad_EmptyObjectFunction · 0.85

Calls 1

ConfigPathFunction · 0.85

Tested by 5

TestLoad_MissingFileFunction · 0.68
TestLoad_ValidConfigFunction · 0.68
TestLoad_PartialConfigFunction · 0.68
TestLoad_MalformedJSONFunction · 0.68
TestLoad_EmptyObjectFunction · 0.68