Skip to content

Commit

Permalink
fix codacy
Browse files Browse the repository at this point in the history
cxMiguelSilva committed May 4, 2023
1 parent 3b5ad71 commit 27f3dcc
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/engine/secrets/inspector.go
Original file line number Diff line number Diff line change
@@ -282,6 +282,7 @@ func compileRegexQueries(
return regexQueries, nil
}

// CompileRegex compiles the regex allow rules
func CompileRegex(allowRules []AllowRule) ([]AllowRule, error) {
for j := range allowRules {
compiledRegex, err := regexp.Compile(allowRules[j].RegexStr)
@@ -339,6 +340,7 @@ func (c *Inspector) isSecret(s string, query *RegexQuery) (isSecretRet bool, gro
return false, [][]string{}
}

// IsAllowRule check if string matches any of the allow rules for the secret queries
func IsAllowRule(s string, allowRules []AllowRule) bool {
for i := range allowRules {
if allowRules[i].Regex.MatchString(s) {
1 change: 1 addition & 0 deletions pkg/scan/preview_secrets_mask.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package scan implements functions and helpers to ensure the proper scan of the specified files
package scan

import (

0 comments on commit 27f3dcc

Please sign in to comment.