Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix: respect projectIgnorePaths from socket.yml in scan create
The scan create command had all the downstream infrastructure to honor
projectIgnorePaths from socket.yml but never actually loaded the config.
Read socket.yml via findSocketYmlSync and pass the parsed config to
getPackageFilesForScan so globWithGitIgnore applies the ignore patterns.
  • Loading branch information
mtorp committed Mar 31, 2026
commit 7fa104fcd167e53bb72f5c24f311fe813f4b5bc5
1 change: 0 additions & 1 deletion src/commands/scan/cmd-scan-create.mts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ async function run(
...generalFlags,
...reachabilityFlags,
},
// TODO: Your project's "socket.yml" file's "projectIgnorePaths".
help: command => `
Usage
$ ${command} [options] [TARGET...]
Expand Down
9 changes: 9 additions & 0 deletions src/commands/scan/handle-create-new-scan.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { outputCreateNewScan } from './output-create-new-scan.mts'
import { performReachabilityAnalysis } from './perform-reachability-analysis.mts'
import constants from '../../constants.mts'
import { checkCommandInput } from '../../utils/check-input.mts'
import { findSocketYmlSync } from '../../utils/config.mts'
import { getPackageFilesForScan } from '../../utils/path-resolve.mts'
import { readOrDefaultSocketJson } from '../../utils/socket-json.mts'
import { socketDocsLink } from '../../utils/terminal-link.mts'
Expand Down Expand Up @@ -164,7 +165,15 @@ export async function handleCreateNewScan({
spinner.start('Searching for local files to include in scan...')

const supportedFiles = supportedFilesCResult.data

// Load socket.yml to respect projectIgnorePaths when collecting files.
const socketYmlResult = findSocketYmlSync(cwd)
const socketConfig = socketYmlResult.ok
? socketYmlResult.data?.parsed
: undefined

const packagePaths = await getPackageFilesForScan(targets, supportedFiles, {
config: socketConfig,
cwd,
})

Expand Down