Skip to content

Commit

Permalink
Merge pull request #1 from npretto/external-id-fix
Browse files Browse the repository at this point in the history
adds index to annotation external_id to handle multiple errors of the…
  • Loading branch information
Michał Nykiel authored Apr 15, 2021
2 parents 99a4144 + e350550 commit f25eaf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ function generateReport(results) {
function generateAnnotations(results, reportId) {
return results.reduce((acc, result) => {
const relativePath = path.relative(process.cwd(), result.filePath);
return [...acc, ...result.messages.map(messageObject => {
return [...acc, ...result.messages.map((messageObject, i) => {
const { line, message, severity, ruleId } = messageObject;
const external_id = `${reportId}-${relativePath}-${line}-${ruleId}`;
const external_id = `${reportId}-${relativePath}-${line}-${ruleId}-${i}`;
return {
external_id,
line,
Expand Down

0 comments on commit f25eaf3

Please sign in to comment.