bmwill / diffy

Tools for finding and manipulating differences between files
Apache License 2.0
75 stars 22 forks source link

Additional api #11

Open rjuju opened 3 years ago

rjuju commented 3 years ago

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!

wtachau commented 2 years ago

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