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

Vscode instructions don't work on OSX #67

Closed
virtuald opened this issue Aug 30, 2020 · 8 comments
Closed

Vscode instructions don't work on OSX #67

virtuald opened this issue Aug 30, 2020 · 8 comments
Assignees
Labels
bug Something isn't working maybe invalid? Can't reproduce, or seems already fixed, or need more information question Further information is requested
Milestone

Comments

@virtuald
Copy link

  • VSCode 1.48.2
  • Darker 1.1.0
  • Black 20.8b1
  • Python 3.7.3
  • Python extension 2020.8.105045

Workspace settings:

    "python.formatting.provider": "black",
    "python.formatting.blackPath": "/home/virtuald/.virtualenvs/frc-2020/bin/darker",
    "python.formatting.blackArgs": [
        "--diff"
    ],
    "editor.formatOnSave": true,

In the output section it does look like it's running darker, but nothing happens (and there's an extra diff -- I tried removing it and it didn't fix it):

> ~/.virtualenvs/frc-2020/bin/darker --diff --diff --quiet ~/dev/frc/test/test.py.5653cc201affb899ab4952d1f891988b.tmp
cwd: ~/dev/frc/test

Changing the formatter to the original black executable does formatting as one would expect.

@akaihola akaihola added the bug Something isn't working label Sep 2, 2020
@akaihola
Copy link
Owner

akaihola commented Sep 2, 2020

@Carreau could you look at this issue – is there an incompatibility or a mistake in our instructions?

Maybe darker doesn't like the fact that the file name ends with .tmp instead of .py?

@shangxiao
Copy link
Contributor

shangxiao commented Oct 8, 2020

I noticed this issue as well… but only for files that you open "directly". If you open a folder, then open a file it works. Forgive me as I'm not a VS Code user but I just wanted to report that it does indeed 1/2 work.

I examined the output of darker --diff vs black --diff and I wonder whether it's because black seems to report the patch with absolute paths whereas darker used relative paths? 🤔

Another thing: I noticed that (somewhat obviously perhaps?) that it only formats after the file is saved?

For me:

  • MacOS 10.15.7
  • VSCode 1.49.3
  • Darker 1.2.0
  • Black 20.8b1
  • Python 3.8.5

@akaihola
Copy link
Owner

akaihola commented Oct 8, 2020

black seems to report the patch with absolute paths whereas darker used relative paths

@shangxiao if I create a branch which changes Darker to report absolute paths, would you be willing to test it with VS Code?

@akaihola
Copy link
Owner

akaihola commented Oct 8, 2020

I examined the output of darker --diff vs black --diff and I wonder whether it's because black seems to report the patch with absolute paths

@shangxiao I tried black --diff with Black 20.8b1, and I see only relative paths. Do you have a different version?

@akaihola
Copy link
Owner

akaihola commented Oct 8, 2020

@shangxiao other differences between Black and Darker --diff output:

  • Black displays five lines of context, Darker only three
  • Black includes file modification timestamps on the --- and +++ lines, Darker doesn't

Those I could also try enabling in a branch so they could be tested with VS Code.

@akaihola
Copy link
Owner

akaihola commented Oct 9, 2020

@virtuald @shangxiao @Carreau you could try whether #84 makes any difference for VS Code.

@akaihola akaihola added this to the 1.3.1 milestone Sep 4, 2021
@akaihola akaihola added the question Further information is requested label Sep 4, 2021
@akaihola
Copy link
Owner

akaihola commented Sep 6, 2021

I wonder if this is the same issue as #104, and whether it still happens with Darker 1.3.0.

@akaihola akaihola added the maybe invalid? Can't reproduce, or seems already fixed, or need more information label Sep 10, 2021
@akaihola akaihola modified the milestones: 1.3.1, 1.3.2 Sep 12, 2021
@akaihola akaihola modified the milestones: 1.3.2, 1.4.0, 1.4.1 Oct 28, 2021
@akaihola
Copy link
Owner

I'll assign this to the 1.4.2 release, but since there haven't been more complaints about this since the 1.3.0 release, I think by end of February I'll conclude this isn't an issue anymore and close the issue.

@akaihola akaihola modified the milestones: 1.4.1, 1.4.2 Feb 14, 2022
@akaihola akaihola closed this as completed Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working maybe invalid? Can't reproduce, or seems already fixed, or need more information question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants