You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
isort commit hook behaving differently in integrated terminal and source control panel #9948
# b.pyimporttensorflowastf# any 3rd party importfromaimporta
Install isort commit hook via pre-commit install.
Attempt to commit b.py via VS Code's source control panel. isort will abort the commit and make changes to the file, removing the line between the local and 3rd party import. Committing from the integrated terminal via git add b.py && git commit -m foo works just fine.
Expected behaviour
Committing in source control panel should work just like from the command line.
Cause
I think this might be due to VS Code invoking isort without access to the environment of installed packages. isort therefore thinks import tensorflow as tf references another local module like a.py and imports of the same type shouldn't be separated by blank lines.
Sadly the extension doesn't control how commit hooks are executed within the source control panel, so your best bet would be to file this issue directly against VS Code.
Activity
kimadeline commentedon Feb 6, 2020
Hi Janosh Riebesell (@janosh) 👋 Thank you for reporting this issue.
Sadly the extension doesn't control how commit hooks are executed within the source control panel, so your best bet would be to file this issue directly against VS Code.
Thank you!
janosh commentedon Feb 6, 2020
Could you transfer this issue there?
kimadeline commentedon Feb 6, 2020
No, we don't have these permissions for the microsoft/vscode repo.