mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
Feature: Adding the ability to extend configuration files (#926)
* init * working on default and path config extensions * adding trace log level, consolidating some code * cleaning things up, updating generate package * fix tests * formatting * adding tests for extend * extend not extends * formatting * only allow usedefault or path to be set * update readme * add note about allowlists * more readme, expand env var for path * actually dont support env var. ez attack
This commit is contained in:
1 parent
0d471653b5
commit
31650f01e7
17 files changed
+1073
-834
No files matched your search
+1
-1
@@ -53,7 +53,7 @@ func hasEmptyRules(tool Tool) bool {
|
||||
func getRules(cfg config.Config) []Rules {
|
||||
// TODO for _, rule := range cfg.Rules {
|
||||
var rules []Rules
|
||||
for _, rule := range cfg.Rules {
|
||||
for _, rule := range cfg.OrderedRules() {
|
||||
shortDescription := ShortDescription{
|
||||
Text: rule.Description,
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package report
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -27,7 +28,7 @@ func TestWriteSarif(t *testing.T) {
|
||||
findings: []Finding{
|
||||
{
|
||||
|
||||
Description: "",
|
||||
Description: "A test rule",
|
||||
RuleID: "test-rule",
|
||||
Match: "line containing secret",
|
||||
Secret: "a secret",
|
||||
@@ -73,6 +74,7 @@ func TestWriteSarif(t *testing.T) {
|
||||
t.Error(err)
|
||||
}
|
||||
err = writeSarif(cfg, test.findings, tmpfile)
|
||||
fmt.Println(cfg)
|
||||
if err != nil {
|
||||
os.Remove(tmpfile.Name())
|
||||
t.Error(err)
|
||||
|
||||
Reference in new issue
Block a user