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
# 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.
The text was updated successfully, but these errors were encountered:
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.
Steps to reproduce
Create a repo and install
pre-commit
git init && pip install pre-commit
Create 3 files.
containing
Install
isort
commit hook viapre-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 viagit 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 thinksimport tensorflow as tf
references another local module likea.py
and imports of the same type shouldn't be separated by blank lines.The text was updated successfully, but these errors were encountered: