[red-knot] Early return from project.is_file_open for vendored files#17580
Merged
MichaReiser merged 1 commit intomainfrom Apr 23, 2025
Merged
[red-knot] Early return from project.is_file_open for vendored files#17580MichaReiser merged 1 commit intomainfrom
project.is_file_open for vendored files#17580MichaReiser merged 1 commit intomainfrom
Conversation
Contributor
|
b686041 to
d29822f
Compare
AlexWaygood
reviewed
Apr 23, 2025
d29822f to
dfc8544
Compare
AlexWaygood
approved these changes
Apr 23, 2025
project.is_file_openproject.is_file_open for vendored files
dcreager
added a commit
that referenced
this pull request
Apr 23, 2025
…tructor * origin/main: [red-knot] Trust module-level undeclared symbols in stubs (#17577) [`airflow`] Apply auto fixes to cases where the names have changed in Airflow 3 (`AIR301`) (#17355) [`pycodestyle`] Auto-fix redundant boolean comparison (`E712`) (#17090) [red-knot] Detect semantic syntax errors (#17463) Fix stale diagnostics in Ruff playground (#17583) [red-knot] Early return from `project.is_file_open` for vendored files (#17580)
dcreager
added a commit
that referenced
this pull request
Apr 23, 2025
…var-instance * dcreager/generic-constructor: Revert FunctionLiteral type [red-knot] Trust module-level undeclared symbols in stubs (#17577) [`airflow`] Apply auto fixes to cases where the names have changed in Airflow 3 (`AIR301`) (#17355) [`pycodestyle`] Auto-fix redundant boolean comparison (`E712`) (#17090) Clean this up a bit clippy [red-knot] Detect semantic syntax errors (#17463) Fix stale diagnostics in Ruff playground (#17583) [red-knot] Early return from `project.is_file_open` for vendored files (#17580)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is partially addresses astral-sh/ty#114
It avoids reading
filesoropen_file_set, which both have low durability for typeshed files. This prevents downgrading typeshed queries to durability low if we happen to emit a diagnostic in them.Ideally, we'd also short-circuit for third-party files but it's less clear to me how we would do that while supporting open-file-set (we could check the
included_paths). That's why I decided to only optimize this for typeshed for now.The incremental benchmarks improve by 2% which suggests that we try to emit diagnostics for at least some typeshed files.