Skip to content

Commit

Permalink
Merge pull request #1336 from falkenhawk/patch-1
Browse files Browse the repository at this point in the history
fix messing the order of messages when posting to a git platform
  • Loading branch information
orta committed Nov 3, 2022
2 parents 0c8804f + 7b60e62 commit 639898f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions source/dsl/DangerResults.ts
Expand Up @@ -190,6 +190,9 @@ export function sortInlineResults(inlineResults: DangerInlineResults[]): DangerI

export function sortResults(results: DangerResults): DangerResults {
const sortByFile = (a: Violation, b: Violation): number => {
if (a.file === undefined && b.file === undefined) {
return 0;
}
if (a.file === undefined) {
return -1
}
Expand All @@ -198,10 +201,13 @@ export function sortResults(results: DangerResults): DangerResults {
}

if (a.file == b.file) {
if (a.line == undefined) {
if (a.line === undefined && b.line === undefined) {
return 0;
}
if (a.line === undefined) {
return -1
}
if (b.line == undefined) {
if (b.line === undefined) {
return 1
}

Expand Down

0 comments on commit 639898f

Please sign in to comment.