fix: typo in cppcheck parser
All checks were successful
build / build (push) Successful in 1m20s
build / trigger-build-image (push) Successful in 5s

This commit is contained in:
张泊明518370910136 2024-10-04 06:52:06 -04:00
parent 822882f556
commit 15a6800685
GPG Key ID: D47306D7062CDA9D
8 changed files with 18 additions and 14 deletions

@ -1 +1 @@
Subproject commit 866e73258c2d8f87b0000754a16f9b9c7de0c0fa
Subproject commit fccb1bc04ccd0df5f3855dbf73a142f876eab94e

@ -1 +1 @@
Subproject commit 146b2f829a91594c89f1d1379d312b91c5f97a55
Subproject commit 6d82a1344fbbd994e8c63428e5c1759bd7ef4f6f

@ -1 +1 @@
Subproject commit ffd9ab13c7e403d0afc7f1dfc86ec131f9992498
Subproject commit 1e1d15265956703a14efb52a1aef82f2fecee46b

@ -1 +1 @@
Subproject commit b93a0254c2842e4d9c3a4b8f832cd6b17bf284f9
Subproject commit a384a00736523d674851b6a58b383487b7328144

@ -1 +1 @@
Subproject commit b4693716ee97bd5d9814c512b036aabeb12c7fd6
Subproject commit c7c905ebcfad171e0edba0485358744c49aad6e2

@ -1 +1 @@
Subproject commit 9c010a0f8d501223f94d677a4aed70f0162092e2
Subproject commit adb9a3b5922274725801b5c18e42aafca7540ec1

@ -1 +1 @@
Subproject commit 99d95c2841517f36a2063c641ea2e1b9b6190c76
Subproject commit dd11177f3c3cf21728a84d808595de887fe4807a

View File

@ -7,10 +7,11 @@ type Severity int
const (
ERROR Severity = iota
WARNING
PROBABILITY
PORTABILITY
PERFORMANCE
STYLE
INFORMATION
DEBUG
UNKNOWN
)
@ -20,14 +21,16 @@ func severityFromString(severityString string) (Severity, error) {
return ERROR, nil
case "warning":
return WARNING, nil
case "probability":
return PROBABILITY, nil
case "portability":
return PORTABILITY, nil
case "performance":
return PERFORMANCE, nil
case "style":
return STYLE, nil
case "information":
return INFORMATION, nil
case "debug":
return DEBUG, nil
default:
return UNKNOWN, fmt.Errorf("unknown severity type \"%s\" for cppcheck", severityString)
}
@ -35,8 +38,8 @@ func severityFromString(severityString string) (Severity, error) {
func GetResult(records []Record, conf Conf) (string, int, error) {
result := "### Test results summary\n\n"
var severityCounts [6]int
var severityScore [6]int
var severityCounts [UNKNOWN]int
var severityScore [UNKNOWN]int
score := conf.Score
for _, match := range conf.Matches {
@ -58,9 +61,10 @@ func GetResult(records []Record, conf Conf) (string, int, error) {
}
result += fmt.Sprintf("1. error: %d\n", severityCounts[0])
result += fmt.Sprintf("2. warning: %d\n", severityCounts[1])
result += fmt.Sprintf("3. probability: %d\n", severityCounts[2])
result += fmt.Sprintf("3. portability: %d\n", severityCounts[2])
result += fmt.Sprintf("4. performance: %d\n", severityCounts[3])
result += fmt.Sprintf("5. style: %d\n", severityCounts[4])
result += fmt.Sprintf("6. information: %d", severityCounts[5])
result += fmt.Sprintf("6. information: %d\n", severityCounts[5])
result += fmt.Sprintf("7. debug: %d\n", severityCounts[6])
return result, score, nil
}