-
Notifications
You must be signed in to change notification settings - Fork 59
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
Feature request: GitHub markdown compatible diffs #325
Comments
I like the idea. Definitely something I want to look into. To be honest, I am not happy with the internal design in retrospect, because I originally setup the report output in a way that one can extend it with other output styles, but I think it needs a bit of a redesign. Maybe I take this idea as an incentive to just that. |
Faced a similar case with Gitlab commenting, would be very helpful to somehow configure that kind of behavior. |
I spent some time thinking about this and playing around with the code a bit and I think the Markdown report should be considered an extension/special case of a human readable report, as it will still be read by humans, but needs to follow some very specific requirements to fit the On Github there are 6 supported types of text in a diff codeblock Regular text
# comment style
@@ bold and pink @@
- Removal
+ Addition
! orange What they all have in common is, that the modifier needs to be at the beginning of the line, so the indendated output of the human report would need some changes. A quick check in Gitea/Forgejo and GitLab show, that they both don't differentiate between comment and regular text. So, while it's not really an option to support all those tools with a single Report style, creating one for GitHub should be possible, and maybe it's enough to replace the Based on this I did a quick try, to make the indentation for the Here is a comparison of an regular output, and my quick hack with just the indentation changed: https://gist.github.com/peschmae/15da258a2c6831aca691b5dc9bc691be For very simple changes, this already works, but a lot of cases (multiline, removal of a document, and a few more) aren't solved yet. I did one more try, where I prepended the whole addition/removal output with the corresponding sign, and removed the In #325 (comment) it's mentioned that the internal design of reports might be refactored, is that something that is ongoing, or should I give it a try, to implment a Markdown report based on the current HumanReport? |
Small feature request:
I'd like to include the output of
dyff
in a code block in a PR comment using GitHub markdown's diff formatter for colorized output:https://gist.github.com/salmedina/ad8bea4f46de97ea132f71b0bca73663#file-markdowndiffexample-md
But, presumably due to indentation,
dyff
diffs do not get colorized. Perhaps an option to skip indenting the diff would be useful for compatibility here.The text was updated successfully, but these errors were encountered: