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
"--dry-run" flag #197
Comments
Is this really needed? You can test by undoing file changes with
I'm concerned because “dry run” can mean a lot of things. Future users might expect it to output the changed file, or the diff. This feels a little like feature bloat when all the “undo changes”/diff/etc. functionality can be achieve with Git. |
If I run
Repeat until After the manual changes are committed, run Full context: django/django#16261 (comment) That would make review easier for that PR. And reviewers would be able to tell whether it's a manual change or a change by blacken-docs. I understand your concerns about the name "--dry-run". But I couldn't come up with a better name. I don't think "--fake" is a good name, for example. Any ideas? |
I think you can do this:
My concern is not about the name, it’s about how these features tend towards scope creep. Whatever we would call the option future requests to pile on more “dry run” functionality might seem reasonable (show the diff, count of files changed, ...). I find it a bit wasteful for every code formatting tool to add dry run mode, and other common features like directory recursion support, ignore file support, etc., when there are ways to achieve the same by combining tools (the Unix philosophy). |
Thanks @adamchainz ! I'll try using the flow you suggested (in the coming days). I agree about scope creep and that "less is more". So I'll close this issue. And ping you again in case the flow you suggested does not work. |
@adamchainz I tried the flow. In step 3:
The only to verify a file is fixed is by running This mixes my manual changes to "fix" the file with the changes by the command itself. I need to have the command verify the file is fixed without the command further changing the file. Is there a way to do this? That's why I had opened #198 |
I think this workflow would work? You can always add more commits with Git...
|
Yeah it works @adamchainz thanks. It's just that it's more work. But this should be a "one time" effort with the docs that "do not pass" yet. So it's not worth bloating blacken-docs with another argument. Thanks again! |
Let's say I need to "blacken docs" for a large project, case in point django/django#16261
It would be useful to separate commits into two:
blacken-docs
command to work without errors.blacken-docs
.I.e. Part of what @carltongibson suggested here django/django#16261 (comment)
So this issue is about allowing the user to add a
-D
or--dry-run
flag to the current command. This would prevent the command from changing files.The text was updated successfully, but these errors were encountered: