Skip to content

Commit

Permalink
skip-folders flag
Browse files Browse the repository at this point in the history
  • Loading branch information
orto17 committed Jun 20, 2023
1 parent 65ed020 commit 5a9af66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scan/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ func createGenericAuditCmd(c *cli.Context) (*audit.GenericAuditCommand, error) {
SetFail(c.BoolT("fail")).
SetPrintExtendedTable(c.Bool(cliutils.ExtendedTable)).
SetMinSeverityFilter(minSeverity).
SetFixableOnly(c.Bool(cliutils.FixableOnly))
SetFixableOnly(c.Bool(cliutils.FixableOnly)).
SetJasSkipFolders(c.String("skip-folders"))

if c.String("watches") != "" {
auditCmd.SetWatches(splitByCommaAndTrim(c.String("watches")))
Expand Down
7 changes: 6 additions & 1 deletion utils/cliutils/commandsflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ const (
scanRegexp = scanPrefix + regexpFlag
scanAnt = scanPrefix + antFlag
xrOutput = "format"
skipFolders = "skip-folders"
BypassArchiveLimits = "bypass-archive-limits"

// Audit commands
Expand Down Expand Up @@ -1350,6 +1351,10 @@ var flagsMap = map[string]cli.Flag{
Name: xrOutput,
Usage: "[Default: table] Defines the output format of the command. Acceptable values are: table, json, simple-json and sarif. Note: the json format doesn’t include information about scans that are included as part of the Advanced Security package.` `",
},
skipFolders: cli.StringFlag{
Name: skipFolders,
Usage: "[Default: **/*test*/**,**/*venv*/**,**/*node_modules*/**,**/*target*/**] Defines the folders in the project that should not be scanned by jas. Acceptable pattern: **/*directory1*/**,**/*directory2*/**,**/*directory3*/**` `",
},
BypassArchiveLimits: cli.BoolFlag{
Name: BypassArchiveLimits,
Usage: "[Default: false] Set to true to bypass the indexer-app archive limits.` `",
Expand Down Expand Up @@ -1846,7 +1851,7 @@ var commandFlags = map[string][]string{
},
Audit: {
xrUrl, user, password, accessToken, serverId, InsecureTls, project, watches, repoPath, licenses, xrOutput, ExcludeTestDeps,
useWrapperAudit, DepType, RequirementsFile, fail, ExtendedTable, workingDirs, Mvn, Gradle, Npm, Yarn, Go, Nuget, Pip, Pipenv, Poetry, MinSeverity, FixableOnly,
useWrapperAudit, DepType, RequirementsFile, fail, ExtendedTable, workingDirs, Mvn, Gradle, Npm, Yarn, Go, Nuget, Pip, Pipenv, Poetry, MinSeverity, FixableOnly, skipFolders,
},
AuditMvn: {
xrUrl, user, password, accessToken, serverId, InsecureTls, project, watches, repoPath, licenses, xrOutput, fail, ExtendedTable, useWrapperAudit,
Expand Down

0 comments on commit 5a9af66

Please sign in to comment.