replace std library regex engine with go-re2 (#1669)

This commit is contained in:
ahrav authored and GitHub committed 2024-12-20 09:53:01 -06:00
1 parent 906085fba6
commit a91c6717a0
44 files changed
+92 -77

No files matched your search

+1 -1
View File
@@ -2,9 +2,9 @@ package config
import (
"fmt"
"regexp"
"strings"
regexp "github.com/wasilibs/go-re2"
"golang.org/x/exp/maps"
)
+1 -1
View File
@@ -2,12 +2,12 @@ package config
import (
"errors"
"regexp"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/stretchr/testify/assert"
regexp "github.com/wasilibs/go-re2"
)
func TestCommitAllowed(t *testing.T) {
+1 -1
View File
@@ -3,12 +3,12 @@ package config
import (
_ "embed"
"fmt"
"regexp"
"sort"
"strings"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
regexp "github.com/wasilibs/go-re2"
)
//go:embed gitleaks.toml
+1 -1
View File
@@ -2,10 +2,10 @@ package config
import (
"fmt"
"regexp"
"testing"
"github.com/google/go-cmp/cmp"
regexp "github.com/wasilibs/go-re2"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
+2 -1
View File
@@ -2,8 +2,9 @@ package config
import (
"fmt"
"regexp"
"strings"
regexp "github.com/wasilibs/go-re2"
)
// Rules contain information that define details on how to detect secrets
+1 -1
View File
@@ -1,7 +1,7 @@
package config
import (
"regexp"
regexp "github.com/wasilibs/go-re2"
)
func anyRegexMatch(f string, res []*regexp.Regexp) bool {