Skip to content

Fix output; some was breaking --json, some typos #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/commands/package/fetch-purl-deep-score.mts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface PurlDataResponse {
export async function fetchPurlDeepScore(
purl: string
): Promise<CResult<PurlDataResponse>> {
logger.info(`Requesting deep score data for this purl: ${purl}`)
logger.error(`Requesting deep score data for this purl: ${purl}`)

const apiToken = getDefaultToken()
if (!apiToken) {
Expand Down Expand Up @@ -96,7 +96,7 @@ export async function fetchPurlDeepScore(
return {
ok: false,
message: 'Socket API returned an error',
cause: `${result.statusText}${err ? ` (cause: ${err}` : ''}`
cause: `${result.statusText}${err ? ` (cause: ${err})` : ''}`
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/package/fetch-purls-shallow-score.mts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type {
export async function fetchPurlsShallowScore(
purls: string[]
): Promise<CResult<SocketSdkReturnType<'batchPackageFetch'>>> {
logger.info(
logger.error(
`Requesting shallow score data for ${purls.length} package urls (purl): ${purls.join(', ')}`
)

Expand Down
2 changes: 1 addition & 1 deletion src/commands/scan/cmd-scan-report.mts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async function run(
},
{
test: !!scanId,
message: 'Scan ID to fetch',
message: 'Scan ID to report on',
pass: 'ok',
fail: 'missing'
},
Expand Down
2 changes: 1 addition & 1 deletion src/commands/scan/cmd-scan-report.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('socket scan report', async () => {

- Org name must be the first argument (\\x1b[31mmissing\\x1b[39m)

- Scan ID to fetch (\\x1b[31mmissing\\x1b[39m)
- Scan ID to report on (\\x1b[31mmissing\\x1b[39m)

- You need to be logged in to use this command. See \`socket login\`. (\\x1b[31mmissing API token\\x1b[39m)
\\x1b[22m"
Expand Down
2 changes: 1 addition & 1 deletion src/commands/scan/cmd-scan-view.mts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async function run(
},
{
test: !!scanId,
message: 'Scan ID to delete',
message: 'Scan ID to view',
pass: 'ok',
fail: 'missing'
},
Expand Down
2 changes: 1 addition & 1 deletion src/commands/scan/cmd-scan-view.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('socket scan view', async () => {

- Org name must be the first argument (\\x1b[31mmissing\\x1b[39m)

- Scan ID to delete (\\x1b[31mmissing\\x1b[39m)
- Scan ID to view (\\x1b[31mmissing\\x1b[39m)

- You need to be logged in to use this command. See \`socket login\`. (\\x1b[31mmissing API token\\x1b[39m)
\\x1b[22m"
Expand Down
2 changes: 1 addition & 1 deletion src/commands/scan/fetch-diff-scan.mts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function fetchDiffScan({
return {
ok: false,
message: 'Socket API returned an error',
cause: `${response.statusText}${err ? ` (cause: ${err}` : ''}`
cause: `${response.statusText}${err ? ` (cause: ${err})` : ''}`
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/commands/scan/fetch-report-data.mts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export async function fetchReportData(
function updateProgress() {
if (finishedFetching) {
spinner.stop()
logger.info(
logger.error(
`Scan result: ${scanStatus}. Security policy: ${policyStatus}.`
)
} else {
Expand All @@ -85,7 +85,7 @@ export async function fetchReportData(
return {
ok: false,
message: 'Socket API returned an error',
cause: `${response.statusText}${err ? ` (cause: ${err}` : ''}`
cause: `${response.statusText}${err ? ` (cause: ${err})` : ''}`
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/scan/fetch-scan.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function fetchScan(
return {
ok: false,
message: 'Socket API returned an error',
cause: `${response.statusText}${err ? ` (cause: ${err}` : ''}`
cause: `${response.statusText}${err ? ` (cause: ${err})` : ''}`
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/scan/fetch-supported-scan-file-names.mts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function fetchSupportedScanFileNames(): Promise<
)

spinner.stop()
logger.success('Received response while fetched supported scan file types.')
logger.error('Received response while fetching supported scan file types.')

if (!result.success) {
return handleFailedApiResponse('getReportSupportedFiles', result)
Expand Down
Loading