Skip to content

Commit 4af79de

Browse files
committed
Remove yaml config from some paths
1 parent bf3de4c commit 4af79de

File tree

1 file changed

+4
-26
lines changed

1 file changed

+4
-26
lines changed

src/utils/path-resolve.ts

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@ import { resolveBinPath } from '@socketsecurity/registry/lib/npm'
1313
import { directoryPatterns } from './ignore-by-default'
1414
import constants from '../constants'
1515

16-
import type { SocketYml } from '@socketsecurity/config'
1716
import type { SocketSdkReturnType } from '@socketsecurity/sdk'
1817
import type { GlobOptions } from 'tinyglobby'
1918

20-
type GlobWithGitIgnoreOptions = GlobOptions & {
21-
socketConfig?: SocketYml | undefined
22-
}
23-
2419
const { NODE_MODULES, NPM, shadowBinPath } = constants
2520

2621
async function filterGlobResultToSupportedFiles(
@@ -42,30 +37,15 @@ async function filterGlobResultToSupportedFiles(
4237
return entries.filter(p => micromatch.some(p, patterns))
4338
}
4439

45-
async function globWithGitIgnore(
46-
patterns: string[],
47-
options: GlobWithGitIgnoreOptions
48-
) {
49-
const {
50-
cwd = process.cwd(),
51-
socketConfig,
52-
...additionalOptions
53-
} = { __proto__: null, ...options } as GlobWithGitIgnoreOptions
54-
const projectIgnorePaths = socketConfig?.projectIgnorePaths
40+
async function globWithGitIgnore(patterns: string[], options: GlobOptions) {
41+
const { cwd = process.cwd(), ...additionalOptions } = options
5542
const ignoreFiles = await tinyGlob(['**/.gitignore'], {
5643
absolute: true,
5744
cwd,
5845
expandDirectories: true
5946
})
6047
const ignores = [
6148
...directoryPatterns(),
62-
...(Array.isArray(projectIgnorePaths)
63-
? ignoreFileLinesToGlobPatterns(
64-
projectIgnorePaths,
65-
path.join(cwd, '.gitignore'),
66-
cwd
67-
)
68-
: []),
6949
...(
7050
await Promise.all(
7151
ignoreFiles.map(async filepath =>
@@ -251,14 +231,12 @@ export function findNpmPathSync(npmBinPath: string): string | undefined {
251231
export async function getPackageFilesForScan(
252232
cwd: string,
253233
inputPaths: string[],
254-
supportedFiles: SocketSdkReturnType<'getReportSupportedFiles'>['data'],
255-
config?: SocketYml | undefined
234+
supportedFiles: SocketSdkReturnType<'getReportSupportedFiles'>['data']
256235
): Promise<string[]> {
257236
debugLog(`Globbed resolving ${inputPaths.length} paths:`, inputPaths)
258237

259238
const entries = await globWithGitIgnore(pathsToPatterns(inputPaths), {
260-
cwd,
261-
socketConfig: config
239+
cwd
262240
})
263241

264242
debugLog(

0 commit comments

Comments
 (0)