Skip to content

Commit

Permalink
Rename and export isGitSource (#1016)
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-rich committed Jan 10, 2023
1 parent 8b2e1d3 commit 430d5c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 430d5c7

Please sign in to comment.