diff --git a/examples/clangtidy/sillycode b/examples/clangtidy/sillycode index 607ac46..34f1bcd 160000 --- a/examples/clangtidy/sillycode +++ b/examples/clangtidy/sillycode @@ -1 +1 @@ -Subproject commit 607ac46d3421fd145f2a1f0dbcba9e37f7563be9 +Subproject commit 34f1bcd9cf3e2905ecfd95284b25eae2568d38df diff --git a/examples/compile/error b/examples/compile/error index dc7be30..9f0d88e 160000 --- a/examples/compile/error +++ b/examples/compile/error @@ -1 +1 @@ -Subproject commit dc7be30db1fbfd83ecb78f214cff3f42732a1365 +Subproject commit 9f0d88eff4e9d7d3ac58f460609272f7d2e527e7 diff --git a/examples/compile/success b/examples/compile/success index 21f6df7..a900711 160000 --- a/examples/compile/success +++ b/examples/compile/success @@ -1 +1 @@ -Subproject commit 21f6df70d483f34a99b50335e0a1fbe50d3a82dd +Subproject commit a90071148cb7e39cf3e93b18a1e71632d7e974a3 diff --git a/examples/cppcheck/sillycode b/examples/cppcheck/sillycode index 0815ab9..d33b07f 160000 --- a/examples/cppcheck/sillycode +++ b/examples/cppcheck/sillycode @@ -1 +1 @@ -Subproject commit 0815ab90d72641fc274231c075282567e9e17865 +Subproject commit d33b07f18bf36c77dcf9a012d265dc7bd45fac9f diff --git a/examples/cpplint/sillycode b/examples/cpplint/sillycode index a700156..6d47ed4 160000 --- a/examples/cpplint/sillycode +++ b/examples/cpplint/sillycode @@ -1 +1 @@ -Subproject commit a7001564a22f9807119efb7b8f4cf6f74d4c12fc +Subproject commit 6d47ed4f6f7b8632784513edd8a206689503fc56 diff --git a/examples/dummy/error b/examples/dummy/error index 6cbfd9f..9cf0d99 160000 --- a/examples/dummy/error +++ b/examples/dummy/error @@ -1 +1 @@ -Subproject commit 6cbfd9ff1ea95cd5c6c5f832e99cda6f9f2ea851 +Subproject commit 9cf0d994aa613dc38f2bc99f42d0dd7509c3d42c diff --git a/examples/dummy/success b/examples/dummy/success index b1afead..c2fe51b 160000 --- a/examples/dummy/success +++ b/examples/dummy/success @@ -1 +1 @@ -Subproject commit b1afead762d2b2704823af83847c9155c6a1422b +Subproject commit c2fe51b4cd485339fd18924196b01eed6848ba1d diff --git a/examples/keyword/clangtidy/sillycode b/examples/keyword/clangtidy/sillycode index 51160e0..9de8a32 160000 --- a/examples/keyword/clangtidy/sillycode +++ b/examples/keyword/clangtidy/sillycode @@ -1 +1 @@ -Subproject commit 51160e0a0cb01159fa264435865185083d756b06 +Subproject commit 9de8a32bc3a55f0652d487421384d0a163bf0aaa diff --git a/examples/keyword/cpplint/sillycode b/examples/keyword/cpplint/sillycode index f43b0b3..9be8c3c 160000 --- a/examples/keyword/cpplint/sillycode +++ b/examples/keyword/cpplint/sillycode @@ -1 +1 @@ -Subproject commit f43b0b3a7b873ee935b19e4e5f26a8ceda7d3d61 +Subproject commit 9be8c3c329342059f49683a4e810938e8321adbe diff --git a/internal/parsers/keyword/parser.go b/internal/parsers/keyword/parser.go index ccf0c0f..f7890fe 100644 --- a/internal/parsers/keyword/parser.go +++ b/internal/parsers/keyword/parser.go @@ -55,13 +55,13 @@ func (*Keyword) Run(results []stage.ExecutorResult, confAny any) ( return nil, true, err } var res []stage.ParserResult - end := false + forceQuit := false for _, result := range results { tmp, matched := Parse(result, *conf) if matched && conf.EndOnMatch { - end = true + forceQuit = true } res = append(res, tmp) } - return res, end, nil + return res, forceQuit, nil } diff --git a/internal/parsers/resultstatus/parser.go b/internal/parsers/resultstatus/parser.go index b023a76..3b1aad3 100644 --- a/internal/parsers/resultstatus/parser.go +++ b/internal/parsers/resultstatus/parser.go @@ -19,12 +19,12 @@ func (*ResultStatus) Run(results []stage.ExecutorResult, confAny any) ( if err != nil { return nil, true, err } - end := false + forceQuit := false var res []stage.ParserResult for _, result := range results { comment := "" if result.Status != stage.Status(envexec.StatusAccepted) { - end = true + forceQuit = true comment = fmt.Sprintf( "Unexpected executor status: %s.", result.Status, ) @@ -34,5 +34,5 @@ func (*ResultStatus) Run(results []stage.ExecutorResult, confAny any) ( Comment: comment, }) } - return res, end, nil + return res, forceQuit, nil } diff --git a/internal/stage/model.go b/internal/stage/model.go index 1b052d8..cb33462 100644 --- a/internal/stage/model.go +++ b/internal/stage/model.go @@ -164,6 +164,7 @@ type ParserResult struct { } type StageResult struct { - Name string `json:"name"` - Results []ParserResult `json:"results"` + Name string `json:"name"` + Results []ParserResult `json:"results"` + ForceQuit bool `json:"force_quit"` } diff --git a/internal/stage/run.go b/internal/stage/run.go index 6c74758..670f666 100644 --- a/internal/stage/run.go +++ b/internal/stage/run.go @@ -26,17 +26,18 @@ func Run(stages []Stage) []StageResult { slog.Error("parser not found", "name", stage.ParserName) break } - parserResults, end, err := parser.Run(executorResults, stage.ParserConf) + parserResults, forceQuit, err := parser.Run(executorResults, stage.ParserConf) if err != nil { slog.Error("parser run error", "name", stage.ExecutorName, "error", err) break } slog.Debug("parser run done", "results", parserResults) stageResults = append(stageResults, StageResult{ - Name: stage.Name, - Results: parserResults, + Name: stage.Name, + Results: parserResults, + ForceQuit: forceQuit, }) - if end { + if forceQuit { break } } diff --git a/scripts/prepare_test_repos.sh b/scripts/prepare_test_repos.sh index 5efa0ae..fc877b4 100755 --- a/scripts/prepare_test_repos.sh +++ b/scripts/prepare_test_repos.sh @@ -9,8 +9,8 @@ mkdir -p $submodules_dir submodules=$(git config --file .gitmodules --get-regexp path | awk '{ print $2 }') for submodule in $submodules; do url=$(git config --file .gitmodules --get-regexp "submodule.$submodule.url" | awk '{ print $2 }') + branch=$(git config --file .gitmodules --get-regexp "submodule.$submodule.branch" | awk '{ print $2 }') repo_name=$(echo $url | rev | cut -d'/' -f 1 | rev | cut -d'.' -f 1) - commit=$(git submodule status $submodule | awk '{ print $1 }' | sed 's/^[+-]//') repo_dir="$tmp_dir/$repo_name" if [[ ! -v repo_names["$repo_name"] ]]; then if [ ! -d "$repo_dir" ]; then @@ -23,7 +23,7 @@ for submodule in $submodules; do fi repo_names[$repo_name]=1 cd $repo_dir - git checkout -q $commit + git checkout -q $branch cd - submodule_dir="$submodules_dir/$repo_name/$submodule" mkdir -p $submodule_dir