Skip to content

Commit

Permalink
add simple variable validator
Browse files Browse the repository at this point in the history
  • Loading branch information
srietkerk committed Feb 7, 2024
1 parent 5937787 commit d7797e2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/teachertool/catalog-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
"use": "functions_have_comments",
"template": "All function definitions have comments",
"docPath": "/teachertool"
},
{
"id": "D21D76A2-D9FD-4F9B-B0AC-973CB870EA78",
"use": "variable_set",
"template": "At least one variable's value is set",
"docPath": "/teachertool"
},
{
"id": "0173898D-8A48-4266-AAB9-CE934471A734",
"use": "variable_accessed",
"template": "At least one variable is accessed",
"docPath": "/teachertool"
}
]
}
26 changes: 26 additions & 0 deletions docs/teachertool/validator-plans-shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,32 @@
}
}
]
},
{
".desc": "A variable's value is set",
"name": "variable_set",
"threshold": 1,
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"variables_set": 1
}
}
]
},
{
".desc": "A variable's value is used",
"name": "variable_accessed",
"threshold": 1,
"checks": [
{
"validator": "blocksExist",
"blockCounts": {
"variables_get": 1
}
}
]
}
]
}

0 comments on commit d7797e2

Please sign in to comment.