Compare commits

...

2 Commits

Author SHA1 Message Date
5bbbcb14aa
refactor(internal): rename executor & parser dir
Some checks failed
build / build (push) Successful in 2m3s
build / trigger-build-image (push) Successful in 8s
submodules sync / sync (push) Failing after 30s
2024-10-09 05:38:30 -04:00
d80704643a
feat(parser/diff): remove diff output suffix 2024-10-09 05:36:12 -04:00
33 changed files with 22 additions and 21 deletions

View File

@ -6,8 +6,8 @@ import (
"os"
"github.com/joint-online-judge/JOJ3/cmd/joj3/conf"
"github.com/joint-online-judge/JOJ3/internal/executors"
_ "github.com/joint-online-judge/JOJ3/internal/parsers"
executors "github.com/joint-online-judge/JOJ3/internal/executor"
_ "github.com/joint-online-judge/JOJ3/internal/parser"
"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/executors/dummy"
"github.com/joint-online-judge/JOJ3/internal/executors/sandbox"
_ "github.com/joint-online-judge/JOJ3/internal/executor/dummy"
"github.com/joint-online-judge/JOJ3/internal/executor/sandbox"
)
// this file does nothing but imports to ensure all the init() functions

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

@ -0,0 +1,16 @@
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

View File

@ -87,8 +87,9 @@ 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",
"```diff\n%s\n```\n",
diffOutput,
)
}

View File

@ -1,16 +0,0 @@
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