fix: correct circular dep detection in pre-commit hook
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m30s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m30s
The generate-dependency-graph.js script was counting madge's 'Processed N files' info line as a circular chain. Fixed the filter to only match lines starting with 'N)' pattern.
This commit is contained in:
@@ -86,9 +86,13 @@ try {
|
||||
}
|
||||
|
||||
const lines = circularOutput.trim().split('\n').filter(Boolean);
|
||||
// madge circular output starts with "Found N circular dependencies!"
|
||||
// madge circular output format:
|
||||
// "Found N circular dependencies!" (summary)
|
||||
// "1) fileA > fileB > fileC" (chain lines start with number + ')')
|
||||
// "Processed N files ..." (info line to ignore)
|
||||
// "✔ No circular dependency found!" (clean result)
|
||||
const circularLines = lines.filter(
|
||||
(l) => !l.startsWith('Found') && !l.startsWith('✔') && l.trim()
|
||||
(l) => /^\d+\)/.test(l.trim())
|
||||
);
|
||||
|
||||
let content;
|
||||
|
||||
Reference in New Issue
Block a user