From 9c3af11a9ea8bd7eaa2a4a538a15331cc4c8c3fe Mon Sep 17 00:00:00 2001 From: pregmodfan <pregmodfan@cock.li> Date: Sun, 21 May 2017 12:14:16 +0300 Subject: [PATCH] sanityChecker updates from vanila (and tweaks for pregmod) --- devTools/spell_check.txt | 1 + sanityCheck | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/devTools/spell_check.txt b/devTools/spell_check.txt index 3c0098d47d6..382e0999b0f 100644 --- a/devTools/spell_check.txt +++ b/devTools/spell_check.txt @@ -3724,6 +3724,7 @@ s/\bthrid\b/third/g s/\bthrorough\b/thorough/g s/\bthroughly\b/thoroughly/g s/\bthrougout\b/throughout/g +s/\bthru\b/through/g s/\bthsi\b/this/g s/\bthsoe\b/those/g s/\bthta\b/that/g diff --git a/sanityCheck b/sanityCheck index f1b9e1a7476..1784ec0196d 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 "\([^<]\|^\)</\?\(if\|else\|case\)" -- 'src/*' | myprint "MissingOpeningAngleBracket2" +$GREP "\([^<]\|^\)</\?\(if\|else\|case\|set\|print\|elseif\)" -- 'src/*' | myprint "MissingOpeningAngleBracket2" # Check for accidental assignment. e.g.: <<if $foo = "hello">> $GREP "<<[ ]*if[^>=]*[^><\!=]=[^=][^>]*>>" -- 'src/*' | myprint "AccidentalAssignmentInIf" # Check for accidental assignment. e.g.: <<elseif $foo = "hello">> @@ -75,6 +75,15 @@ $GREP -e "<<[a-zA-Z]\([^>\"]\|[^>]>[^>]\|\"[^\"]*\"\)* [a-zA-Z]\+ * =" -- src/*. $GREP -e "<<[a-zA-Z]* = *" -- src/*.tw | myprint "BadCommand" # 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" +# Check for obsolete SugarCube macros +$GREP -E "<<display|<<click|<<.*\.contains" -- src/*.tw | myprint "ObsoleteMacro" +# Check for double articles +$GREP -E "\Wa an\W" -- src/*.tw | myprint "DoubleArticle" +# Check for incorrect articles +$GREP -i -E "\Wa (a|e|i|o|u)." -- src/*.tw | grep -i -vE "\Wa (un|eu|us|ut|on|ur|in)." | grep -i -vE "(&|<<s>>|UM)." | myprint "IncorrectArticle" +$GREP -i -E "\Wan (b|c|d|f|g|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z)\w." -- src/*.tw | grep -i -vE "[A-Z]{3}" | myprint "IncorrectArticle" +# Check for $ sign mid-word +$GREP -i "\w$\w" -- src/*.tw | myprint "VarSignMidWord" # Check that we do not have any variables that we use only once. e.g. $onlyUsedOnce # Ignore *Nationalities -- GitLab