Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Github Actions output
Fixes #2678
- Loading branch information
Showing
5 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
namespace Psalm\Report; | ||
|
||
use Psalm\Config; | ||
use Psalm\Report; | ||
use function sprintf; | ||
|
||
class GithubActionsReport extends Report | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function create(): string | ||
{ | ||
$output = ''; | ||
foreach ($this->issues_data as $issue_data) { | ||
$output .= sprintf( | ||
'::%s file=%s,line=%s,col=%s::%s', | ||
($issue_data['severity'] === Config::REPORT_ERROR ? 'error' : 'warning'), | ||
$issue_data['file_name'], | ||
$issue_data['line_from'], | ||
$issue_data['column_from'], | ||
$issue_data['message'] | ||
) . "\n"; | ||
} | ||
|
||
return $output; | ||
} | ||
} |
This file contains 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