fix(internal/clang_tidy/score.go): Unlisted keywords will be 0 point rather than 1
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing

This commit is contained in:
张佳澈520370910044 2024-05-05 20:57:33 +08:00
parent f68bbef4a6
commit 5c42a5f055
2 changed files with 0 additions and 6 deletions

View File

@ -110,7 +110,6 @@ func group_messages(messages []ClangMessage) []ClangMessage {
}
func convert_paths_to_relative(messages *[]ClangMessage) {
// currentDir, _ := os.Getwd()
currentDir := "/w"
for i := range *messages {
(*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
for _, json_message := range json_messages {
keyword := json_message.Check_name
flag := false
for _, match := range conf.Matches {
if Contains(match.Keyword, keyword) {
fullmark -= match.Score
flag = true
break
}
}
if !flag {
fullmark -= 1
}
}
return fullmark
}