From d6cc933ff1722ca3229aadd8878fe77ba5d05575 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sat, 9 May 2020 14:04:47 -0700 Subject: [PATCH] Wire up shellcheck of cli-tests/*.sh to 'make lint' Enforce that all the cli-test scripts pass 'shellcheck'. --- .travis.yml | 2 ++ CONTRIBUTING.md | 3 ++- Makefile | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0de7c6e..1a1686d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ jobs: - stage: presubmits name: Generate, Format, and Lint + before_install: + - sudo apt-get -y install shellcheck install: - make tools script: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5968d0e..d5be721 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,6 +87,7 @@ The `Makefile` will automatically download and build any needed Go dependencies. However, you'll also need to install some non-Go dependencies: - `make format` requires [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html). + - `make lint` requires [`shellcheck`](https://github.com/koalaman/shellcheck). - `make test-setup` and `make cli-test` require [`e2fsprogs`](https://en.wikipedia.org/wiki/E2fsprogs) version 1.43 or later. @@ -96,7 +97,7 @@ However, you'll also need to install some non-Go dependencies: On Ubuntu, the following command installs the needed packages: ``` -sudo apt-get install clang-format e2fsprogs expect keyutils +sudo apt-get install clang-format shellcheck e2fsprogs expect keyutils ``` ### Running Integration Tests diff --git a/Makefile b/Makefile index 6e2eda2..54c381d 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,7 @@ lint: $(BIN)/golint $(BIN)/staticcheck $(BIN)/misspell go list ./... | xargs -L1 golint -set_exit_status staticcheck ./... misspell -source=text $(FILES) + ( cd cli-tests && shellcheck -x *.sh) clean: rm -f $(BIN)/$(NAME) $(PAM_MODULE) $(TOOLS) coverage.out $(COVERAGE_FILES) $(PAM_CONFIG) -- 2.39.5