mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
replace std library regex engine with go-re2 (#1669)
This commit is contained in:
1 parent
906085fba6
commit
a91c6717a0
44 files changed
+92
-77
No files matched your search
+1
-1
@@ -2,9 +2,9 @@ package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
regexp "github.com/wasilibs/go-re2"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -1,7 +1,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
regexp "github.com/wasilibs/go-re2"
|
||||
)
|
||||
|
||||
func anyRegexMatch(f string, res []*regexp.Regexp) bool {
|
||||
|
||||
Reference in new issue
Block a user