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

Simplify check for symlinks that resolve outside root #4221

Merged
merged 3 commits into from
Feb 11, 2024

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Feb 11, 2024

This should not change any behaviour.

This would have made the #4015 / #4161 bug much more obvious. This makes a case where we resolve more explicit and prevent a resolved path from leaking out via the return.

This PR does not change any behaviour.

There have been 1-2 issues about symlinks recently. Both over and under
resolving can cause problems. This makes a case where we resolve more
explicit and prevent a resolved path from leaking out via the return.
@hauntsaninja hauntsaninja added the skip news Pull requests that don't need a changelog entry. label Feb 11, 2024
@hauntsaninja hauntsaninja changed the title Simplify normalize_path_maybe_ignore Simplify check for symlinks that resolve outside root Feb 11, 2024
@@ -780,7 +777,7 @@ def get_sources(
continue

if verbose:
out(f'Found input source: "{normalized_path}"', fg="blue")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use the value of normalized_path, we do sources.add(path), so no point logging it

Copy link

github-actions bot commented Feb 11, 2024

diff-shades reports zero changes comparing this PR (800afb3) to main (dab37a6).


What is this? | Workflow run | diff-shades documentation

tests/test_black.py Outdated Show resolved Hide resolved
@hauntsaninja hauntsaninja merged commit a201003 into psf:main Feb 11, 2024
46 checks passed
@hauntsaninja hauntsaninja deleted the normalise-simplify branch February 11, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news Pull requests that don't need a changelog entry.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants