Fix __unknown__ module names for files without a config#4136
Conversation
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
|
@kinto0 has imported this pull request. If you are a Meta employee, you can view this in D111830464. |
stroxler
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
connernilsen
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
one more question (and an alternate approach suggestion): what project doesn't work with coverage? I expect projects that don't work on coverage to also have name issues with We wanted to keep If we find that this is an issue in coverage and not check, I'd like to limit this change to |
Summary
CLI handles were named without checking the config's
fallback_search_path, so in a directory without a config every file was__unknown__, and no symbol FQN could match the public FQNs inpyrefly coverage {check, report} --public-only.ConfigFile::handle_from_module_pathnow applies its ownfallback_search_path(i.e. what the LSP already did), so thathandle_from_module_path_with_fallbackis now no longer needed.Fixes #4132
Test Plan
Regression test added, and verified that
pyrefly coverage check --public-onlyin a directory without pyrefly config now reports the same as without--public-only.