diff options
author | Stefan Wildemann <metalstrolch@users.noreply.github.com> | 2018-06-05 22:58:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-05 22:58:27 +0200 |
commit | be3123947062dc1195811ade9cb5c3fae9b2b815 (patch) | |
tree | dbbf904f922ad60b5bd3eee11a5f98c35739e468 | |
parent | 5cb434fe13ca071d0eca38800519158013c96888 (diff) | |
parent | 3deb3a26e3c442b22bde0abd6c5df4541c5278a4 (diff) | |
download | navit-be3123947062dc1195811ade9cb5c3fae9b2b815.tar.gz |
Merge pull request #625 from aerostitch/sanity_support
update:scripts:change the sanity script to exclude fib and support
-rwxr-xr-x | scripts/ci_sanity_checks.sh | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/scripts/ci_sanity_checks.sh b/scripts/ci_sanity_checks.sh index 7adf185f6..cceec6397 100755 --- a/scripts/ci_sanity_checks.sh +++ b/scripts/ci_sanity_checks.sh @@ -14,13 +14,13 @@ return_code=0 # Check if any file has been modified. If yes, that means the best practices # have not been followed, so we will fail the job later but print a message here. check_diff(){ - git diff --exit-code - code=$? - if [[ $code -ne 0 ]]; then - echo "[ERROR] You may need to do some cleanup in the files you commited, see the git diff output above." - fi - git checkout -- . - return_code=$(($return_code + $code)) + git diff --exit-code + code=$? + if [[ $code -ne 0 ]]; then + echo "[ERROR] You may need to do some cleanup in the files you commited, see the git diff output above." + fi + git checkout -- . + return_code=$(($return_code + $code)) } # List the files that are different from the trunk @@ -30,33 +30,37 @@ interval=${from}..${to} [[ "${from}" == "${to}" ]] && interval=${to} for f in $(git diff --name-only ${interval} | sort -u); do - if [[ -e "${f}" ]]; then - - # Checks for trailing spaces - if [[ "${f: -4}" != ".bat" ]]; then - echo "[INFO] Checking for trailing spaces on ${f}..." - if [[ "$(file -bi """${f}""")" =~ ^text ]]; then - sed 's/\s*$//' -i "${f}" - check_diff - fi + if [[ "${f}" =~ navit/support/ ]] || [[ "${f}" =~ navit/fib-1\.1/ ]]; then + echo "[DEBUG] Skipping file ${f} ..." + continue fi + if [[ -e "${f}" ]]; then - # Formats any *.c and *.cpp files - if [[ "${f: -2}" == ".c" ]] || [[ "${f: -4}" == ".cpp" ]]; then - echo "[INFO] Checking for indentation and style compliance on ${f}..." - astyle --indent=spaces=4 --style=attach -n --max-code-length=120 -xf -xh "${f}" - check_diff - fi + # Checks for trailing spaces + if [[ "${f: -4}" != ".bat" ]]; then + echo "[INFO] Checking for trailing spaces on ${f}..." + if [[ "$(file -bi """${f}""")" =~ ^text ]]; then + sed 's/\s*$//' -i "${f}" + check_diff + fi + fi + + # Formats any *.c and *.cpp files + if [[ "${f: -2}" == ".c" ]] || [[ "${f: -4}" == ".cpp" ]]; then + echo "[INFO] Checking for indentation and style compliance on ${f}..." + astyle --indent=spaces=4 --style=attach -n --max-code-length=120 -xf -xh "${f}" + check_diff + fi - if [[ "${f}" == "navit/navit_shipped.xml" ]]; then - echo "[INFO] Checking for compliance with the DTD using xmllint on ${f}..." - xmllint --noout --dtdvalid navit/navit.dtd "$f" - rc=$? - if [[ $rc -ne 0 ]]; then - echo "[ERROR] Your ${f} file doesn't validate against the navit/navit.dtd using xmllint" - fi + if [[ "${f}" == "navit/navit_shipped.xml" ]]; then + echo "[INFO] Checking for compliance with the DTD using xmllint on ${f}..." + xmllint --noout --dtdvalid navit/navit.dtd "$f" + rc=$? + if [[ $rc -ne 0 ]]; then + echo "[ERROR] Your ${f} file doesn't validate against the navit/navit.dtd using xmllint" + fi + fi fi - fi done exit $return_code |