Merge pull request #66 from YunoHost/critical-failure-from-linter

Handle return code from linter saying the app should be flagged as broken
This commit is contained in:
Maniack Crudelis 2019-12-07 17:05:50 +01:00 committed by GitHub
commit c0dd377128
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -804,6 +804,13 @@ TEST_RESULTS () {
global_level=0 global_level=0
fi fi
# If the package linter returned a critical error, the app is flagged as broken / level 0
if [ $RESULT_linter -eq -2 ]
then
ECHO_FORMAT "The package linter reported a critical failure ! App is considered broken !\n" "red" "bold"
global_level=0
fi
if [ $RESULT_alias_traversal -eq 1 ] if [ $RESULT_alias_traversal -eq 1 ]
then then
ECHO_FORMAT "Issue alias_traversal was detected ! Please see here https://github.com/YunoHost/example_ynh/pull/45 to fix that.\n" "red" "bold" ECHO_FORMAT "Issue alias_traversal was detected ! Please see here https://github.com/YunoHost/example_ynh/pull/45 to fix that.\n" "red" "bold"

View file

@ -1500,6 +1500,12 @@ PACKAGE_LINTER () {
else # Fail else # Fail
check_failed check_failed
RESULT_linter=-1 RESULT_linter=-1
# If return code is 2, this is critical failure, app should be considered as broken (level 0)
if [ $linter_result -eq 2 ]
then
RESULT_linter=-2
fi
fi fi
} }