Skip to content

Commit 352d2b1

Browse files
committed
style: apply auto-fix formatting changes
Apply Biome formatting fixes across test files and source files. Includes cleanup of unused imports, consistent code formatting, and standardization of code style.
1 parent ab49dd3 commit 352d2b1

File tree

15 files changed

+70
-97
lines changed

15 files changed

+70
-97
lines changed

packages/cli/scripts/lint.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ function filterLintableFiles(files) {
136136
}
137137

138138
// Filter out fixture files (third-party test fixtures should not be linted).
139-
if (file.includes('/test/fixtures/') || file.includes('/test\\fixtures\\')) {
139+
if (
140+
file.includes('/test/fixtures/') ||
141+
file.includes('/test\\fixtures\\')
142+
) {
140143
return false
141144
}
142145

packages/cli/src/commands/fix/pull-request.test.mts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { RequestError } from '@octokit/request-error'
2-
31
import { beforeEach, describe, expect, it, vi } from 'vitest'
42

53
import { openSocketFixPr } from './pull-request.mts'

packages/cli/src/commands/patch/output-patch-info-result.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ export async function outputPatchInfoResult(
7474
logger.log(`\n${vuln.description}`)
7575
}
7676
if (vuln.patchExplanation) {
77-
logger.log(`\n${mdKeyValue('Patch Explanation', vuln.patchExplanation)}`)
77+
logger.log(
78+
`\n${mdKeyValue('Patch Explanation', vuln.patchExplanation)}`,
79+
)
7880
}
7981
logger.log('')
8082
}

packages/cli/src/commands/patch/output-patch-list-result.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ export async function outputPatchListResult(
130130
}
131131
logger.log('')
132132
}
133-
logger.log(`${mdKeyValue('Legend', '[✓] Applied | [○] Downloaded | [✗] Failed')}`)
133+
logger.log(
134+
`${mdKeyValue('Legend', '[✓] Applied | [○] Downloaded | [✗] Failed')}`,
135+
)
134136
return
135137
}
136138

packages/cli/src/commands/patch/output-patch-status-result.mts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ export async function outputPatchStatusResult(
9595
}
9696

9797
// Legend.
98-
logger.log(mdKeyValue('Legend', '[✓] Applied | [○] Downloaded | [✗] Failed | [?] Unknown'))
98+
logger.log(
99+
mdKeyValue(
100+
'Legend',
101+
'[✓] Applied | [○] Downloaded | [✗] Failed | [?] Unknown',
102+
),
103+
)
99104

100105
return
101106
}

packages/cli/src/commands/scan/cmd-scan-create.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ async function run(
288288

289289
// Validate severity value if provided.
290290
const validSeverities = ['info', 'low', 'moderate', 'high', 'critical']
291-
if (reachMinSeverity && !validSeverities.includes(reachMinSeverity.toLowerCase())) {
291+
if (
292+
reachMinSeverity &&
293+
!validSeverities.includes(reachMinSeverity.toLowerCase())
294+
) {
292295
throw new Error(
293296
`Invalid severity: "${reachMinSeverity}". Valid values are: ${joinAnd(validSeverities)}`,
294297
)

packages/cli/src/commands/scan/cmd-scan-reach.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ async function run(
161161

162162
// Validate severity value if provided.
163163
const validSeverities = ['info', 'low', 'moderate', 'high', 'critical']
164-
if (reachMinSeverity && !validSeverities.includes(reachMinSeverity.toLowerCase())) {
164+
if (
165+
reachMinSeverity &&
166+
!validSeverities.includes(reachMinSeverity.toLowerCase())
167+
) {
165168
throw new Error(
166169
`Invalid severity: "${reachMinSeverity}". Valid values are: ${joinAnd(validSeverities)}`,
167170
)

packages/cli/src/commands/self-update/cmd-self-update.test.mts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,7 @@ import {
7171

7272
import { getIpcStubPath } from '@socketsecurity/lib/ipc'
7373

74-
import {
75-
canSelfUpdate,
76-
isSeaBinary,
77-
} from '../../utils/executable/detect.mjs'
74+
import { isSeaBinary } from '../../utils/executable/detect.mjs'
7875
import { clearQuarantine, ensureExecutable } from '../../utils/process/os.mjs'
7976
import { handleSelfUpdate } from './handle-self-update.mts'
8077

packages/cli/src/utils/git/github-provider.mts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,7 @@ export class GitHubProvider implements PrProvider {
179179
}
180180

181181
async listPrs(options: ListPrsOptions): Promise<PrMatch[]> {
182-
const {
183-
author,
184-
ghsaId,
185-
owner,
186-
repo,
187-
states: statesValue = 'all',
188-
} = options
182+
const { author, ghsaId, owner, repo, states: statesValue = 'all' } = options
189183
const checkAuthor = isNonEmptyString(author)
190184
const octokitGraphql = getOctokitGraphql()
191185
const matches: PrMatch[] = []

packages/cli/src/utils/git/gitlab-provider.mts

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,7 @@ export class GitLabProvider implements PrProvider {
138138
}
139139

140140
async listPrs(options: ListPrsOptions): Promise<PrMatch[]> {
141-
const {
142-
author,
143-
ghsaId,
144-
owner,
145-
repo,
146-
states: statesValue = 'all',
147-
} = options
141+
const { author, ghsaId, owner, repo, states: statesValue = 'all' } = options
148142
const checkAuthor = isNonEmptyString(author)
149143
const matches: PrMatch[] = []
150144
const projectId = `${owner}/${repo}`
@@ -214,9 +208,7 @@ export class GitLabProvider implements PrProvider {
214208
// GitLab requires project ID to delete a branch.
215209
// Since we don't have it in this method, we can't delete.
216210
// This is a limitation of the current interface design.
217-
debug(
218-
`mr: cannot delete branch ${branch} - need project ID in interface`,
219-
)
211+
debug(`mr: cannot delete branch ${branch} - need project ID in interface`)
220212
return false
221213
} catch (e) {
222214
debug(formatErrorWithDetail(`mr: failed to delete branch ${branch}`, e))
@@ -251,9 +243,7 @@ export class GitLabProvider implements PrProvider {
251243
/**
252244
* Maps GitLab merge request state to common state.
253245
*/
254-
function mapGitLabState(
255-
state: string,
256-
): 'open' | 'closed' | 'merged' {
246+
function mapGitLabState(state: string): 'open' | 'closed' | 'merged' {
257247
if (state === 'opened') {
258248
return 'open'
259249
}
@@ -266,9 +256,7 @@ function mapGitLabState(
266256
/**
267257
* Maps GitLab merge request state to uppercase common state.
268258
*/
269-
function mapGitLabStateToUpper(
270-
state: string,
271-
): 'OPEN' | 'CLOSED' | 'MERGED' {
259+
function mapGitLabStateToUpper(state: string): 'OPEN' | 'CLOSED' | 'MERGED' {
272260
if (state === 'opened') {
273261
return 'OPEN'
274262
}
@@ -281,9 +269,7 @@ function mapGitLabStateToUpper(
281269
/**
282270
* Maps common state to GitLab state.
283271
*/
284-
function mapStateToGitLab(
285-
state: string,
286-
): 'opened' | 'closed' | 'merged' {
272+
function mapStateToGitLab(state: string): 'opened' | 'closed' | 'merged' {
287273
const lower = state.toLowerCase()
288274
if (lower === 'open') {
289275
return 'opened'
@@ -297,9 +283,7 @@ function mapStateToGitLab(
297283
/**
298284
* Maps GitLab merge_status to common merge state status.
299285
*/
300-
function mapGitLabMergeStatus(
301-
status: string,
302-
): MergeStateStatus {
286+
function mapGitLabMergeStatus(status: string): MergeStateStatus {
303287
// GitLab merge_status values:
304288
// - can_be_merged: clean, no conflicts
305289
// - cannot_be_merged: has conflicts

0 commit comments

Comments
 (0)