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

[ENH] Add --diff option to show diff when running with --check #381

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

Conversation

tdgroot
Copy link

@tdgroot tdgroot commented Jan 26, 2023

We use mdformat to validate Markdown formatting in a documentation project we're running. Most users are contributing to the documentation by creating changes, commits and pull requests from the Github UI, so they won't be running any linting/validation on commit. In this case, it would be very useful for those users to see what mdformat is marking as "unformatted" and knowing what should be done to fix that.

This was highly inspired by the implementation that Black uses, as it seems to doing just what we need.

Looking forward to your thoughts and review :).

@welcome
Copy link

welcome bot commented Jan 26, 2023

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

@AlexanderGrooff
Copy link

Would be great to have this feature! 🚀

@tdgroot tdgroot changed the title Add --diff option to show diff when running with --check [ENH] Add --diff option to show diff when running with --check Oct 6, 2023
@tdgroot
Copy link
Author

tdgroot commented Oct 6, 2023

@hukkin any chance to get a review for this PR? :)

@hukkin
Copy link
Owner

hukkin commented Oct 15, 2024

Hi @tdgroot, thanks for contributing and sorry for the long wait!

Most users are contributing to the documentation by creating changes, commits and pull requests from the Github UI, so they won't be running any linting/validation on commit. In this case, it would be very useful for those users to see what mdformat is marking as "unformatted" and knowing what should be done to fix that.

I think you may find setting mdformat up with https://pre-commit.ci/ and pre-commit even more useful than this feature. The fixes would be automatically applied to PRs -> the contributor doesn't have to care about failures or bad formatting at all.

Regardless, I've decided to accept this feature. Do you still want to work on this or should I continue from where you left?

We should make --diff work also without --check, returning 0 also in the case there is a diff. Also mypy compains, and test coverage is not 100%.

@hukkin
Copy link
Owner

hukkin commented Oct 15, 2024

Closes #268

@tdgroot
Copy link
Author

tdgroot commented Oct 15, 2024

Hi @hukkin,

That's amazing! I'm not available to work on it this week, but I can update this PR next week I think. If that's taking too long for you, feel free to take my work and finish it :).

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