summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-08-30 22:54:05 +1000
committerteor <teor@torproject.org>2019-09-05 11:15:26 +1000
commit5c2941e69f3e444664d6426f42cb52cb885800ee (patch)
tree57c60f1d36631dd6f5c08850ea9eb05b9ee008ca /Makefile.am
parentd14573a62371fd6d21ed801bc89e2f3ebdb98b2b (diff)
downloadtor-5c2941e69f3e444664d6426f42cb52cb885800ee.tar.gz
tor-5c2941e69f3e444664d6426f42cb52cb885800ee.zip
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.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am18
1 files changed, 1 insertions, 17 deletions
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