Skip to content

Commit

Permalink
Sort notices by line numbers in the summary report
Browse files Browse the repository at this point in the history
  • Loading branch information
clechasseur committed Aug 21, 2023
1 parent 71aaf31 commit 39ed071
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ ${this._stats.help} help`);

for (const [fileName, annotations] of Object.entries(this._annotations)) {
const content: string = annotations
.sort((a, b) => {
let cmp: number = a.beginLine - b.beginLine;
if (cmp === 0) {
cmp = a.endLine - b.endLine;
}
return cmp;
})
.map((annotation) => {
const linesMsg: string = CheckRunner.linesMsg(
annotation.beginLine,
Expand Down

0 comments on commit 39ed071

Please sign in to comment.