-
-
Notifications
You must be signed in to change notification settings - Fork 574
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
extend_skip is not honored wit a git submodule when skip_gitignore=true #1777
Comments
Hi @pums974, Thanks for splitting up a separate issue! From my own testing here it appears that this is an aesthetic issue only? And it still works (minus the extra output of I'm trying to think about the best way to handle this, and I think that distinction is likely very important, because if it's only that it is producing extra command line output, the best thing may be to simply silent that output within isort. While I understand what you expect to happen, because of how this is currently enabled, it simply can't take into account your other skips. To be performant the skip git ignore is running separately against your code base from the other ignores, and collecting the list of files and paths to ignore all at once from git's perspective. Then as it decides one file at a time to process or skip, it does fully take into account any skips you have set up, and will still skip files correctly. |
Hi, I suppose you are right, it does it's job correctly. But it is very slow. with
with
|
I ran into this when upgrading from isort 5.8.0 to 5.9.2. isort became very slow, taking over 10 minutes to complete with
@timothycrosley Unfortunately it is more than aesthetic since it prevents $ git init demo
$ cd demo
$ touch foo.py bar.py
$ echo foo.py > .gitignore
$ isort --vn
5.9.2
# without a submodule present isort correctly skips foo.py since it is in .gitignore
$ isort --show-files --skip-gitignore .
./bar.py
# with a submodule present isort incorrectly checks foo.py despite it being in .gitignore
$ git submodule add https://github.com/PyCQA/meta.git # could be any repo
$ isort --show-files --skip-gitignore .
fatal: Pathspec '/Users/robbie/demo/meta/LICENSE' is in submodule 'meta'
fatal: Pathspec '/Users/robbie/demo/meta/LICENSE' is in submodule 'meta'
./bar.py
fatal: Pathspec '/Users/robbie/demo/meta/LICENSE' is in submodule 'meta'
./foo.py # <--------- this shouldn't appear here since it is in .gitignore
./meta/source/conf.py In v5.8.0 isort would correctly skip |
Seems fixed indeed. Thanks ! |
Hi,
With the version 5.9.2, when
skip_gitignore=True
, I have the error:fatal: Pathspec '/some/path/other_project/setup.py' is in submodule 'other_project
where
other_project
is a git submodule, not in.gitignore
but in extend_skipIf I turn off skip_gitignore, everything seems to be working fine.
`isort . --show-config`:
`pyproject.toml`:
Originally posted by @pums974 in #1762 (comment)
The text was updated successfully, but these errors were encountered: