-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Force Exclude does not work with symlinks #3826
Comments
Hi, Thank you for the update, I just tried it using @JelleZijlstra could you please reopen this ticket? Thank you |
@hauntsaninja or @JelleZijlstra little bump on reopening this. Thank you!! 😄 |
Thanks, I think this will be fixed once we deduplicate |
The problem in the concrete test case (and why it's not affected by #3846) is likely that the symlinked file is given explicitly on the command line and the command line parameters are separately normalized and checked against excludes: Lines 642 to 660 in f7174bf
Probably this code should be adjusted the same way as the code in |
Describe the bug
I use the
force-exclude
feature to exclude files living in symlinked directories.However, it looks like
black
uses the regexp fromforce-exclude
after the symlink is resolved (not the symlinked path).The resulting error is:
It should have ignored the file based on this path
/path_2_file/application/api/lib/dir_symlinked/__init__.py
rather than including it based on this pathapplication/lib/ref_dir/__init__.py
.Said differently it used the resolved/resulting path rather than the path through the symlink
Environment
Additional context
I would be equally happy if I could simply tell
black
not to follow symlinks.Thank you in advance for your help!
The text was updated successfully, but these errors were encountered: