-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[#149] Make check and diff not mutually exclusive #155
Conversation
Pull Request Test Coverage Report for Build 266
💛 - Coveralls |
@@ -595,6 +595,15 @@ def test_write_cache_write_fail(self) -> None: | |||
mock.side_effect = OSError | |||
black.write_cache({}, []) | |||
|
|||
def test_check_diff_use_together(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating a temp file (which is slow), just run -the command on two existing files. I suggesttests/string_quotes.py
and tests/composition.py
. The former should return exit code 1, the latter should return exit code 0. The former should produce a diff, the latter should not produce a diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. Also realized a mistake on my part. Report can no longer be initiated with check=write_back is WriteBack.NO. Correcting that too and adding tests as suggested.
Thanks for your pull request! |
Also, added lambda argument delimiter skipping. Fixes #133
@ambv : Looks like an issue with github. Not reordering the commits after the change in the fork. Let me abandon this pull request and raise another for ease of review. |
No luck. Let me know if I need to do something to make it easier. |
Oh man, this PR now includes way more changes than you intended. You will probably want to create a new pull request, which will probably be faster for you than recovering from this mess. This time create a branch for your changes which will make rebasing easier and less error-prone. To not lose your changes, pipe |
Is there a MR for this? I'd like to use |
They're already available in the released version. https://github.com/psf/black/blob/master/README.md#installation-and-usage |
This change adds the ability to use both
--check
and--diff
together to see the proposed changes and adds a test to verify that these options can indeed be called together.