fix(internal/clang_tidy/score.go): Unlisted keywords will be 0 point rather than 1
This commit is contained in:
parent
f68bbef4a6
commit
5c42a5f055
|
@ -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"
|
||||||
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)
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user