Repository navigation
fix(cli): a missing root directory is shown as given when it is absolute - #14345
Conversation
…ute vimeo#13696 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Performance: unchanged · Types: unchanged
How to read this table
head 9e9ec7f · base c5f4dfd (merge-base) · workflow run |
orklah
left a comment
There was a problem hiding this comment.
Thanks! One change: symfony/filesystem is already a direct dependency, and Path::isAbsolute() does
exactly this check (it's used for the same idiom in src/Psalm/Config/Creator.php:273). The hand-written
test misses -r /does-not-exist on Windows, where DIRECTORY_SEPARATOR is \: the helper returns
Could not locate root directory C:\project\/does-not-exist.
public static function getRootDirectoryNotFoundMessage(string $current_dir, string $root): string
{
return 'Could not locate root directory '
. (Path::isAbsolute($root) ? $root : $current_dir . DIRECTORY_SEPARATOR . $root);
}(If Psalm then reports an impure call there, drop the @psalm-pure.)
…ute() vimeo#13696 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing slash is absolute on Windows too vimeo#13696 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@orklah thanks. I first switched to ( The Windows case you found is fixed in the hand-written check: a leading |
A nonexistent
-r/--rootpath is shown with the current directory prefixed, also when it is absolute.Before
After
vendor/bin/psalm -r /tmp/does-not-exist # Could not locate root directory /tmp/does-not-existFixes #13696