mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 04:04:25 +01:00
ignoring config when using custom config (#362)
This commit is contained in:
1 parent
9d76070806
commit
9db91442b3
1 file changed
+3
@@ -2,6 +2,7 @@ package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
"regexp"
|
||||
"strconv"
|
||||
|
||||
@@ -94,6 +95,8 @@ func NewConfig(options options.Options) (Config, error) {
|
||||
var err error
|
||||
if options.Config != "" {
|
||||
_, err = toml.DecodeFile(options.Config, &tomlLoader)
|
||||
// append a whitelist rule for whitelisting the config
|
||||
tomlLoader.Whitelist.Files = append(tomlLoader.Whitelist.Files, path.Base(options.Config))
|
||||
} else {
|
||||
_, err = toml.Decode(DefaultConfig, &tomlLoader)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user