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

Fix matching of absolute paths in --include #3976

Merged
merged 9 commits into from
Oct 27, 2023

Conversation

sth
Copy link
Contributor

@sth sth commented Oct 24, 2023

Description

This is a fix for #3975.

It modifies normalized_path in the way it was done before #3846, so that the check for included files still matches the same files.

Checklist - did you ...

  • Add an entry in CHANGES.md if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

@github-actions
Copy link

github-actions bot commented Oct 24, 2023

diff-shades reports zero changes comparing this PR (3cb0639) to main (7bfa35c).


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

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks for catching this and opening a PR! I think we should use root_relative_path on L396 , so we apply include logic before symlink resolution

@sth
Copy link
Contributor Author

sth commented Oct 26, 2023

I agree it makes sense to check include and exclude against the same type of path and not use resolved symlinks for one and unresolved symlinks for the other.

It now checks the path with unresolved symlinks against includes and excludes and the symlink target is not checked this way (but it is still checked if is under the root dir).

I also added is_dir and is_file to all the mocks in the symlink testcase, since if the items aren't files they won't be included no matter the name.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thank you!

@hauntsaninja hauntsaninja merged commit c369e44 into psf:main Oct 27, 2023
41 checks passed
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

Successfully merging this pull request may close these issues.

2 participants