MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / layer_key

Function layer_key

atomic-cli/src/commands/triage/project.rs:819–827  ·  view source on GitHub ↗

A modified path's layer key: its KG module (`PART_OF`) when enriched, otherwise its parent directory (`(root)` for top-level files). Purely path-derived in the fallback, so unenriched repos still get a walkthrough.

(path: &str, file_module: &BTreeMap<String, String>)

Source from the content-addressed store, hash-verified

817/// otherwise its parent directory (`(root)` for top-level files). Purely
818/// path-derived in the fallback, so unenriched repos still get a walkthrough.
819fn layer_key(path: &str, file_module: &BTreeMap<String, String>) -> String {
820 if let Some(module) = file_module.get(path) {
821 return module.clone();
822 }
823 match path.rsplit_once('/') {
824 Some((dir, _)) => dir.to_string(),
825 None => "(root)".to_string(),
826 }
827}
828
829/// First non-empty line of a task's directive body, trimmed — the walkthrough
830/// narrates with headlines, not whole bodies.

Callers 1

build_walkthroughFunction · 0.85

Calls 2

getMethod · 0.65
cloneMethod · 0.45

Tested by

no test coverage detected