fix: typo in cppcheck parser
This commit is contained in:
parent
822882f556
commit
15a6800685
|
@ -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
|
|
@ -7,10 +7,11 @@ type Severity int
|
||||||
const (
|
const (
|
||||||
ERROR Severity = iota
|
ERROR Severity = iota
|
||||||
WARNING
|
WARNING
|
||||||
PROBABILITY
|
PORTABILITY
|
||||||
PERFORMANCE
|
PERFORMANCE
|
||||||
STYLE
|
STYLE
|
||||||
INFORMATION
|
INFORMATION
|
||||||
|
DEBUG
|
||||||
UNKNOWN
|
UNKNOWN
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,14 +21,16 @@ func severityFromString(severityString string) (Severity, error) {
|
||||||
return ERROR, nil
|
return ERROR, nil
|
||||||
case "warning":
|
case "warning":
|
||||||
return WARNING, nil
|
return WARNING, nil
|
||||||
case "probability":
|
case "portability":
|
||||||
return PROBABILITY, nil
|
return PORTABILITY, nil
|
||||||
case "performance":
|
case "performance":
|
||||||
return PERFORMANCE, nil
|
return PERFORMANCE, nil
|
||||||
case "style":
|
case "style":
|
||||||
return STYLE, nil
|
return STYLE, nil
|
||||||
case "information":
|
case "information":
|
||||||
return INFORMATION, nil
|
return INFORMATION, nil
|
||||||
|
case "debug":
|
||||||
|
return DEBUG, nil
|
||||||
default:
|
default:
|
||||||
return UNKNOWN, fmt.Errorf("unknown severity type \"%s\" for cppcheck", severityString)
|
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) {
|
func GetResult(records []Record, conf Conf) (string, int, error) {
|
||||||
result := "### Test results summary\n\n"
|
result := "### Test results summary\n\n"
|
||||||
var severityCounts [6]int
|
var severityCounts [UNKNOWN]int
|
||||||
var severityScore [6]int
|
var severityScore [UNKNOWN]int
|
||||||
score := conf.Score
|
score := conf.Score
|
||||||
|
|
||||||
for _, match := range conf.Matches {
|
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("1. error: %d\n", severityCounts[0])
|
||||||
result += fmt.Sprintf("2. warning: %d\n", severityCounts[1])
|
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("4. performance: %d\n", severityCounts[3])
|
||||||
result += fmt.Sprintf("5. style: %d\n", severityCounts[4])
|
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
|
return result, score, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user