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

Add a ppx for snarky with_label #1362

Merged
merged 8 commits into from Dec 28, 2018
Merged

Add a ppx for snarky with_label #1362

merged 8 commits into from Dec 28, 2018

Conversation

mrmr1993
Copy link
Member

@mrmr1993 mrmr1993 commented Dec 21, 2018

This PR

  • adds [%with_label label], that expands to with_label (label ^ ": " ^ __LOC__)
  • adds let%snarkydef name arg = ..., that expands to let name arg = with_label ("name: " ^ __LOC__) ...
  • replaces the simplest cases (with_label __LOC__ at the top of a function definition) with let%snarkydef ... = ....
    • The diffs are overinflated by the formatter after this change; git diff -w (or here) gives a much more representative view of what is actually different.

Checklist:

  • Tests were added for the new behavior
  • All tests pass (CI will check this if you didn't)
  • Does this close issues? List them:

Copy link
Member

@imeckler imeckler left a comment

Choose a reason for hiding this comment

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

This is so cool!

@mrmr1993 mrmr1993 merged commit 775a434 into master Dec 28, 2018
@mrmr1993 mrmr1993 deleted the snarky-label-ppx branch January 9, 2019 17:24
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