From 2d17b744cee1cdeb3eb6788fcd90b373107e7271 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 3 Jan 2021 02:45:21 +0100 Subject: [PATCH] SARIF report: Include help links (#4924) --- src/Psalm/Report/SarifReport.php | 2 ++ tests/ReportOutputTest.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/Psalm/Report/SarifReport.php b/src/Psalm/Report/SarifReport.php index 286e98e14..cc222f7b9 100644 --- a/src/Psalm/Report/SarifReport.php +++ b/src/Psalm/Report/SarifReport.php @@ -23,6 +23,7 @@ class SarifReport extends Report 'tool' => [ 'driver' => [ 'name' => 'Psalm', + 'informationUri' => 'https://psalm.dev', 'version' => PSALM_VERSION, ], ], @@ -45,6 +46,7 @@ class SarifReport extends Report (\substr($issue_data->type, 0, 7) === 'Tainted') ? 'security' : 'maintainability', ], ], + 'helpUri' => $issue_data->link, ]; $markdown_documentation_path = __DIR__ . '/../../../docs/running_psalm/issues/' . $issue_data->type . '.md'; diff --git a/tests/ReportOutputTest.php b/tests/ReportOutputTest.php index cf6260f1e..4a70734eb 100644 --- a/tests/ReportOutputTest.php +++ b/tests/ReportOutputTest.php @@ -98,6 +98,7 @@ echo "Successfully executed the command: " . $prefixedData;'; 'tool' => [ 'driver' => [ 'name' => 'Psalm', + 'informationUri' => 'https://psalm.dev', 'version' => '2.0.0', 'rules' => [ [ @@ -111,6 +112,7 @@ echo "Successfully executed the command: " . $prefixedData;'; 'security' ], ], + 'helpUri' => 'https://psalm.dev/246', 'help' => [ 'markdown' => file_get_contents(__DIR__ . '/../docs/running_psalm/issues/TaintedShell.md'), 'text' => file_get_contents(__DIR__ . '/../docs/running_psalm/issues/TaintedShell.md'), @@ -127,6 +129,7 @@ echo "Successfully executed the command: " . $prefixedData;'; 'security' ], ], + 'helpUri' => 'https://psalm.dev/245', 'help' => [ 'markdown' => file_get_contents(__DIR__ . '/../docs/running_psalm/issues/TaintedHtml.md'), 'text' => file_get_contents(__DIR__ . '/../docs/running_psalm/issues/TaintedHtml.md'),