From 92c35f92fc184e5b494ef53a24b7e71761c091d1 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Sat, 14 Sep 2024 16:43:21 -0400 Subject: [PATCH] chore: rename parser secret -> dummy --- internal/parsers/all.go | 1 + internal/parsers/{secret => dummy}/meta.go | 6 +++--- internal/parsers/{secret => dummy}/parser.go | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) rename internal/parsers/{secret => dummy}/meta.go (52%) rename internal/parsers/{secret => dummy}/parser.go (61%) diff --git a/internal/parsers/all.go b/internal/parsers/all.go index 8e4e29a..95cbdc6 100644 --- a/internal/parsers/all.go +++ b/internal/parsers/all.go @@ -5,6 +5,7 @@ import ( _ "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/parsers/cppcheck" _ "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/parsers/cpplint" _ "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/parsers/diff" + _ "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/parsers/dummy" _ "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/parsers/healthcheck" _ "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/parsers/keyword" _ "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/parsers/resultstatus" diff --git a/internal/parsers/secret/meta.go b/internal/parsers/dummy/meta.go similarity index 52% rename from internal/parsers/secret/meta.go rename to internal/parsers/dummy/meta.go index 457a77a..fd9ba75 100644 --- a/internal/parsers/secret/meta.go +++ b/internal/parsers/dummy/meta.go @@ -1,9 +1,9 @@ -package secret +package dummy import "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/stage" -var name = "secret" +var name = "dummy" func init() { - stage.RegisterParser(name, &Secret{}) + stage.RegisterParser(name, &Dummy{}) } diff --git a/internal/parsers/secret/parser.go b/internal/parsers/dummy/parser.go similarity index 61% rename from internal/parsers/secret/parser.go rename to internal/parsers/dummy/parser.go index a7902d7..da53cb2 100644 --- a/internal/parsers/secret/parser.go +++ b/internal/parsers/dummy/parser.go @@ -1,16 +1,16 @@ -package secret +package dummy import ( "focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/stage" ) type Conf struct { - Secret string + Comment string } -type Secret struct{} +type Dummy struct{} -func (*Secret) Run(results []stage.ExecutorResult, confAny any) ( +func (*Dummy) Run(results []stage.ExecutorResult, confAny any) ( []stage.ParserResult, bool, error, ) { conf, err := stage.DecodeConf[Conf](confAny) @@ -19,7 +19,7 @@ func (*Secret) Run(results []stage.ExecutorResult, confAny any) ( } var res []stage.ParserResult for range results { - res = append(res, stage.ParserResult{Score: 0, Comment: conf.Secret}) + res = append(res, stage.ParserResult{Score: 0, Comment: conf.Comment}) } return res, false, nil }