From 5c2941e69f3e444664d6426f42cb52cb885800ee Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 30 Aug 2019 22:54:05 +1000 Subject: shellcheck: Add shellcheck to the pre-commit hook * Move the shellcheck script from the Makefile to its own script file * Reformat the shellcheck script so it's easier to read and modify * Call the shellcheck script from the pre-commit hook Fixes bug 30967; not in any released version of Tor. --- Makefile.am | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 25c6562c10..4022995fb9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -239,23 +239,7 @@ test: all $(top_builddir)/src/test/test shellcheck: - # Only use shellcheck if shellcheck is installed - # Check the directories that contain scripts that we can fix - if command -v shellcheck; then \ - find "$(top_srcdir)" -name "*.sh" -path "$(top_srcdir)/contrib/*" -path "$(top_srcdir)/doc/*" -path "$(top_srcdir)/scripts/*" -path "$(top_srcdir)/src/*" -not -path "$(top_srcdir)/src/ext/*" -not -path "$(top_srcdir)/src/rust/registry/*" -exec shellcheck {} +; \ - if [ -d "$(top_srcdir)/scripts/test" ]; then \ - shellcheck $(top_srcdir)/scripts/test/cov-diff $(top_srcdir)/scripts/test/coverage; \ - fi; \ - if [ -e "$(top_srcdir)/contrib/dirauth-tools/nagios-check-tor-authority-cert" ]; then \ - shellcheck "$(top_srcdir)/contrib/dirauth-tools/nagios-check-tor-authority-cert"; \ - fi; \ - if [ -e "$(top_srcdir)/contrib/client-tools/torify" ]; then \ - shellcheck "$(top_srcdir)/contrib/client-tools/torify"; \ - fi; \ - if [ -d "$(top_srcdir)/scripts/git" ]; then \ - shellcheck $(top_srcdir)/scripts/git/*.git-hook; \ - fi; \ - fi + $(top_srcdir)/scripts/maint/checkShellScripts.sh check-local: check-spaces check-changes check-includes check-best-practices shellcheck -- cgit v1.2.3-54-g00ecf