chore(config): refactor to go generate; simplify configRules init (#1295)

This commit is contained in:
Oleksandr Redko authored and GitHub committed 2023-11-21 19:52:50 -06:00
1 parent 54f5f04a1f
commit 01e60c81e6
4 files changed
+185 -180

No files matched your search

+3 -7
View File
@@ -88,15 +88,11 @@ If you want to add a new rule to the [default Gitleaks configuration](https://gi
validation part. You can use `generateSampleSecret` to create a secret for the
true positives (`tps` in the example above) used in `validate`.
1. Update `cmd/generate/config/main.go`. Add a line like
`configRules = append(configRules, rules.Beamer())` in `main()`. Try and keep
1. Update `cmd/generate/config/main.go`. Extend `configRules` slice with
the `rules.Beamer(),` in `main()`. Try and keep
this alphabetically pretty please.
1. Change directories into `cmd/generate/config` and run `go run main.go`
```
cd cmd/generate/config && go run main.go
```
1. Run `go generate ./...`
1. Check out your new rules in `config/gitleaks.toml` and see if everything looks good.