Rename and export isGitSource (#1016)
Lint / lint (push) Waiting to run
Release / Release (push) Waiting to run
Scan for secrets / test (push) Waiting to run
Snifftest / Run Snifftest (push) Waiting to run
Test / test (push) Waiting to run
Test / test-detectors (push) Waiting to run

This commit is contained in:
Bill Rich
2023-01-10 12:51:58 -08:00
committed by GitHub
parent 8b2e1d36cf
commit 430d5c764c
+3 -2
View File
@@ -231,7 +231,7 @@ func (e *Engine) detectorWorker(ctx context.Context) {
}
for _, result := range results {
resultChunk := chunk
if isGitSource(chunk.SourceType) {
if SupportsLineNumbers(chunk.SourceType) {
copyChunk := *chunk
copyMetaDataClone := proto.Clone(chunk.SourceMetadata)
if copyMetaData, ok := copyMetaDataClone.(*source_metadatapb.MetaData); ok {
@@ -281,7 +281,8 @@ func gitSources() []sourcespb.SourceType {
}
}
func isGitSource(sourceType sourcespb.SourceType) bool {
// SupportsLineNumbers determines if a line number can be found for a source type.
func SupportsLineNumbers(sourceType sourcespb.SourceType) bool {
for _, i := range gitSources() {
if i == sourceType {
return true