mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
fixing all golint and adding some more tests
This commit is contained in:
1 parent
2ccd40677d
commit
e446ba0738
19 files changed
+161
-91
No files matched your search
+1
-4
@@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// WhiteList is struct containing items that if encountered will whitelist
|
||||
// Whitelist is struct containing items that if encountered will whitelist
|
||||
// a commit/line of code that would be considered a leak.
|
||||
type Whitelist struct {
|
||||
Description string
|
||||
@@ -121,9 +121,6 @@ func (tomlLoader TomlLoader) Parse() (Config, error) {
|
||||
if err != nil {
|
||||
return cfg, fmt.Errorf("problem loading config: %v", err)
|
||||
}
|
||||
if err != nil {
|
||||
return cfg, fmt.Errorf("problem loading config: %v", err)
|
||||
}
|
||||
whitelists = append(whitelists, Whitelist{
|
||||
Description: wl.Description,
|
||||
File: fileRe,
|
||||
|
||||
@@ -18,7 +18,7 @@ func TestParse(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
description: "default config",
|
||||
opts: options.Options{},
|
||||
opts: options.Options{},
|
||||
},
|
||||
{
|
||||
description: "test successful load",
|
||||
|
||||
+3
-1
@@ -1,5 +1,8 @@
|
||||
package config
|
||||
|
||||
// DefaultConfig is the default gitleaks configuration. If --config={path-to-config} is set than the config located
|
||||
// at {path-to-config} will be used. Alternatively, if --repo-config is set then gitleaks will attempt to
|
||||
// use the config set in a gitleaks.toml or .gitleaks.toml file in the repo that is run with --repo-config set.
|
||||
const DefaultConfig = `
|
||||
title = "gitleaks config"
|
||||
|
||||
@@ -133,4 +136,3 @@ title = "gitleaks config"
|
||||
description = "image whitelists"
|
||||
file = '''(.*?)(jpg|gif|doc|pdf|bin)$'''
|
||||
`
|
||||
|
||||
Reference in new issue
Block a user