From 99d2cf526b5b17bdf7523cce478aff22b081b485 Mon Sep 17 00:00:00 2001 From: wtlin1228 Date: Wed, 9 Oct 2024 23:01:46 +0800 Subject: [PATCH] feat: ignore routeNmaes symbol to avoid circular dependency --- crates/dt_tracker/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/dt_tracker/src/lib.rs b/crates/dt_tracker/src/lib.rs index 474e1b4..b53bc15 100644 --- a/crates/dt_tracker/src/lib.rs +++ b/crates/dt_tracker/src/lib.rs @@ -79,6 +79,13 @@ impl<'graph> DependencyTracker<'graph> { } pub fn trace(&mut self, module_symbol: ModuleSymbol) -> anyhow::Result>> { + // Treat routeNmaes specially since they cause a lot of circular dependencies in + // some of our codebases. One assumption of this tool is "no circular dependency" + // , so let's workaround here for now. + if module_symbol.1.to_string() == "routeNames" { + return Ok(vec![]); + } + // early return if cached if let Some(cached) = self.cache.get(&module_symbol) { return Ok(cached.clone());