clang-tidy parser and executor #26
|
@ -1,8 +1,6 @@
|
|||
package clang_tidy
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/stage"
|
||||
|
@ -28,15 +26,6 @@ func Parse(executorResult stage.ExecutorResult, conf Conf) stage.ParserResult {
|
|||
messages := parse_lines(lines, conf)
|
||||
formatted_messages := format(messages)
|
||||
|
||||
// TODO: Handle the json file (parse into markdown and delete it?)
|
||||
json_file, _ := os.Create("./clangtidy_result.json")
|
||||
defer json_file.Close()
|
||||
|
||||
encoder := json.NewEncoder(json_file)
|
||||
encoder.SetEscapeHTML(false)
|
||||
encoder.SetIndent("", " ")
|
||||
_ = encoder.Encode(formatted_messages)
|
||||
|
||||
// TODO: Handle unexpected errors from executor
|
||||
// if executorResult.Status != stage.Status(envexec.StatusAccepted) {
|
||||
zjc_he marked this conversation as resolved
Outdated
|
||||
// return stage.ParserResult{
|
||||
zjc_he marked this conversation as resolved
Outdated
张泊明518370910136
commented
Do we still need this file? Do we still need this file?
张佳澈520370910044
commented
I don't know. We will need this data for drone, but I don't know where to put it for now. I don't know. We will need this data for drone, but I don't know where to put it for now.
张泊明518370910136
commented
I think running JOJ3 will be the only step in the future. It just provides coast-to-coast experience. I think running JOJ3 will be the only step in the future. It just provides coast-to-coast experience.
张佳澈520370910044
commented
What do you mean? JOJ3 will cover everything and we don't need drone anymore? This data shows the details for all cases, we may need to parse them into markdown in the future, so if we don't need to save it into a file I'll just put it there and wait for future needs What do you mean? JOJ3 will cover everything and we don't need drone anymore?
This data shows the details for all cases, we may need to parse them into markdown in the future, so if we don't need to save it into a file I'll just put it there and wait for future needs
张泊明518370910136
commented
Yes. Drone/Gitea actions will only be used to trigger the running of JOJ3, and JOJ3 should be the only step. We can just leave the details in logs, so if any debug purpose, student can check the output in drone/gitea actions to see. So that we can only give simple and brief feedback and gitea issue comment, which should be enough for most cases. Yes. Drone/Gitea actions will only be used to trigger the running of JOJ3, and JOJ3 should be the only step. We can just leave the details in logs, so if any debug purpose, student can check the output in drone/gitea actions to see. So that we can only give simple and brief feedback and gitea issue comment, which should be enough for most cases.
|
||||
|
|
I think we can uncomment it.
No, as long as the clang-tidy report is not empty, its return value is 1 and the executor result status is Nonzero Exit Status:
Ok, then we can assume clang-tidy do not have unexpected errors for now.
clang-tidy
built in rules based on Libtooling are usually very strong. An alternative approach can be checkingexecutorResult.exitStatus
if we know it will only return 0 and 1.OK