diff --git a/devTools/check.py b/devTools/check.py index a995652213dbecb02dbe81b729dacc2de4726281..364d4260df0a1929098e9e0e77ef1c87b087faf8 100755 --- a/devTools/check.py +++ b/devTools/check.py @@ -25,7 +25,7 @@ def yield_line_and_islastline(f): prevline = line yield prevline, True -pattern = re.compile(r'(<<(\/?) *(if|for|else|switch|case)[^<>]*)') +pattern = re.compile(r'(<<(\/?) *(if|for|else|switch|case|replace|link)[^<>]*)') tagfound = [] diff --git a/devTools/spell_check.txt b/devTools/spell_check.txt index 0e58c3c02344743c3ca1ecad1bf2e3accc145143..382e0999b0faf9d5fa5f470542d0a147f9478dbe 100644 --- a/devTools/spell_check.txt +++ b/devTools/spell_check.txt @@ -248,7 +248,6 @@ s/\balreayd\b/already/g s/\balse\b/else/g s/\balsot\b/also/g s/\balternitives\b/alternatives/g -s/\baltho\b/although/g s/\balthought\b/although/g s/\baltough\b/although/g s/\balwasy\b/always/g @@ -2333,7 +2332,6 @@ s/\bmomento\b/memento/g s/\bmonestaries\b/monasteries/g s/\bmonickers\b/monikers/g s/\bmonolite\b/monolithic/g -s/\bMonserrat\b/Montserrat/g s/\bmontains\b/mountains/g s/\bmontanous\b/mountainous/g s/\bMontnana\b/Montana/g diff --git a/sanityCheck b/sanityCheck index 7571ed8fc0079bd98179c9a0cd37a959967c6bd6..8a552a37bcb211f0a841737b3afbb92c18c13eb9 100755 --- a/sanityCheck +++ b/sanityCheck @@ -57,8 +57,6 @@ $GREP "\$PC.refreshmentType[^ =]" -- 'src/*' | myprint "ShouldBeRefreshment" $GREP "<</[a-zA-Z]*[^a-zA-Z<>]\+[a-zA-Z]*>>" -- 'src/*' | myprint "DoubleSlash" # Check, e.g. <<else $foo==4 $GREP "<<else >\?[^>]" -- 'src/*' | myprint "ShouldBeElseIf" -# Check, e.g. <</else>> -$GREP "<<[/]else" -- 'src/*' | myprint "Extra slash" # Check, e.g., =to $GREP "=to" -- 'src/*' | myprint "EqualAndTo" # Check doing $slaves.foo instead of $slaves[i].foo @@ -70,13 +68,15 @@ $GREP "<<set[^{>=]*==" -- 'src/*' | myprint "DoubleEqualsInSet" # Check for, e.g <<if slaves[foo]>> $GREP "<<\([^>]\|[^>]>[^>]\)*[^$]slaves\[" -- 'src/*' | myprint "MissingDollar" # Check for duplicate words, e.g. with with -$GREP -e " \(\b[a-zA-Z][a-zA-Z]\+\) \1\b " --and --not -e " her her " --and --not -e " you you " --and --not -e " that that " --and --not -e " in in " --and --not -e " is is "-- 'src/*' | myprint "Duplicate words" +$GREP -e " \(\b[a-zA-Z][a-zA-Z]\+\) \1\b " --and --not -e " her her " --and --not -e " you you " --and --not -e " that that " --and --not -e " in in " --and --not -e " is is " -- 'src/*' | myprint "Duplicate words" # Check that we do not have any variables that we use only once. e.g. $onlyUsedOnce # Ignore *Nationalities ( cd src/ -cat $(find . -name "*.tw" ) | tr -c '$a-zA-Z' '\n' | sed -n '/^[$]/p' | grep -v "Nationalities" | sort | uniq -c | grep ' 1 ' | sed 's/^ *1 [$]/-e[$]/' | sed 's/$/\\\\W/' | xargs -r git grep -n --color | myprint "OnlyUsedOnce" +cat $(find . -name "*.tw" ) | tr -c '$a-zA-Z' '\n' | sed -n '/^[$]/p' | grep -v "Nationalities" | sort | uniq -u | sed 's/^[$]/-e[$]/' | sed 's/$/\\\\W/' | xargs -r git grep -n --color | myprint "OnlyUsedOnce" +cat $(find . -name "*.tw" ) | tr -c '.$a-zA-Z[]_' '\n' | sed -n -e 's/^[$]\(activeSlave\|\(slaves\|tanks\)\[[^]]*\]*\)[.]\([a-zA-Z]*\).*$/[.]\3/p' | sort | uniq -u |sed 's/^\(.*\)$/-e\1\\\\\b/' | xargs -r git grep -n --color | myprint "SlaveAttributeUsedOnce" + )