Skip to content
Snippets Groups Projects
Commit a576be5e authored by Stuffed's avatar Stuffed
Browse files

sanityCheck - add check that variables in init.twee are in version-update.twee

parent 4fe1db86
No related branches found
No related tags found
1 merge request!32Add devCheck and fix sanityCheck and fix bugs it found
......@@ -93,6 +93,12 @@ find . -name "*.twee" -exec cat '{}' ';' | tr -c '$a-zA-Z' '\n' | sed -n '/^[$]
find . -name "*.twee" -exec cat '{}' ';' | tr -c '.$a-zA-Z[]_' '\n' | sed 's/SugarCube\.State\.variables\./$/g' | sed -n -e 's/^[$]\(PC\|activeSlave\|\(slaves\|tanks\)\[[^]]*\]*\)[.]\([a-zA-Z]\+\).*$/[.]\3/p' | sort | uniq -u |sed 's/^\(.*\)$/-e\1\\\\\b/' | xargs -r git grep -n --color | myprint "SlaveAttributeUsedOnce"
$GREP "\$\(PC\|activeSlave\|slaves\|tanks\)[.][^a-zA-Z]" | myprint "UnexpectedCharAfterDot"
#Find all the variables listed in init.twee
VARIABLELIST=$(cat base-system/init.twee | tr -c '$a-zA-Z' '\n' | sed -n '/^[$]/p' | sort | uniq)
# Find all variables anywhere. Commented out because the output is too noisy currently
#VARIABLELIST=$(find . -name "*.twee" -exec cat '{}' ';' | tr -c '$a-zA-Z' '\n' | sed -n '/^[$]/p' | sort | uniq)
MISSINGFROMVERSIONUPDATE=$(for variable in $VARIABLELIST; do grep -q "$variable" base-system/version-update.twee || echo "$variable"; done)
echo -e "base-system/version-update.twee$ENDC: $(echo $MISSINGFROMVERSIONUPDATE)" | myprint "MissingFromVersionUpdate"
)
git ls-files "game/*.twee" | xargs -d '\n' ./devTools/check.py
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment