[ty] Make FileResolver::path return a full path by ntBre · Pull Request #20550 · astral-sh/ruff (original) (raw)
Fixes astral-sh/ty#1242.
From finding references with the LSP, FileResolver::path is only called once,
in UnifiedFile::path, so I went through those references, and it looked safe
to make this change in every case. Most of the references are in the various
output formats, where we inherited the absolute vs relative path decision from
Ruff. Two other uses are as fallbacks if converting a relativized path to a
string fails. Finally, we use the path for sorting and in
UnifiedFile::relative_path.
Existing tests, with snapshots updated to show absolute paths (in the TestDb
this just added a / in front of the file names). I also updated the GitLab CLI
test to set the CI_PROJECT_DIR environment variable and ran a test in GitLab
CI:
ntBre marked this pull request as ready for review
Something isn't working
Multi-file analysis & type inference
labels
ntBre deleted the brent/fix-ty-gitlab-diagnostics branch
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
[ Show hidden characters]({{ revealButtonHref }})