Skip to main content

detect_project_root

Function detect_project_root 

Source
pub fn detect_project_root(file_path: &str) -> Option<String>
Expand description

Finds the outermost project root by walking up from file_path. For monorepos with nested .git dirs (e.g. mono/backend/.git + mono/frontend/.git), returns the outermost ancestor containing .git, a workspace marker, or a known monorepo config file — so the whole monorepo is treated as one project.