From 2e3cd65b49b808ca15ea4ac4a1510fe44a00a254 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 1 Jan 2026 18:47:14 +0100 Subject: [PATCH] print relative paths on output --- src/Command/AnalyzeCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Command/AnalyzeCommand.php b/src/Command/AnalyzeCommand.php index c77a823a1..cb4fe4a1b 100644 --- a/src/Command/AnalyzeCommand.php +++ b/src/Command/AnalyzeCommand.php @@ -103,7 +103,9 @@ public function run(?string $projectDirectory = null, array $skip = []): int $this->outputPrinter->writeln(sprintf('%d) %s [id: [%s]]', $i, $allRuleError->getMessage(), $allRuleError->getIdentifier())); foreach ($allRuleError->getLineFilePaths() as $lineFilePath) { // compared to listing() this allow to make paths clickable in IDE - $this->outputPrinter->writeln($lineFilePath); + // use relative paths to getcwd() + $relativePath = str_replace(getcwd() . DIRECTORY_SEPARATOR, '', $lineFilePath); + $this->outputPrinter->writeln($relativePath); } $this->outputPrinter->newLine(2);