amperity / lein-monolith

Leiningen plugin for working with monorepos.
Other
214 stars 18 forks source link

Fix #53: improve dependency cycle error message #61

Closed frenchy64 closed 4 years ago

frenchy64 commented 4 years ago

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 commented 4 years ago

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

frenchy64 commented 4 years ago

Merged master, tests pass.

greglook commented 4 years ago

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

drewinglis commented 4 years ago

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? :^)