From fc4d34cb644bd1d3d76ddbe62bd0bf59062a56fa Mon Sep 17 00:00:00 2001 From: Pavel Lobashov Date: Wed, 29 May 2019 17:58:09 +0300 Subject: [PATCH] Output problematic files in travis check (#528) * Output problematic files in travis check Before task just failed without any info * Fix exit code of grep * Fix exit code again * More exit code --- .travis.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5d4986a2a..24eb66a3d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,11 +16,20 @@ before_script: jobs: include: - stage: Check all files contains Copyright - script: if [[ $(grep -L -R --include='*.js' --exclude-dir={\*vendor,externs\*} --exclude='jquery_native.js' 'Copyright Ascensio System' | wc -l) -ne 0 ]]; then exit 1 ; fi + script: + - FILES_WITHOUT_LICENSE=$(grep -L -R --include='*.js' --exclude-dir={\*vendor,externs\*} --exclude='jquery_native.js' 'Copyright Ascensio System') || true + - echo $FILES_WITHOUT_LICENSE + - if [[ $(echo -n $SPELLCHECK_OUT | wc -c) -ne 0 ]]; then exit 1 ; fi - stage: Check all files use Linux Line Ending (LF) - script: if [[ $(find . -not -type d -exec file '{}' ';' | grep CRLF | wc -l) -ne 0 ]]; then exit 1 ; fi + script: + - FILES_WITHOUT_LF=$(find . -not -type d -exec file '{}' ';' | grep CRLF) || true + - echo $FILES_WITHOUT_LF + - if [[ $(echo -n $FILES_WITHOUT_LF | wc -c) -ne 0 ]]; then exit 1 ; fi - stage: Check all files has trailing newline - script: if [[ $(pcregrep --buffer-size=64M --include='.*\.js$' -LMr '\n\Z' . | wc -l) -ne 0 ]]; then exit 1 ; fi + script: + - FILES_WITHOUT_TRAILING_NEWLINE=$(pcregrep --buffer-size=64M --include='.*\.js$' -LMr '\n\Z' .) || true + - echo $FILES_WITHOUT_TRAILING_NEWLINE + - if [[ $(echo -n $FILES_WITHOUT_TRAILING_NEWLINE | wc -c) -ne 0 ]]; then exit 1 ; fi - stage: SonarQube Scanner if: branch = develop script: