From 8dd9fd8b51c7df57b3c8492209d6d5a4676f9d6c Mon Sep 17 00:00:00 2001 From: Oscar Date: Wed, 24 Aug 2022 03:29:40 +0800 Subject: [PATCH] Revert unrelated formatting changes --- .../bitbucket_cloud/BitBucketCloudAPI.ts | 18 ++++++++---------- .../bitbucket_server/BitBucketServerAPI.ts | 17 ++++++++--------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts b/source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts index f0d6f333a..0bace9b9d 100644 --- a/source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts +++ b/source/platforms/bitbucket_cloud/BitBucketCloudAPI.ts @@ -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 => { 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 ( diff --git a/source/platforms/bitbucket_server/BitBucketServerAPI.ts b/source/platforms/bitbucket_server/BitBucketServerAPI.ts index a05348ce6..554edadc4 100644 --- a/source/platforms/bitbucket_server/BitBucketServerAPI.ts +++ b/source/platforms/bitbucket_server/BitBucketServerAPI.ts @@ -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 => { @@ -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((resolve) => { + return new Promise(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, } })