Compare commits

..

35 Commits

Author SHA1 Message Date
45916f61d3
chore: new conf version 2025-06-04 06:38:54 -04:00
58b5f6e803
chore: new conf version 2025-01-27 21:57:45 -05:00
05bc4648c4
chore: keyword conf 2025-01-27 20:50:22 -05:00
b6fa85790f
feat: remove bash -c 2024-11-03 16:51:03 -05:00
8489ad8d86
feat: update tests 2024-11-03 02:23:10 -05:00
ef2c8994b0
feat: update tests 2024-11-03 02:17:27 -05:00
30e52f0c56
feat: update tests 2024-11-03 02:12:25 -05:00
a1adf36186
feat: update tests 2024-11-03 02:05:22 -05:00
bda4664a09
feat: update tests 2024-11-03 02:02:22 -05:00
e47510c014
feat: update tests 2024-11-03 01:59:35 -05:00
e740770605
feat: new tests 2024-11-03 01:19:54 -05:00
e00e6bd275
feat: comppatible for different cppcheck versions 2024-10-23 04:17:20 -04:00
97081f27ad
feat: compatible for different cppcheck versions 2024-10-23 03:59:29 -04:00
0e135d174e
feat: test 2024-10-14 08:03:25 -04:00
fccb1bc04c
fix: typo in cppcheck parser 2024-10-04 06:51:10 -04:00
866e73258c
feat: use CopyInDir 2024-09-22 01:21:49 -04:00
578be035a0
feat: use conf.json 2024-09-19 17:07:45 -04:00
40fe2dbef1
Added .gitignore. 2024-06-20 04:16:06 -04:00
d33b07f18b
feat: output force quit 2024-06-07 01:50:27 -04:00
0815ab90d7 fix(expected.json): fix cppcheck version issue 2024-05-28 22:22:23 +08:00
8b4a93f53c feat(conf.toml,-expected.json): cppcheck sillycode example 2024-05-28 19:48:48 +08:00
10d9e91c62 feat(conf.toml): cppcheck commands 2024-05-27 17:27:17 +08:00
b8cfb31288 docs(README.md): slightly change README 2024-05-27 16:21:45 +08:00
607ac46d34
fix: use clang-tidy-18 2024-05-20 18:14:04 -04:00
a69a7e87fd style(expected.json,-conf.toml): Fix naming convention 2024-05-10 23:22:08 +08:00
a16c54c3ac feat(expected.json): putting two stages together 2024-05-07 16:23:20 +08:00
08d77b0910 feat(conf.toml): putting two stages together 2024-05-07 16:22:11 +08:00
54de5d5229 fix(expected.json): Add result for missing keyword 2024-05-07 16:10:55 +08:00
4b00eacf88 fix(conf.toml): Make the memory limit 4 times larger 2024-05-07 16:00:13 +08:00
580d9c9e20 feat(conf.toml): Added rootdir to config 2024-05-07 14:39:57 +08:00
422868c1c6 fix(expected.json): slightly fix the output format 2024-05-05 21:43:49 +08:00
bb8c33dc62 fix(examples/clang-tidy/sillycode): Update config files 2024-05-05 21:35:49 +08:00
267f23cc74 fix(CMakeLists.txt,-conf.toml,-expected.json): Update config files 2024-05-05 20:49:34 +08:00
a2c3c2f914 fix(.gitignore,-expected.json): fix .gitignore bugs 2024-05-05 19:34:35 +08:00
adb271587b feat: clang-tidy/sillycode 2024-05-05 18:19:05 +08:00
6 changed files with 90 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
joj3_result.json

5
CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.0)
project(MyProject)
add_executable(main src/simple.cpp)

View File

@ -1,3 +1 @@
# JOJ3 examples # cpplint sillycode
Check other branches.

67
conf.json Normal file
View File

@ -0,0 +1,67 @@
{
"stage": {
"stages": [
{
"name": "cppcheck",
"executor": {
"name": "sandbox",
"with": {
"default": {
"args": [
"cppcheck",
"--template={\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}",
"--force",
"--enable=all",
"--quiet",
"."
],
"env": [
"PATH=/usr/bin:/bin:/usr/local/bin"
],
"cpuLimit": 10000000000,
"memoryLimit": 419430400,
"procLimit": 50,
"copyInDir": ".",
"copyOut": [
"stdout"
],
"stdin": {
"content": ""
},
"stdout": {
"name": "stdout",
"max": 65536
},
"stderr": {
"name": "stderr",
"max": 65536
}
}
}
},
"parsers": [
{
"name": "cppcheck",
"with": {
"score": 100,
"matches": [
{
"keywords": [
"doubleFree"
],
"score": 5
},
{
"keywords": [
"memleak"
],
"score": 7
}
]
}
}
]
}
]
}
}

1
expected.json Normal file
View File

@ -0,0 +1 @@
[{"name":"cppcheck","results":[{"score":88,"comment":"### Test results summary\n\n1. `memleak`: 1 occurrence(s), -7 point(s)\n2. `doubleFree`: 1 occurrence(s), -5 point(s)\n"}],"force_quit":false}]

15
src/simple.cpp Normal file
View File

@ -0,0 +1,15 @@
// Memory leak and resource management warnings
void memoryLeaks() {
int *ptr = new int(42);
// Missing delete - memory leak
int const *array = new int[100];
delete ptr; // Wrong deletion type for array
// Double deletion
int *doubleDel = new int(5);
delete doubleDel;
delete doubleDel;
}
int main() { memoryLeaks(); }