8000 Fix GitHub output (#10) · symfony-tools/code-block-checker@97fd27b · GitHub
[go: up one dir, main page]

Skip to content

Commit 97fd27b

Browse files
authored
Fix GitHub output (#10)
* Fixed Github output * cs
1 parent 628f5bc commit 97fd27b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Command/CheckDocsCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
107107
foreach ($issues as $issue) {
108108
$this->io->writeln($issue->__toString());
109109
}
110+
111+
$this->io->error(sprintf('Build completed with %s errors', $issueCount));
110112
} elseif ('github' === $format) {
111113
foreach ($issues as $issue) {
112-
$this->io->writeln(sprintf('::error file=%s,line=%s::[%s] %s', $issue->getFile(), $issue->getLine(), $issue->getType(), $issue->getText()));
114+
$this->io->writeln(sprintf('::error file=%s.rst,line=%s::[%s] %s', $issue->getFile(), $issue->getLine(), $issue->getType(), $issue->getText()));
113115
}
114116
}
115117

116-
$this->io->error(sprintf('Build completed with %s errors', $issueCount));
117-
118118
return Command::FAILURE;
119119
}
120120
$this->io->success('Build completed successfully!');

src/Issue/Issue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Issue implements \Stringable
3131
public function __construct(CodeNode $node, string $text, string $type, string $file, int $localLine)
3232
{
3333
$this->node = $node;
34-
$this->text = $text;
34+
$this->text = trim($text);
3535
$this->type = $type;
3636
$this->file = $file;
3737
$this->localLine = $localLine;

0 commit comments

Comments
 (0)
0