pyan icon indicating copy to clipboard operation
pyan copied to clipboard

Different order for edges between different calls when several source files are provided

Open aurelg opened this issue 4 years ago • 0 comments

Thanks for this wonderful tool!

I noticed the order of edges in the output dot file is not reproducible between different calls when several source files are provided.

A quick fix would be to update writer.py:58 so that instead of:

for edge in self.graph.edges:

We had:

for edge in sorted(self.graph.edges, key=lambda x: (x.source.id, x.target.id)):

That would let us use pyan in a git precommit hook, as it would not introduce spurious and unnecessary changes in the git diff.

I can make the PR, just let me know.

aurelg avatar Sep 19 '21 05:09 aurelg