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

--diff outputs absolute paths #34

Closed
akaihola opened this issue Aug 4, 2020 · 0 comments · Fixed by #37
Closed

--diff outputs absolute paths #34

akaihola opened this issue Aug 4, 2020 · 0 comments · Fixed by #37
Assignees
Labels
bug Something isn't working
Milestone

Comments

@akaihola
Copy link
Owner

akaihola commented Aug 4, 2020

In #4, we added the --diff flag to mirror black --diff.

However, I now notice that while Black outputs paths relative to the current working directory, Darker now outputs absolute paths.

This might lead to incompatibilities with some tools which expect relative paths.

FYI @Carreau

$ black --check --diff --quiet src/darker/tests/test_black_diff.py
--- src/darker/tests/test_black_diff.py	2020-08-04 16:51:03.924124 +0000
+++ src/darker/tests/test_black_diff.py	2020-08-04 16:56:28.621010 +0000
@@ -1,10 +1,10 @@
 from pathlib import Path
 
 import pytest
 
-from  darker.black_diff import BlackArgs, read_black_config, run_black
+from darker.black_diff import BlackArgs, read_black_config, run_black
 
 
 @pytest.mark.parametrize(
     "config_path, config_lines, expect",
     [
$ darker --diff --quiet src/darker/tests/test_black_diff.py     
--- /home/akaihola/prg/darker/src/darker/tests/test_black_diff.py
+++ /home/akaihola/prg/darker/src/darker/tests/test_black_diff.py
@@ -2,7 +2,7 @@

 
 import pytest
 
-from  darker.black_diff import BlackArgs, read_black_config, run_black
+from darker.black_diff import BlackArgs, read_black_config, run_black
 
 
 @pytest.mark.parametrize(
akaihola added a commit that referenced this issue Aug 4, 2020
This is now similar to `black --diff`.

Fixes #34.
@akaihola akaihola added the bug Something isn't working label Aug 4, 2020
@akaihola akaihola added this to the 1.1.0 milestone Aug 4, 2020
akaihola added a commit that referenced this issue Aug 7, 2020
This is now similar to `black --diff`.

Fixes #34.
akaihola added a commit that referenced this issue Aug 7, 2020
Paths from `--diff` now relative to workdir (#34)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants