Skip to content
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

Simplify pretty_print_contract and introduce newline between contract heads #4

Merged
merged 3 commits into from
Aug 21, 2018

Conversation

evnu
Copy link
Contributor

@evnu evnu commented Aug 21, 2018

This merge request simplifies pretty_print_contract/1,3 by reducing the case without multiple contracts/heads to the case of multiple contracts. It then adds a newline to separate multiple contracts.

Fix #3.

lib/erlex.ex Outdated

head =
head =
if tail != [] do
Copy link
Owner

Choose a reason for hiding this comment

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

Can you flip these clauses so this is a positive conditional?

Copy link
Owner

Choose a reason for hiding this comment

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

Actually case is probably more expressive here.

Copy link
Owner

Choose a reason for hiding this comment

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

Either case or Enum.empty?/1. Both are fine to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done with 1f8c75e.

@asummers
Copy link
Owner

This looks good after that one minor comment. I'll get this merged and deployed to Hex later this evening. Thanks for taking care of this!

@asummers
Copy link
Owner

Curious why circle didn't run... I'll have to look into that.

@asummers asummers merged commit cdd8caa into asummers:master Aug 21, 2018
@evnu evnu deleted the simplify-and-prettify branch August 27, 2018 19:31
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.

None yet

2 participants