From 0cbf16d15fab7cb1cf3890e4791435a6b38a103f Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 22 Sep 2018 15:09:01 +0200 Subject: [PATCH] Final hook fixes --- Config/phan.php | 16 ++++++++++++++-- Hooks/delegator.sh | 4 +--- Hooks/tests.sh | 2 +- Hooks/travis.sh | 2 +- Inspection/Php/tests.sh | 8 ++++---- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Config/phan.php b/Config/phan.php index dd1815d..1d4267c 100644 --- a/Config/phan.php +++ b/Config/phan.php @@ -9,7 +9,6 @@ return [ 'prefer_narrowed_phpdoc_param_type' => true, 'prefer_narrowed_phpdoc_return_type' => true, 'allow_method_param_type_widening' => false, - 'analyze_signature_compatibility' => true, 'dead_code_detection' => true, 'backward_compatibility_checks' => false, 'quick_mode' => false, @@ -23,7 +22,20 @@ return [ 'scalar_implicit_partial' => [], 'ignore_undeclared_variables_in_global_scope' => false, 'suppress_issue_types' => [ - // 'PhanUndeclaredMethod', + 'PhanUndeclaredClassMethod', + 'PhanUndeclaredProperty', + 'PhanUnreferencedPublicClassConstant', + 'PhanUndeclaredTypeParameter', + 'PhanUnusedPublicFinalMethodParameter', + 'PhanUndeclaredClassConstant', + 'PhanUnreferencedPublicMethod', + 'PhanUndeclaredTypeReturnType', + 'PhanTypeMismatchDeclaredReturn', + 'PhanUndeclaredClassInstanceof', + 'PhanTypeMismatchReturn', + 'PhanUndeclaredExtendedClass', + 'PhanUndeclaredInterface', + 'PhanUnreferencedProtectedProperty', ], 'whitelist_issue_types' => [ // 'PhanAccessMethodPrivate', diff --git a/Hooks/delegator.sh b/Hooks/delegator.sh index 8f15041..ee8d9b2 100644 --- a/Hooks/delegator.sh +++ b/Hooks/delegator.sh @@ -1,13 +1,11 @@ #!/bin/bash -set -x - . ${rootpath}/Build/Hooks/logging.sh . ${rootpath}/Build/Hooks/syntax.sh . ${rootpath}/Build/Hooks/filename.sh . ${rootpath}/Build/Hooks/tests.sh -git diff --cached --name-only | while read FILE; do +for FILE in $(git diff --cached --name-only); do echo $FILE if [[ ! -f "$FILE" ]]; then diff --git a/Hooks/tests.sh b/Hooks/tests.sh index 120e01c..943a982 100644 --- a/Hooks/tests.sh +++ b/Hooks/tests.sh @@ -1,7 +1,7 @@ #!/bin/bash isPhanTestSuccessful() { - php -d memory_limit=4G ${rootpath}/vendor/bin/phan -k ${rootpath}/Build/Config/phan.php -f "$1" >&2 + php -d memory_limit=4G ${rootpath}/vendor/bin/phan -k ${rootpath}/Build/Config/phan.php --minimum-severity=0 --color -f "$1" >&2 if [ $? -ne 0 ]; then echo 0 return 0 diff --git a/Hooks/travis.sh b/Hooks/travis.sh index eb82673..4ff07f2 100644 --- a/Hooks/travis.sh +++ b/Hooks/travis.sh @@ -7,7 +7,7 @@ rootpath="$(pwd)" . ${rootpath}/Build/Hooks/filename.sh . ${rootpath}/Build/Hooks/tests.sh -git diff --name-only $TRAVIS_COMMIT_RANGE | while read FILE; do +for FILE in $(git diff --cached --name-only); do if [[ ! -f "$FILE" ]]; then continue fi diff --git a/Inspection/Php/tests.sh b/Inspection/Php/tests.sh index 0b69030..c76ff4b 100644 --- a/Inspection/Php/tests.sh +++ b/Inspection/Php/tests.sh @@ -13,7 +13,7 @@ php -d memory_limit=4G ${TOOLS_PATH}/phpstan.phar analyse --autoload-file=${ROOT php -d memory_limit=4G ${TOOLS_PATH}/phpstan.phar analyse --autoload-file=${ROOT_PATH}/phpOMS/Autoloader.php -l 7 -c ${BUILD_PATH}/Config/phpstan.neon ${ROOT_PATH}/Model > ${INSPECTION_PATH}/Model/phpstan.log php -d memory_limit=4G ${TOOLS_PATH}/phpstan.phar analyse --autoload-file=${ROOT_PATH}/phpOMS/Autoloader.php -l 7 -c ${BUILD_PATH}/Config/phpstan.neon ${ROOT_PATH}/Web > ${INSPECTION_PATH}/Web/phpstan.log -php ${TOOLS_PATH}/phan.phar -k ${BUILD_PATH}/Config/phan.php -l ${ROOT_PATH}/phpOMS -m text --color -o ${INSPECTION_PATH}/Framework/phan.log -php ${TOOLS_PATH}/phan.phar -k ${BUILD_PATH}/Config/phan.php -l ${ROOT_PATH}/Modules -m text --color -o ${INSPECTION_PATH}/Modules/phan.log -php ${TOOLS_PATH}/phan.phar -k ${BUILD_PATH}/Config/phan.php -l ${ROOT_PATH}/Model -m text --color -o ${INSPECTION_PATH}/Model/phan.log -php ${TOOLS_PATH}/phan.phar -k ${BUILD_PATH}/Config/phan.php -l ${ROOT_PATH}/Web -m text --color -o ${INSPECTION_PATH}/Web/phan.log +php ${TOOLS_PATH}/phan.phar -k ${BUILD_PATH}/Config/phan.php -l ${ROOT_PATH}/phpOMS -m text --minimum-severity=0 --color -o ${INSPECTION_PATH}/Framework/phan.log +php ${TOOLS_PATH}/phan.phar -k ${BUILD_PATH}/Config/phan.php -l ${ROOT_PATH}/Modules -m text --minimum-severity=0 --color -o ${INSPECTION_PATH}/Modules/phan.log +php ${TOOLS_PATH}/phan.phar -k ${BUILD_PATH}/Config/phan.php -l ${ROOT_PATH}/Model -m text --minimum-severity=0 --color -o ${INSPECTION_PATH}/Model/phan.log +php ${TOOLS_PATH}/phan.phar -k ${BUILD_PATH}/Config/phan.php -l ${ROOT_PATH}/Web -m text --minimum-severity=0 --color -o ${INSPECTION_PATH}/Web/phan.log