Skip to content

Commit

Permalink
refactor: set endline to startline for annotations to keep at top
Browse files Browse the repository at this point in the history
  • Loading branch information
graza-io committed Aug 24, 2023
1 parent 1c39496 commit da5aacd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/annotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,10 @@ function getAnnotationsForControl(controlRun) {

const match = (dim.value || "").match(regex);
if (match) {
console.log("regex match: " + (dim.value || ""));
const fileName = match[1];
const startLine = parseInt(match[2]);
const endLine = match[3] ? parseInt(match[3]) : startLine;
console.log(fileName.replace(process.cwd() + "/", "") + " - " + startLine + " - " + endLine)
const endLine = startLine // match[3] ? parseInt(match[3]) : startLine;
// NOTE: Setting endLine moves the annotations to the end line rather than the start line, so set to startLine for now.
annotations.push({
path: fileName.replace(process.cwd() + "/", ""),
start_line: parseInt(startLine),
Expand Down

0 comments on commit da5aacd

Please sign in to comment.