Skip to content

Commit

Permalink
run prettier to clear linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
elireisman committed Jun 4, 2024
1 parent 0bec1ca commit 97c6dd5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions __tests__/fixtures/config-allow-sample.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fail_on_severity: critical
allow_licenses:
- "BSD"
- "GPL 2"
- 'BSD'
- 'GPL 2'
2 changes: 1 addition & 1 deletion __tests__/fixtures/inline-license-config-sample.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
allow-licenses: "MIT, GPL-2.0-only"
allow-licenses: 'MIT, GPL-2.0-only'
2 changes: 1 addition & 1 deletion __tests__/summary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/comment-pr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const COMMENT_MARKER = '<!-- dependency-review-pr-comment-marker -->'

export async function commentPr(
commentContent: string,
config: ConfigurationOptions,
config: ConfigurationOptions
): Promise<void> {
if (
!(
Expand Down
6 changes: 1 addition & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
return new Promise(resolve => setTimeout(resolve, ms))
}
Expand Down
16 changes: 9 additions & 7 deletions src/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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')
}
Expand Down

0 comments on commit 97c6dd5

Please sign in to comment.