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

Additional api #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Additional api #11

wants to merge 2 commits into from

Conversation

rjuju
Copy link

@rjuju rjuju commented Jul 11, 2021

Hi,

First of all, thanks a lot for writing diffy. I appreciate this this tool a lot!

I started using it and I miss the ability to specify the original and modified filename, and the ability to avoid outputting the "\ No newline at end of file" message, so here are two patches for that.

Note that I chose to add custom code rather than using the assert_patch! macro for the newline patch. Constructing a Patch from the representation obviously leads to a different content and it didn't seem worth the trouble to complicate the macro to handle a PatchFormatter and skip those tests when the option is set. I'm also not entirely happy with the without_missing_newline_message name, but didn't find anything better.

For the custom file names, I didn't do anything with the MergeOptions as mentioned in your original issue, as it wasn't clear to me how file names would interact there.

Let me know if there's any problem with those patches or if you'd like any change!

rjuju added 2 commits July 11, 2021 12:34
Setting this option will prevent emitting "\ No newline at end of file"
messages.

Fixes: bmwill#8
@wtachau
Copy link

wtachau commented Apr 20, 2022

👋 Hi there, any update on this? Would love to use these features as well!

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.

2 participants