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);