Skip to content

break cycles, add flag for detecting cycles#7

Merged
jmank88 merged 1 commit into
mainfrom
break-on-cycle
May 14, 2026
Merged

break cycles, add flag for detecting cycles#7
jmank88 merged 1 commit into
mainfrom
break-on-cycle

Conversation

@skudasov

@skudasov skudasov commented May 14, 2026

Copy link
Copy Markdown
Collaborator

This adds a back-edge DFS algorithm for cycle detection and skips cycles, preventing the tool from hanging in such cases.
I've chosen DFS because of readability and simplicity. This algorithm can miss some cycles due to the traversal order, but eventually it will discover all module cycles if we start fixing them.
Tested on this PR, the tool no longer hangs, on "main" it produces the same go.md

@skudasov skudasov force-pushed the break-on-cycle branch 9 times, most recently from b4ae21c to 11fbd2e Compare May 14, 2026 09:48
@skudasov skudasov marked this pull request as ready for review May 14, 2026 09:48
@skudasov skudasov requested a review from jmank88 May 14, 2026 09:57
@jmank88 jmank88 merged commit d98bfc4 into main May 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants