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

isort gets confused when working with git worktrees #2068

Open
mknaranja opened this issue Jan 6, 2023 · 1 comment
Open

isort gets confused when working with git worktrees #2068

mknaranja opened this issue Jan 6, 2023 · 1 comment

Comments

@mknaranja
Copy link

mknaranja commented Jan 6, 2023

If I work with git worktrees, isort (in the pre-commit hook) gets confused and identifies first party library code in the worktree as third party library.

I use

- repo: https://github.com/PyCQA/isort
  rev: 5.10.1
  hooks:
    - id: isort
      name: isort

What I do is:

git clone REPOSITORY.git
cd REPOSITORY
git worktree add ../REPOSITORY_WORKTREE BRANCH_WORKTREE
cd ../REPOSITORY_WORKTREE
pre-commit run --all

What it then does from:

import THIRDPARTY

import OWNCODE

when I run pre-commit run --all is:

import OWNCODE
import THIRDPARTY

or

import THIRDPARTY
import OWNCODE
@mknaranja
Copy link
Author

Any ideas on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant