Skip to content

Commit

Permalink
fixup! tools: add GitHub Action linter for pr-url
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Feb 7, 2021
1 parent ee36dac commit 66bbc97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/lint-pr-url.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

// Usage:
// git diff upstream/master HEAD -G"pr-url:" -- "*.md" | \
// git diff upstream/master...HEAD -G"pr-url:" -- "*.md" | \
// ./tools/lint-pr-url.mjs <expected-pr-url>

import process from 'node:process';
Expand All @@ -24,7 +24,7 @@ for await (const line of diff) {
currentFile = line.match(fileDelimiter)[1];
console.log(`Parsing changes in ${currentFile}.`);
} else if (changeDelimiter.test(line)) {
currentLine = Number(line.match(changeDelimiter)[1]) - 1;
currentLine = Number(line.match(changeDelimiter)[1]);
} else if (!validatePrUrl(line.match(prUrlDefinition)?.[1])) {
console.warn(
`::warning file=${currentFile},line=${currentLine++},col=${line.length}` +
Expand Down

0 comments on commit 66bbc97

Please sign in to comment.