Compare commits

..

No commits in common. "5bbbcb14aae72f97ec5e826c947a1a805276ca19" and "69b2115a7339d58fc54180ba590d5228f4ba3ad6" have entirely different histories.

33 changed files with 21 additions and 22 deletions

View File

@ -6,8 +6,8 @@ import (
"os"
"github.com/joint-online-judge/JOJ3/cmd/joj3/conf"
executors "github.com/joint-online-judge/JOJ3/internal/executor"
_ "github.com/joint-online-judge/JOJ3/internal/parser"
"github.com/joint-online-judge/JOJ3/internal/executors"
_ "github.com/joint-online-judge/JOJ3/internal/parsers"
"github.com/joint-online-judge/JOJ3/internal/stage"
"github.com/jinzhu/copier"

View File

@ -1,8 +1,8 @@
package executors
import (
_ "github.com/joint-online-judge/JOJ3/internal/executor/dummy"
"github.com/joint-online-judge/JOJ3/internal/executor/sandbox"
_ "github.com/joint-online-judge/JOJ3/internal/executors/dummy"
"github.com/joint-online-judge/JOJ3/internal/executors/sandbox"
)
// this file does nothing but imports to ensure all the init() functions

View File

@ -1,16 +0,0 @@
package parsers
import (
_ "github.com/joint-online-judge/JOJ3/internal/parser/clangtidy"
_ "github.com/joint-online-judge/JOJ3/internal/parser/cppcheck"
_ "github.com/joint-online-judge/JOJ3/internal/parser/cpplint"
_ "github.com/joint-online-judge/JOJ3/internal/parser/diff"
_ "github.com/joint-online-judge/JOJ3/internal/parser/dummy"
_ "github.com/joint-online-judge/JOJ3/internal/parser/healthcheck"
_ "github.com/joint-online-judge/JOJ3/internal/parser/keyword"
_ "github.com/joint-online-judge/JOJ3/internal/parser/resultstatus"
_ "github.com/joint-online-judge/JOJ3/internal/parser/sample"
)
// this file does nothing but imports to ensure all the init() functions
// in the subpackages are called

16
internal/parsers/all.go Normal file
View File

@ -0,0 +1,16 @@
package parsers
import (
_ "github.com/joint-online-judge/JOJ3/internal/parsers/clangtidy"
_ "github.com/joint-online-judge/JOJ3/internal/parsers/cppcheck"
_ "github.com/joint-online-judge/JOJ3/internal/parsers/cpplint"
_ "github.com/joint-online-judge/JOJ3/internal/parsers/diff"
_ "github.com/joint-online-judge/JOJ3/internal/parsers/dummy"
_ "github.com/joint-online-judge/JOJ3/internal/parsers/healthcheck"
_ "github.com/joint-online-judge/JOJ3/internal/parsers/keyword"
_ "github.com/joint-online-judge/JOJ3/internal/parsers/resultstatus"
_ "github.com/joint-online-judge/JOJ3/internal/parsers/sample"
)
// this file does nothing but imports to ensure all the init() functions
// in the subpackages are called

View File

@ -87,9 +87,8 @@ func (*Diff) Run(results []stage.ExecutorResult, confAny any) (
// Generate diff block with surrounding context
diffOutput := generateDiffWithContext(
stdoutLines, resultLines, diffOps)
diffOutput = strings.TrimSuffix(diffOutput, "\n \n")
comment += fmt.Sprintf(
"```diff\n%s\n```\n",
"```diff\n%s```\n",
diffOutput,
)
}