Compare commits
No commits in common. "master" and "keyword/script" have entirely different histories.
master
...
keyword/sc
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
joj3_result.json
|
63
conf.json
Normal file
63
conf.json
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
"stage": {
|
||||||
|
"stages": [
|
||||||
|
{
|
||||||
|
"name": "keyword",
|
||||||
|
"executor": {
|
||||||
|
"name": "sandbox",
|
||||||
|
"with": {
|
||||||
|
"default": {
|
||||||
|
"args": [
|
||||||
|
"bash",
|
||||||
|
"-c",
|
||||||
|
". ./src/lib.sh; check_files ./src/assets"
|
||||||
|
],
|
||||||
|
"env": [
|
||||||
|
"PATH=/usr/bin:/bin:/usr/local/bin"
|
||||||
|
],
|
||||||
|
"cpuLimit": 10000000000,
|
||||||
|
"memoryLimit": 104857600,
|
||||||
|
"procLimit": 50,
|
||||||
|
"copyInDir": ".",
|
||||||
|
"copyOut": [
|
||||||
|
"stdout",
|
||||||
|
"stderr"
|
||||||
|
],
|
||||||
|
"stdin": {
|
||||||
|
"content": ""
|
||||||
|
},
|
||||||
|
"stdout": {
|
||||||
|
"name": "stdout",
|
||||||
|
"max": 65536
|
||||||
|
},
|
||||||
|
"stderr": {
|
||||||
|
"name": "stderr",
|
||||||
|
"max": 65536
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parsers": [
|
||||||
|
{
|
||||||
|
"name": "keyword",
|
||||||
|
"with": {
|
||||||
|
"score": 100,
|
||||||
|
"files": [
|
||||||
|
"stdout"
|
||||||
|
],
|
||||||
|
"forceQuitOnDeduct": true,
|
||||||
|
"matches": [
|
||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"check files error"
|
||||||
|
],
|
||||||
|
"score": 5
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
1
expected.json
Normal file
1
expected.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
[{"name":"keyword","results":[{"score":95,"comment":"1. `check files error`: 1 occurrence(s), -5 point(s)\n"}],"force_quit":true}]
|
0
src/assets/0.txt
Normal file
0
src/assets/0.txt
Normal file
0
src/assets/1.txt
Normal file
0
src/assets/1.txt
Normal file
7
src/lib.sh
Normal file
7
src/lib.sh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# count file number in a given directory
|
||||||
|
function check_files() {
|
||||||
|
file_count=$(find $1 -type f | wc -l)
|
||||||
|
if [ $file_count -ge 1 ]; then
|
||||||
|
echo "check files error: more than 1 file found in $1!"
|
||||||
|
fi
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user