Update Adding_Detectors_external.md (#957)

This commit is contained in:
Pulkit Aggarwal
2022-12-06 15:36:55 -08:00
committed by GitHub
parent 335ce85ce4
commit d96b7f8468
+6 -2
View File
@@ -49,8 +49,12 @@ If you think that something should be included outside of these guidelines, plea
```bash
go run hack/generate/generate.go detector <DetectorType enum name>
```
3. Add Secret Scanner
3. Complete the secret detector.
Add the secret scanner to the `pkg/engine/defaults.go` file like `github.com/trufflesecurity/trufflehog/v3/pkg/detectors/<detector_name>` and
`<detector_name>.Scanner{},`
4. Complete the secret detector.
The previous step templated a boilerplate + some example code as a package in the `pkg/detectors` folder for you to work on.
The secret detector can be completed with these general steps:
@@ -104,4 +108,4 @@ Now, the detector test should attempt to load the given env key from that file.
### Testing a detector
```bash
go test ./pkg/detectors/<detector> -tags=detectors
```
```