Skip to content

Fix #53: improve dependency cycle error message #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 5, 2020

Conversation

frenchy64
Copy link
Contributor

@frenchy64 frenchy64 commented Feb 7, 2020

Closes #53

Error message for cyclic deps now pretty-prints all (unique) cycles in the dependency graph, from smallest to largest. I removed the :input map from the thrown exception, and replaced it with :cycles, the collection of cycles in the same order as printed in the error.

Example deps graph:

{:a #{:b},
 :b #{:c :a},
 :c #{:d},
 :d #{:a :b}}

Example (new) error message:

Execution error (ExceptionInfo) at lein-monolith.dependency/topological-sort (dependency.clj:249).
Dependency cycles detected!

+ :a
^ + :b
|_/

+ :b
^ + :c
|  + :d
|_/

+ :a
^ + :b
|  + :c
|   + :d
|__/

@greglook greglook self-assigned this Feb 8, 2020
Copy link
Collaborator

@greglook greglook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this! The new cycle representations look neat. I have some feedback on style/idioms in the code and a few opportunities to simplify things.

@greglook
Copy link
Collaborator

You should also merge master to pick up some new CI checks.

@frenchy64
Copy link
Contributor Author

Merged master, tests pass.

@frenchy64 frenchy64 requested a review from greglook February 17, 2020 15:47
@greglook
Copy link
Collaborator

Hmm, I wonder why CircleCI isn't running on your commits? 🤔

@greglook greglook merged commit 4282896 into amperity:master Mar 5, 2020
@drewinglis
Copy link
Contributor

Hmm, I wonder why CircleCI isn't running on your commits? 🤔

It's supposed to:

image

Maybe @aengelberg would be willing to look in to this? :^)

@aengelberg aengelberg mentioned this pull request Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve cyclic dependency detection output
3 participants