mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Go: apply path transformer for file TRAP labels
This commit is contained in:
@@ -814,12 +814,12 @@ func (extraction *Extraction) extractFileInfo(tw *trap.Writer, file string, isDu
|
||||
displayPath = rawPath
|
||||
}
|
||||
if i == len(components)-1 {
|
||||
lbl := tw.Labeler.FileLabelFor(file)
|
||||
lbl := tw.Labeler.FileLabelFor(path)
|
||||
dbscheme.FilesTable.Emit(tw, lbl, displayPath)
|
||||
dbscheme.ContainerParentTable.Emit(tw, parentLbl, lbl)
|
||||
dbscheme.HasLocationTable.Emit(tw, lbl, emitLocation(tw, lbl, 0, 0, 0, 0))
|
||||
extraction.Lock.Lock()
|
||||
slbl := extraction.StatWriter.Labeler.FileLabelFor(file)
|
||||
slbl := extraction.StatWriter.Labeler.FileLabelFor(path)
|
||||
if !isDummy {
|
||||
dbscheme.CompilationCompilingFilesTable.Emit(extraction.StatWriter, extraction.Label, extraction.GetFileIdx(file), slbl)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"go/types"
|
||||
|
||||
"github.com/github/codeql-go/extractor/srcarchive"
|
||||
"github.com/github/codeql-go/extractor/util"
|
||||
)
|
||||
|
||||
@@ -67,7 +68,7 @@ func (l *Labeler) GlobalID(key string) Label {
|
||||
// FileLabel returns the label for a file with path `path`.
|
||||
func (l *Labeler) FileLabel() Label {
|
||||
if l.fileLabel == InvalidLabel {
|
||||
l.fileLabel = l.FileLabelFor(l.tw.path)
|
||||
l.fileLabel = l.FileLabelFor(srcarchive.TransformPath(l.tw.path))
|
||||
}
|
||||
return l.fileLabel
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user