build: support either stdlib or 3rd-party regexp (#1706)

This commit is contained in:
Richard Gomez authored and GitHub committed 2025-01-20 10:45:31 -06:00
1 parent 049f5b2435
commit 3f4d91fc22
47 files changed
+102 -123

No files matched your search

+2 -1
View File
@@ -4,8 +4,9 @@ import (
"fmt"
"strings"
regexp "github.com/wasilibs/go-re2"
"golang.org/x/exp/maps"
"github.com/zricethezav/gitleaks/v8/regexp"
)
type AllowlistMatchCondition int
+2 -1
View File
@@ -7,7 +7,8 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/stretchr/testify/assert"
regexp "github.com/wasilibs/go-re2"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func TestCommitAllowed(t *testing.T) {
+1 -1
View File
@@ -7,9 +7,9 @@ import (
"strings"
"github.com/spf13/viper"
regexp "github.com/wasilibs/go-re2"
"github.com/zricethezav/gitleaks/v8/logging"
"github.com/zricethezav/gitleaks/v8/regexp"
)
//go:embed gitleaks.toml
+2 -2
View File
@@ -5,11 +5,11 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
regexp "github.com/wasilibs/go-re2"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/zricethezav/gitleaks/v8/regexp"
)
const configPath = "../testdata/config/"
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"fmt"
"strings"
regexp "github.com/wasilibs/go-re2"
"github.com/zricethezav/gitleaks/v8/regexp"
)
// Rules contain information that define details on how to detect secrets
+1 -1
View File
@@ -1,7 +1,7 @@
package config
import (
regexp "github.com/wasilibs/go-re2"
"github.com/zricethezav/gitleaks/v8/regexp"
)
func anyRegexMatch(f string, res []*regexp.Regexp) bool {