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

Argument --check does not work together with --diff #58

Closed
lieser opened this issue Feb 14, 2025 · 1 comment
Closed

Argument --check does not work together with --diff #58

lieser opened this issue Feb 14, 2025 · 1 comment

Comments

@lieser
Copy link

lieser commented Feb 14, 2025

In a CI I want to both check that the formatting is correct (via return value from gersemi) and if it failed show the wrong formatting.

Both the --check and --diff arguments do part of what I want, but if I try to combine them gersemi seems to ignore the --check and always returns 0.

One can of course easily workaround this by simple calling gersemi twice, but still would be nice if one could coming both arguments and only do one call.

@BlankSpruce
Copy link
Owner

Fixed in 0.19.1. I've modeled --diff after black but I wasn't aware it's possible to use it with --check at the same time.

It's also worth noting that somewhat similar behaviour is possible with pre-commit's --show-diff-on-failure but I'm not that familiar with it so your mileage may vary.

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

No branches or pull requests

2 participants