Skip to content

Commit

Permalink
Revert unrelated formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarBarrett committed Aug 23, 2022
1 parent d015c09 commit 8dd9fd8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
18 changes: 8 additions & 10 deletions source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts
Expand Up @@ -219,22 +219,20 @@ export class BitBucketCloudAPI {
const dangerIDMessage = dangerIDToString(dangerID)

return comments
.filter((comment) => comment.inline == null)
.filter((comment) => comment.content.raw.includes(dangerIDMessage))
.filter((comment) => comment.user.uuid === this.uuid)
.filter(comment => comment.inline == null)
.filter(comment => comment.content.raw.includes(dangerIDMessage))
.filter(comment => comment.user.uuid === this.uuid)
}

getDangerInlineComments = async (dangerID: string): Promise<Comment[]> => {
const comments = await this.getPullRequestComments()
const dangerIDMessage = dangerIDToString(dangerID)

return comments
.filter((comment) => comment.inline)
.map((comment) => ({
id: comment.id.toString(),
ownedByDanger: comment.content.raw.includes(dangerIDMessage) && comment.user.uuid === this.uuid,
body: comment.content.raw,
}))
return comments.filter(comment => comment.inline).map(comment => ({
id: comment.id.toString(),
ownedByDanger: comment.content.raw.includes(dangerIDMessage) && comment.user.uuid === this.uuid,
body: comment.content.raw,
}))
}

postBuildStatus = async (
Expand Down
17 changes: 8 additions & 9 deletions source/platforms/bitbucket_server/BitBucketServerAPI.ts
Expand Up @@ -209,12 +209,12 @@ export class BitBucketServerAPI implements BitBucketServerAPIDSL {
const activities = await this.getPullRequestComments()
const dangerIDMessage = dangerIDToString(dangerID)

const comments = activities.map((activity) => activity.comment).filter(Boolean) as BitBucketServerPRComment[]
const comments = activities.map(activity => activity.comment).filter(Boolean) as BitBucketServerPRComment[]

return comments
.filter((comment) => comment!.text.includes(dangerIDMessage))
.filter((comment) => comment!.author.name.toLowerCase() === username!.toLowerCase())
.filter((comment) => comment!.text.includes("Generated by"))
.filter(comment => comment!.text.includes(dangerIDMessage))
.filter(comment => comment!.author.name.toLowerCase() === username!.toLowerCase())
.filter(comment => comment!.text.includes("Generated by"))
}

getDangerInlineComments = async (dangerID: string): Promise<Comment[]> => {
Expand All @@ -223,17 +223,16 @@ export class BitBucketServerAPI implements BitBucketServerAPIDSL {
const dangerIDMessage = dangerIDToString(dangerID)

const comments = activities
.filter((activity) => activity.commentAnchor)
.map((activity) => activity.comment)
.filter(activity => activity.commentAnchor)
.map(activity => activity.comment)
.filter(Boolean) as BitBucketServerPRComment[]
return new Promise<Comment[]>((resolve) => {
return new Promise<Comment[]>(resolve => {
resolve(
comments
.map((i: any) => {
return {
id: i.id,
ownedByDanger:
i.author.name.toLowerCase() === username!.toLowerCase() && i.text.includes(dangerIDMessage),
ownedByDanger: i.author.name.toLowerCase() === username!.toLowerCase() && i.text.includes(dangerIDMessage),
body: i.text,
}
})
Expand Down

0 comments on commit 8dd9fd8

Please sign in to comment.