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

darker does not format in VSCode, if isort is enabled #488

Closed
strzonnek opened this issue Mar 30, 2023 · 2 comments
Closed

darker does not format in VSCode, if isort is enabled #488

strzonnek opened this issue Mar 30, 2023 · 2 comments
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@strzonnek
Copy link

strzonnek commented Mar 30, 2023

Describe the bug
Using VSCode format-on-save with isort, the saved file won't be changed.
Without isort, it works as expected

To Reproduce
Steps to reproduce the behavior:
using the following settings in VSCode

  "python.formatting.provider": "black",
  "python.formatting.blackPath": "darker",
  "python.formatting.blackArgs": [
    "--diff",
    //"--isort",
    "--line-length",
    "120"
  ],

simple code for testing the behaviour:

def do_it( arg ):
    print( "test" )

should result into

def do_it(arg):
    print("test")

If --isort is enabled, neither the extra whitespace in brackets are deleted, nor the imports are sorted.
If --isort is disabled, the extra whitespace in brackets are deleted, as expected

Expected behavior
formatting should work, with --isort enabled

Environment (please complete the following information):

  • OS: macos
  • Python version 3.7.10
  • Git version 2.20.1
  • Darker version 1.7.1
  • Black version 23.3.0
  • other reformatter and linter versions isort 4.3.21
@akaihola
Copy link
Owner

akaihola commented Apr 1, 2023

Hi @strzonnek, thanks for the report!

I wonder if there's a way to see Darker terminal output in VSCode? Maybe that would reveal the problem, and if not, maybe adding -v or -vv would tell us more?

@akaihola akaihola added the bug Something isn't working label Apr 1, 2023
@akaihola akaihola added this to the Darker 1.7.2 milestone Apr 1, 2023
@akaihola akaihola added the question Further information is requested label Apr 1, 2023
@strzonnek
Copy link
Author

@akaihola I cannot reproduce it anymore. I updated VSCode, then the issue disappeared, I went back to the old VSCode version, but the issue did not come back anymore.
So, I close this issue and open a new one, if I face it again.
Thanks for your support, Stephan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Development

No branches or pull requests

2 participants