Immutable solution version
How do we ignore folders in Snyk
Complete solution
Shows how to fix how do we ignore folders in Snyk. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
To exclude directories for the open source part, you need to: In an SCM import, add the list to exclude (screenshot) In a CLI import, add the directories as arguments (syntax below) --exclude=DIRECTORY[,DIRECTORY]...> (only in test and monitor commands) Can be used with --all-projects and --yarn-workspaces to indicate sub-directories and files to exclude. This is confusing because these are two separate mechanisms.
When to use
You are seeing this: From the accepted Stack Overflow answer: Yes, unfortunately this is confusing today. Use this skill when you run into "How do we ignore folders in Snyk".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
From the accepted Stack Overflow answer: Yes, unfortunately this is confusing today. For historical reasons, the .snyk file only applies to Snyk Code (SAST). To exclude directories for the open source part, you need to: In an SCM import, add the list to exclude (screenshot) In a CLI import, add the directories as arguments (syntax below) --exclude=DIRECTORY[,DIRECTORY]...> (only in test and monitor commands) Can be used with --all-projects and --yarn-workspaces to indicate sub-directories and files to exclude. Must be comma separated. This is confusing because these are two separate mechanisms. In the future, both mechanisms will be the same, but for now, both need to be done.
Context: Problem: Accepted solution (score 5): Yes, unfortunately this is confusing today. For historical reasons, the .snyk file only applies to Snyk Code (SAST). To exclude directories for the open source part, you need to: In an SCM import, add the list to exclude (screenshot) In a CLI import, add the directories as arguments (syntax below) --exclude=DIRECTORY[,DIRECTORY]...> (only in test and monitor commands) Can be used with --all-projects and --yarn-workspaces to indicate sub-directories and files to exclude. Must be comma separated. This is confusing because these are two separate mechanisms. In the future, both mechanisms will be the same, but for now, both need to be done.
Evidence
Source: Problem: Accepted solution (score 5): Yes, unfortunately this is confusing today. For historical reasons, the .snyk file only applies to Snyk Code (SAST). To exclude directories for the open source part, you need to: In an SCM import, add the list to exclude (screenshot) In a CLI import, add the directories as arguments (syntax below) --exclude=DIRECTORY[,DIRECTORY]...> (only in test and monitor commands) Can be used with --all-projects and --yarn-workspaces to indicate sub-directories and files to exclude. Must be comma separated. This is confusing because these are two separate mechanisms. In the future, both mechanisms will be the same, but for now, both need to be done.
Verified resolution: From the accepted Stack Overflow answer: Yes, unfortunately this is confusing today. For historical reasons, the .snyk file only applies to Snyk Code (SAST). To exclude directories for the open source part, you need to: In an SCM import, add the list to exclude (screenshot) In a CLI import, add the directories as arguments (syntax below) --exclude=DIRECTORY[,DIRECTORY]...> (only in test and monitor commands) Can be used with --all-projects and --yarn-workspaces to indicate sub-directories and files to exclude. Must be comma separated. This is confusing because these are two separate mechanisms. In the future, both mechanisms will be the same, but for now, both need to be done.
Source URL: https://stackoverflow.com/questions/76145644/how-do-we-ignore-folders-in-snyk
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_UGzPsZrtKDOkvdssqjyl-g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">How do we ignore folders in Snyk <span>— Vectle</span></a>