diff --git a/devTools/javaSanityCheck/SanityCheck.jar b/devTools/javaSanityCheck/SanityCheck.jar index f19e52f690973f356affb974151449cdce45adcc..d3a8308ba6cdda45f1a77310e03beb5d979514d2 100644 Binary files a/devTools/javaSanityCheck/SanityCheck.jar and b/devTools/javaSanityCheck/SanityCheck.jar differ diff --git a/devTools/javaSanityCheck/excluded b/devTools/javaSanityCheck/excluded index eb522cb6bac88f489da3aeae75878591398e5838..53fd6b74eacad1588376bb0894ca956fb78e7d8d 100644 --- a/devTools/javaSanityCheck/excluded +++ b/devTools/javaSanityCheck/excluded @@ -4,3 +4,8 @@ src/art/ src/gui/svgFilters.tw src/pregmod/editGenetics.tw +# +src/001-lib/Jquery/Jquery.js +src/001-lib/mousetrap/mousetrap.js +src/002-config/sugarCubeConfig.js +#src/debugging/debugJS.js diff --git a/sanityCheck.sh b/sanityCheck.sh index 346a50e63396e53858ee7d23616f1cbc49e58c49..824ddf13024205c33c76b001e4573480ebc2361e 100755 --- a/sanityCheck.sh +++ b/sanityCheck.sh @@ -136,15 +136,17 @@ $GREP -i "non.lethal" -- 'src/*' | myprint "ShouldBeNonlethal" # Check for missing quotation marks around selectors #$GREP "span class=[^\"]" -- src/*.js --exclude 'src/001-lib/Jquery/Jquery.js' | myprint "MissingQuotes" disabled until I can figure out how to exclude files -# 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 -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 '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" +if [[ ! "$java" ]]; then + # 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 -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 '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" -) + ) +fi # Check that all the tags are properly opened and closed diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js index 511abd18eb8decebef3722dcbb6cad15dba15f44..c37052e138b0cac7ee5820dcf390a34918e25fb8 100644 --- a/src/SpecialForce/SpecialForce.js +++ b/src/SpecialForce/SpecialForce.js @@ -73,6 +73,7 @@ App.SF.Init = function() { }*/ }; +/* no-usedOnce */ App.SF.BC = function() { const V = State.variables; @@ -347,6 +348,7 @@ App.SF.BC = function() { UnitsClean(); if (V.week < 72 && V.SF.Active !== -1) { V.SF.Active = -1; } }; +/* usedOnce */ App.SF.fsIntegration = function(input = 'Menu', textDisplay = 100, text = `\n`) { const Revivalisms = ['Roman_Revivalism', 'Aztec_Revivalism', 'Egyptian_Revivalism', 'Edo_Revivalism', 'Arabian_Revivalism', 'Chinese_Revivalism', 'Multiculturalism'], diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 2d555307de906bdb05d508e1b79834be302c8765..49ebb98f48fc6489451684bd7944b3d2432fc477 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -1,5 +1,5 @@ :: Backwards Compatibility [nobr] - +/* no-usedOnce disabling checking for only used once instances in this file*/ <<set $nextButton = "Continue", $nextLink = "Main", $returnTo = "Main">> <<if $releaseID == 1021 || $releaseID == 1020 || $releaseID == 1019 || $releaseID == 2022>>