Skip to content

Conversation

@tobiasmaier
Copy link

Reverse arrow directions as discussed in #8

@coveralls
Copy link

coveralls commented Jan 23, 2019

Coverage Status

Coverage decreased (-1.2%) to 84.767% when pulling b6097ff on tobiasmaier:feature/reverse-arrows into ca4f9c0 on thebjorn:master.

Copy link
Owner

@thebjorn thebjorn left a comment

Choose a reason for hiding this comment

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

Thank you very much for the PR. I've made a couple of suggestions. If you can fix those then I'll merge it immediately.

pydeps/cli.py Outdated
p.add_argument('--show-deps', action='store_true', help="show output of dependency analysis")
p.add_argument('--show-raw-deps', action='store_true', help="show output of dependency analysis before removing skips")
p.add_argument('--show-dot', action='store_true', help="show output of dot conversion")
p.add_argument('--reverse', action='store_true', help="draw arrows in direction of dependency")
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
p.add_argument('--reverse', action='store_true', help="draw arrows in direction of dependency")
p.add_argument('--reverse', action='store_true', help="draw arrows to (instead of from) imported modules")

Copy link
Author

Choose a reason for hiding this comment

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

I changed it and added to the readme

self.name = kw.get('name', 'G')
self.fillcolor = kw.get('fillcolor', '#ffffff')
self.fontcolor = kw.get('fontcolor', '#000000')
self.rankdir = kw.get('rankdir', 'TB' if not self.reverse else 'BT')
Copy link
Owner

Choose a reason for hiding this comment

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

I appreciate that you're trying to kkep the non-reverse case the default, but this reads better if you reverse the logic

Suggested change
self.rankdir = kw.get('rankdir', 'TB' if not self.reverse else 'BT')
self.rankdir = kw.get('rankdir', 'BT' if self.reverse else 'TB')

Copy link
Author

Choose a reason for hiding this comment

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

I also changed this, in addition there is now also a test for it.

@thebjorn thebjorn merged commit f8c56f3 into thebjorn:master Jan 23, 2019
@thebjorn
Copy link
Owner

Thanks for the PR. It's now released on PyPI as version 1.7.0.

@tobiasmaier tobiasmaier deleted the feature/reverse-arrows branch February 19, 2019 11:02
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.

3 participants