From: Sébastien Han Date: Fri, 12 May 2017 08:54:17 +0000 (+0200) Subject: ceph-docker-lint: do not check variables_entrypoint.sh X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=09ecee10ebc9c8cbb1fd679f4ef9c19f0c2bed33;p=ceph-build.git ceph-docker-lint: do not check variables_entrypoint.sh Shellcheck will complain with SC2034: foo appears unused. Verify it or export it. The problem here is that this file contains a reference of all the variables so indeed they appear unused. We could potentially source some portion of the code from that file, however I don't want to change the structure of the code because of shellchecker. Also sourcing all the variables might results in expected scenario if these variables are not expected to be declared. There is no way to tell shellcheck to ignore this file so we should not test it. Signed-off-by: Sébastien Han --- diff --git a/ceph-docker-lint/build/build b/ceph-docker-lint/build/build index 6add50d3..693d0387 100755 --- a/ceph-docker-lint/build/build +++ b/ceph-docker-lint/build/build @@ -4,16 +4,18 @@ set -e set -x IGNORE_THESE_CODES="SC1091,SC2015,SC2009,SC2001" +IGNORE_THESE_FILES="variables_entrypoint.sh" # pipe-separated file names, e.g: foo|bar|foobar, this avoids shellcheck complaining that vars are not used (see: SC2034) function generate_filelist(){ if [[ "$pull_request_id" -eq "" || "${ghprbCommentBody:-}" = "jenkins lint all" ]] then - find . -name '*.sh' + find . -name '*.sh' | grep -vE "$IGNORE_THESE_FILES" else curl -XGET "https://api.github.com/repos/ceph/ceph-docker/pulls/$pull_request_id/files" | jq '.[].filename' | # just the files please tr -d '"' | # remove the quoting from JSON - grep ".sh$" # just the bash + grep ".sh$" | # just the bash + grep -vE "$IGNORE_THESE_FILES" fi }