Compare commits
No commits in common. "5d5bc2144749477eb112b3e69b706db9b5570b8f" and "cc435f915600a9ef3eea895f333b5035613cac58" have entirely different histories.
5d5bc21447
...
cc435f9156
|
@ -30,7 +30,7 @@ type Conf struct {
|
||||||
CompareSpace bool
|
CompareSpace bool
|
||||||
AlwaysHide bool
|
AlwaysHide bool
|
||||||
ForceQuitOnDiff bool
|
ForceQuitOnDiff bool
|
||||||
MaxDiffLength int
|
MaxDiffSize int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
|
|
||||||
// Generate diff block with surrounding context
|
// Generate diff block with surrounding context
|
||||||
diffOutput := generateDiffWithContext(
|
diffOutput := generateDiffWithContext(
|
||||||
stdoutLines, resultLines, diffOps, output.MaxDiffLength)
|
stdoutLines, resultLines, diffOps, output.MaxDiffSize)
|
||||||
diffOutput = strings.TrimSuffix(diffOutput, "\n \n")
|
diffOutput = strings.TrimSuffix(diffOutput, "\n \n")
|
||||||
comment += fmt.Sprintf(
|
comment += fmt.Sprintf(
|
||||||
"```diff\n%s\n```\n",
|
"```diff\n%s\n```\n",
|
||||||
|
|
|
@ -15,7 +15,6 @@ type Conf struct {
|
||||||
ShowMemory bool `default:"true"`
|
ShowMemory bool `default:"true"`
|
||||||
ShowRunTime bool `default:"false"`
|
ShowRunTime bool `default:"false"`
|
||||||
ShowFiles []string
|
ShowFiles []string
|
||||||
MaxFilesLength int `default:"2048"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResultDetail struct{}
|
type ResultDetail struct{}
|
||||||
|
@ -57,9 +56,6 @@ func (*ResultDetail) Run(results []stage.ExecutorResult, confAny any) (
|
||||||
content, ok := result.Files[file]
|
content, ok := result.Files[file]
|
||||||
comment += fmt.Sprintf("File `%s`:\n", file)
|
comment += fmt.Sprintf("File `%s`:\n", file)
|
||||||
if ok {
|
if ok {
|
||||||
if conf.MaxFilesLength > 0 && len(content) > conf.MaxFilesLength {
|
|
||||||
content = content[:conf.MaxFilesLength] + "\n\n(truncated)"
|
|
||||||
}
|
|
||||||
comment += fmt.Sprintf("```\n%s\n```\n", content)
|
comment += fmt.Sprintf("```\n%s\n```\n", content)
|
||||||
} else {
|
} else {
|
||||||
comment += "Not found.\n"
|
comment += "Not found.\n"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user