From 5689008060d29dd7b45157a8f82cb96018c284e8 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 9 Nov 2019 07:39:01 -0500 Subject: [PATCH] build: add shlint target for shellcheck (#11350) --- Makefile | 12 ++++++++++-- ci/run_lint.sh | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f5b9459b0c..3952c37fd4 100644 --- a/Makefile +++ b/Makefile @@ -138,6 +138,14 @@ functionaltest-lua: | nvim lualint: | build/.ran-cmake deps $(BUILD_CMD) -C build lualint +shlint: + @shellcheck --version | head -n 2 + shellcheck scripts/vim-patch.sh + +_opt_shlint: + @command -v shellcheck && { $(MAKE) shlint; exit $$?; } \ + || echo "SKIP: shlint (shellcheck not found)" + pylint: flake8 contrib/ scripts/ src/ test/ @@ -188,7 +196,7 @@ appimage: appimage-%: bash scripts/genappimage.sh $* -lint: check-single-includes clint lualint _opt_pylint +lint: check-single-includes clint lualint _opt_pylint _opt_shlint # Generic pattern rules, allowing for `make build/bin/nvim` etc. # Does not work with "Unix Makefiles". @@ -200,4 +208,4 @@ $(DEPS_BUILD_DIR)/%: $(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@) endif -.PHONY: test lualint pylint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix +.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix diff --git a/ci/run_lint.sh b/ci/run_lint.sh index 88af163e80..8373a3cb36 100755 --- a/ci/run_lint.sh +++ b/ci/run_lint.sh @@ -20,6 +20,10 @@ enter_suite 'pylint' run_test 'make pylint' pylint exit_suite --continue +enter_suite 'shlint' +run_test 'make shlint' shlint +exit_suite --continue + enter_suite single-includes CLICOLOR_FORCE=1 run_test_wd \ --allow-hang \