From 239935c063acefee3b3ced37cb82d4e9f46d041c Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Fri, 8 Jul 2016 14:19:51 +0100 Subject: [PATCH] shell-lint tool --- README.md | 4 ++++ shell-lint | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 shell-lint diff --git a/README.md b/README.md index 32ddb57b1..e570ef717 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,15 @@ Included in this repo are tools shared by weave.git and scope.git. They include - ```cover```: a tool which merges overlapping coverage reports generated by go test +- ```files-with-type```: a tool to search directories for files of a given + MIME type - ```lint```: a script to lint Go project; runs various tools like golint, go vet, errcheck etc - ```rebuild-image```: a script to rebuild docker images when their input files change; useful when you using docker images to build your software, but you don't want to build the image every time. +- ```shell-lint```: a script to lint multiple shell files with + [shellcheck](http://www.shellcheck.net/) - ```socks```: a simple, dockerised SOCKS proxy for getting your laptop onto the Weave network - ```test```: a script to run all go unit tests in subdirectories, gather the diff --git a/shell-lint b/shell-lint new file mode 100755 index 000000000..5cc77cb2a --- /dev/null +++ b/shell-lint @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# +# Lint all shell files in given directories with `shellcheck`. +# +# e.g. +# $ shell-lint infra k8s +# +# Depends on: +# - shellcheck +# - files-with-type +# - file >= 5.22 + +"$(dirname "${BASH_SOURCE[0]}")/files-with-type" text/x-shellscript "$@" | xargs shellcheck