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

[red-knot] Fix file watching for new non-project files #16395

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Feb 26, 2025

Summary

This PR fixes a bug in Red Knot's file watching where a new
non-project file (a file created outside the project's root) was
incorrectly considered as being part of the project.

Testing whether the new file's path starts with the project's root path is sufficient because neither Ruff nor Red Knot follow symlinks when traversing
the project's directory tree.

Test Plan

Added file watching test

@MichaReiser MichaReiser added the red-knot Multi-file analysis & type inference label Feb 26, 2025
@MichaReiser MichaReiser force-pushed the micha/fix-non-project-files branch from 44a53b7 to 4beb327 Compare February 26, 2025 14:04
Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Makes sense!

@MichaReiser MichaReiser merged commit ea3245b into main Feb 26, 2025
21 checks passed
@MichaReiser MichaReiser deleted the micha/fix-non-project-files branch February 26, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants