Skip to content

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!

@bmwill
Copy link
Owner

bmwill commented Jan 29, 2025

Functionality for this was implemented in #37 and #36

@bmwill bmwill closed this Jan 29, 2025
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