From 97c6dd59c39d6da5ad9cb28e018b3ed7fa6ab493 Mon Sep 17 00:00:00 2001 From: Eli Reisman Date: Tue, 4 Jun 2024 11:25:38 -0700 Subject: [PATCH] run prettier to clear linter warnings --- __tests__/fixtures/config-allow-sample.yml | 4 ++-- .../fixtures/inline-license-config-sample.yml | 2 +- __tests__/summary.test.ts | 2 +- src/comment-pr.ts | 2 +- src/main.ts | 6 +----- src/summary.ts | 16 +++++++++------- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/__tests__/fixtures/config-allow-sample.yml b/__tests__/fixtures/config-allow-sample.yml index b3a6f00b5..2a4d96683 100644 --- a/__tests__/fixtures/config-allow-sample.yml +++ b/__tests__/fixtures/config-allow-sample.yml @@ -1,4 +1,4 @@ fail_on_severity: critical allow_licenses: - - "BSD" - - "GPL 2" \ No newline at end of file + - 'BSD' + - 'GPL 2' diff --git a/__tests__/fixtures/inline-license-config-sample.yml b/__tests__/fixtures/inline-license-config-sample.yml index fa81ab0ae..fd603a7d7 100644 --- a/__tests__/fixtures/inline-license-config-sample.yml +++ b/__tests__/fixtures/inline-license-config-sample.yml @@ -1 +1 @@ -allow-licenses: "MIT, GPL-2.0-only" +allow-licenses: 'MIT, GPL-2.0-only' diff --git a/__tests__/summary.test.ts b/__tests__/summary.test.ts index 149cd0244..1a26e4df0 100644 --- a/__tests__/summary.test.ts +++ b/__tests__/summary.test.ts @@ -113,7 +113,7 @@ test('returns minimal summary in case the core.summary is too large for a PR com let changes: Changes = [ createTestChange({name: 'lodash', version: '1.2.3'}), createTestChange({name: 'colors', version: '2.3.4'}), - createTestChange({name: '@foo/bar', version: '*'}), + createTestChange({name: '@foo/bar', version: '*'}) ] let minSummary: string = summary.addSummaryToSummary( diff --git a/src/comment-pr.ts b/src/comment-pr.ts index d4729ace0..1c5ed0941 100644 --- a/src/comment-pr.ts +++ b/src/comment-pr.ts @@ -17,7 +17,7 @@ const COMMENT_MARKER = '' export async function commentPr( commentContent: string, - config: ConfigurationOptions, + config: ConfigurationOptions ): Promise { if ( !( diff --git a/src/main.ts b/src/main.ts index 2440672a9..19b9ff82d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,13 +22,9 @@ import * as summary from './summary' import {getRefs} from './git-refs' import {groupDependenciesByManifest} from './utils' -import { - commentPr, - MAX_COMMENT_LENGTH -} from './comment-pr' +import {commentPr, MAX_COMMENT_LENGTH} from './comment-pr' import {getDeniedChanges} from './deny' - async function delay(ms: number): Promise { return new Promise(resolve => setTimeout(resolve, ms)) } diff --git a/src/summary.ts b/src/summary.ts index a40d5829b..dd57c3d36 100644 --- a/src/summary.ts +++ b/src/summary.ts @@ -18,9 +18,9 @@ export function addSummaryToSummary( invalidLicenseChanges: InvalidLicenseChanges, deniedChanges: Changes, scorecard: Scorecard, - config: ConfigurationOptions, + config: ConfigurationOptions ): string { - let out: string[] = []; + let out: string[] = [] const scorecardWarnings = countScorecardWarnings(scorecard, config) const licenseIssues = countLicenseIssues(invalidLicenseChanges) @@ -52,12 +52,12 @@ export function addSummaryToSummary( return out.join('\n') } - const foundIssuesHeader = 'The following issues were found:' + const foundIssuesHeader = 'The following issues were found:' core.summary.addRaw(foundIssuesHeader) out.push(foundIssuesHeader) const summaryList: string[] = [ - ...(config.vulnerability_check + ...(config.vulnerability_check ? [ `${checkOrFailIcon(vulnerableChanges.length)} ${ vulnerableChanges.length @@ -89,15 +89,17 @@ export function addSummaryToSummary( `${checkOrWarnIcon(scorecardWarnings)} ${scorecardWarnings ? scorecardWarnings : 'No'} packages with OpenSSF Scorecard issues.` ] : []) - ]; + ] core.summary.addList(summaryList) - summaryList.forEach( (line) => { + summaryList.forEach(line => { out.push('* ' + line) }) core.summary.addRaw('See the Details below.') - out.push(`\n[View full job summary](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`) + out.push( + `\n[View full job summary](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})` + ) return out.join('\n') }