feat(conf.toml,-expected.json): cppcheck sillycode example

This commit is contained in:
张佳澈520370910044 2024-05-28 19:48:48 +08:00
parent 10d9e91c62
commit 8b4a93f53c
2 changed files with 6 additions and 7 deletions

View File

@ -1,10 +1,10 @@
skipGitea = true skipGitea = true
[[stages]] [[stages]]
name = "clangtidy" name = "cppcheck"
[stages.executor] [stages.executor]
name = "sandbox" name = "sandbox"
[stages.executor.with.default] [stages.executor.with.default]
args = ["cppcheck --template='{\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"},' --force --enable=all --quiet src/*.cpp"] args = ["bash","-c","cppcheck --template='{\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}' --force --enable=all --quiet src/*.cpp"]
env = ["PATH=/usr/bin:/bin:/usr/local/bin"] env = ["PATH=/usr/bin:/bin:/usr/local/bin"]
cpuLimit = 10_000_000_000 cpuLimit = 10_000_000_000
memoryLimit = 419_430_400 memoryLimit = 419_430_400
@ -23,13 +23,12 @@ max = 65_536
name = "cppcheck" name = "cppcheck"
[stages.parser.with] [stages.parser.with]
score = 100 score = 100
rootdir = "/w"
[[stages.parser.with.matches]] [[stages.parser.with.matches]]
keyword = ["cppcoreguidelines-avoid-non-const-global-variables"] severity = ["error"]
score = 5 score = 5
[[stages.parser.with.matches]] [[stages.parser.with.matches]]
keyword = ["readability-identifier-length","misc-use-anonymous-namespace"] severity = ["warning"]
score = 2 score = 2
[[stages.parser.with.matches]] [[stages.parser.with.matches]]
keyword = ["llvmlibc-implementation-in-namespace"] severity = ["probability", "performance", "style"]
score = 1 score = 1

View File

@ -1 +1 @@
[{"name":"clangtidy","results":[{"score":-185,"comment":"### Test results summary\n\n1. codequality-unchecked-malloc-result: 0\n2. codequality-no-global-variables: 0\n3. codequality-no-header-guard: 0\n4. codequality-no-fflush-stdin: 0\n5. readability-function-size: 0\n6. readability-duplicate-include: 0\n7. readability-identifier-naming: 0\n8. readability-redundant: 0\n9. readability-misleading-indentation: 0\n10. readability-misplaced-array-index: 0\n11. cppcoreguidelines-init-variables: 0\n12. bugprone-suspicious-string-compare: 0\n13. google-global-names-in-headers: 0\n14. clang-diagnostic: 1\n15. clang-analyzer: 0\n16. misc: 9\n17. performance: 5\n18. others: 185\n"}]}] [{"name":"cppcheck","results":[{"score":95,"comment":"### Test results summary\n\n1. error: 1\n2. warning: 0\n3. probability: 0\n4. performance: 0\n5. style: 0\n6. information: 4"}]}]