feat(parser/diff): default max diff length 2048
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 1m20s
build / trigger-build-image (push) Successful in 7s

This commit is contained in:
张泊明518370910136 2024-11-04 09:00:04 -05:00
parent e5ae6fc223
commit 0b841dd730
GPG Key ID: D47306D7062CDA9D

View File

@ -30,7 +30,7 @@ type Conf struct {
CompareSpace bool
AlwaysHide bool
ForceQuitOnDiff bool
MaxDiffLength int
MaxDiffLength int `default:"2048"` // just for reference
}
}
}
@ -83,7 +83,9 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
// Generate Myers diff
diffOps := myersDiff(stdoutLines, resultLines)
if output.MaxDiffLength == 0 { // real default value
output.MaxDiffLength = 2048
}
// Generate diff block with surrounding context
diffOutput := generateDiffWithContext(
stdoutLines, resultLines, diffOps, output.MaxDiffLength)