clang-tidy parser and executor #26

Merged
张泊明518370910136 merged 26 commits from clang-tidy into master 2024-05-18 02:50:13 +08:00
2 changed files with 0 additions and 6 deletions
Showing only changes of commit 5c42a5f055 - Show all commits

View File

@ -110,7 +110,6 @@ func group_messages(messages []ClangMessage) []ClangMessage {
} }
func convert_paths_to_relative(messages *[]ClangMessage) { func convert_paths_to_relative(messages *[]ClangMessage) {
// currentDir, _ := os.Getwd()
currentDir := "/w" currentDir := "/w"
zjc_he marked this conversation as resolved Outdated

I think it should be part of the config file with default value "/w". Since the work dir in the sandbox can also be changed, it should not be hardcoded.

I think it should be part of the config file with default value `"/w"`. Since the work dir in the sandbox can also be changed, it should not be hardcoded.
for i := range *messages { for i := range *messages {
(*messages)[i].filepath, _ = filepath.Rel(currentDir, (*messages)[i].filepath) (*messages)[i].filepath, _ = filepath.Rel(currentDir, (*messages)[i].filepath)

View File

@ -15,17 +15,12 @@ func get_score(json_messages []json_message, conf Conf) int {
fullmark := conf.Score fullmark := conf.Score
for _, json_message := range json_messages { for _, json_message := range json_messages {
keyword := json_message.Check_name keyword := json_message.Check_name
flag := false
for _, match := range conf.Matches { for _, match := range conf.Matches {
if Contains(match.Keyword, keyword) { if Contains(match.Keyword, keyword) {
fullmark -= match.Score fullmark -= match.Score
flag = true
break break
} }
} }
if !flag {
fullmark -= 1
}
} }
return fullmark return fullmark
} }