Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
codestergit committed Apr 17, 2018
1 parent 554e9e8 commit 6d416f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/dsl/DangerResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export function sortResults(results: DangerResults): DangerResults {
}
}

export function isEmpty(results: DangerResults): boolean {
export function isEmptyResults(results: DangerResults): boolean {
return [...results.fails, ...results.warnings, ...results.messages, ...results.markdowns].length === 0
}

Expand Down
6 changes: 3 additions & 3 deletions source/dsl/_tests/DangerResults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
regularResults,
sortInlineResults,
validateResults,
isEmpty,
isEmptyResults,
} from "../DangerResults"
import {
singleViolationSingleFileResults,
Expand Down Expand Up @@ -92,13 +92,13 @@ describe("DangerResults operations", () => {
})

it("find empty results", () => {
const result = isEmpty(emptyDangerResults)
const result = isEmptyResults(emptyDangerResults)

expect(result).toEqual(true)
})

it("find empty results", () => {
const result = isEmpty(multipleViolationSingleFileResults)
const result = isEmptyResults(multipleViolationSingleFileResults)

expect(result).toEqual(false)
})
Expand Down
4 changes: 2 additions & 2 deletions source/runner/Executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
sortResults,
sortInlineResults,
validateResults,
isEmpty,
isEmptyResults,
} from "../dsl/DangerResults"
import {
template as githubResultsTemplate,
Expand Down Expand Up @@ -236,7 +236,7 @@ export class Executor {
const mergedResults = sortResults(mergeResults(regular, inlineLeftovers))

// If danger have no comments other than inline to update. Just delete previous main comment.
if (isEmpty(mergedResults)) {
if (isEmptyResults(mergedResults)) {
this.platform.deleteMainComment(dangerID)
} else {
const comment = process.env["DANGER_BITBUCKETSERVER_HOST"]
Expand Down

0 comments on commit 6d416f2

Please sign in to comment.