chore: import upstream snapshot with attribution
CI / benchmark (push) Has been skipped
install-script / posix-syntax (push) Successful in 6m1s
CI / build-onnx (push) Failing after 6m43s
init-smoke / dry-run (push) Failing after 15m57s
security / govulncheck (push) Has been cancelled
security / trivy-fs (push) Has been cancelled
CI / test (1.26, ubuntu-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
CI / test (1.26, macos-latest) (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / lint (push) Has been cancelled
install-script / powershell-syntax (push) Has been cancelled
install-script / install (macos-14) (push) Has been cancelled
install-script / install (ubuntu-latest) (push) Has been cancelled
CI / benchmark (push) Has been skipped
install-script / posix-syntax (push) Successful in 6m1s
CI / build-onnx (push) Failing after 6m43s
init-smoke / dry-run (push) Failing after 15m57s
security / govulncheck (push) Has been cancelled
security / trivy-fs (push) Has been cancelled
CI / test (1.26, ubuntu-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
CI / test (1.26, macos-latest) (push) Has been cancelled
CI / build-windows (push) Has been cancelled
CI / lint (push) Has been cancelled
install-script / powershell-syntax (push) Has been cancelled
install-script / install (macos-14) (push) Has been cancelled
install-script / install (ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package indexer
|
||||
|
||||
import (
|
||||
"github.com/zzet/gortex/internal/graph"
|
||||
"github.com/zzet/gortex/internal/parser"
|
||||
)
|
||||
|
||||
// stampParseErrors checks the parse tree on result for ERROR/MISSING
|
||||
// nodes and stamps the count plus a boolean flag onto the file node.
|
||||
//
|
||||
// Surfacing this on KindFile lets index_health rank files by parse
|
||||
// failure and lets agents skip badly-broken sources without re-doing
|
||||
// the parse. Files whose extractor doesn't keep result.Tree (rare;
|
||||
// mostly "skip-grammar" stubs that emit a file node and call it
|
||||
// done) get no stamp — absence of the meta key means "unknown", not
|
||||
// "clean".
|
||||
func stampParseErrors(result *parser.ExtractionResult) {
|
||||
if result == nil || result.Tree == nil {
|
||||
return
|
||||
}
|
||||
if !result.Tree.HasParseErrors() {
|
||||
return
|
||||
}
|
||||
count := result.Tree.CountParseErrors()
|
||||
for _, n := range result.Nodes {
|
||||
if n.Kind != graph.KindFile {
|
||||
continue
|
||||
}
|
||||
if n.Meta == nil {
|
||||
n.Meta = map[string]any{}
|
||||
}
|
||||
n.Meta["parse_errors"] = count
|
||||
n.Meta["has_parse_errors"] = true
|
||||
break
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user