diff --git a/sanityCheck b/sanityCheck index 1563ed06ad6905516c16a561ad7b2f46be14a77e..45705bc8e1501cb096f6c5c2bd4403e1a5149b00 100755 --- a/sanityCheck +++ b/sanityCheck @@ -21,7 +21,7 @@ GREP="git grep -n --color" $GREP "<</[^>]*>[^>]" -- 'src/*' | myprint "MissingClosingAngleBracket" $GREP "<<[^>()]*>[^()<>"$'\r]*\r'"\?$" -- 'src/*' | myprint "MissingClosingAngleBracket" # Check for missing left angle bracket: </if>> -$GREP "[^<]</[^<>]*>>" -- 'src/*' | myprint "MissingOpeningAngleBracket2" +$GREP "\([^<]\|^\)</\?\(if\|else\|case\)" -- 'src/*' | myprint "MissingOpeningAngleBracket2" # Check for accidental assignment. e.g.: <<if $foo = "hello">> $GREP "<<[ ]*if[^>=]*[^><\!=]=[^=][^>]*>>" -- 'src/*' | myprint "AccidentalAssignmentInIf" # Check for missing ". e.g.: <<if $foo = "hello>> @@ -63,6 +63,8 @@ $GREP "=to" -- 'src/*' | myprint "EqualAndTo" $GREP -e "[$]slaves[.]" --and --not -e '[$]slaves[.]\(length\|random\|map\|filter\|deleteAt\|push\)' -- 'src/*' | myprint "MissingSlavesIndex" # Try to check for accidentally mixing slaves[] and activeSlave. This can have a lot of false matches, but has caught a lot of bugs so it's worth the pain $GREP -e "activeSlave[.]" --and -e "slaves\[..\?\][.]" --and --not -e '[.]ID' --and --not -e 'slaves\[..\?\][.]\(slaveName\|actualAge\|relation\|assignment\|age\|devotion\|trust\|vagina\)' -- 'src/*' | myprint "MaybeAccidentalMixingOfSlavesAndActiveSlave" +# Check, e.g. <<set foo == 4>> +$GREP "<<set[^{>=]*==" -- 'src/*' | myprint "DoubleEqualsInSet" # Check that we do not have any variables that we use only once. e.g. $onlyUsedOnce (