From c8a0a7ab9bb8d49fd4a52e3f3dc216163c584409 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Thu, 22 Feb 2018 04:28:52 +0000 Subject: [PATCH] Add script for linting stand/lua to tools/boot. We require some --globals due to custom loader extensions in our environment. Add everything required for this to tools/boot so that other interested parties can get up and go with linting our scripts and not get a bunch of false-positives. --- tools/boot/lua-lint.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 tools/boot/lua-lint.sh diff --git a/tools/boot/lua-lint.sh b/tools/boot/lua-lint.sh new file mode 100755 index 00000000000..3fde62c3a04 --- /dev/null +++ b/tools/boot/lua-lint.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# $FreeBSD$ + +# Run linter on the lua scripts in stand/lua. luacheck, not currently available +# in ports, must be installed as a dependency. + +die() { + echo $* + exit 1 +} + +LUACHECK=$(which luacheck) + +[ ! -z "${LUACHECK}" ] && [ -e "${LUACHECK}" ] || \ + die "You must have luacheck installed and in your PATH" + +cd $(make -V SRCTOP)/stand +${LUACHECK} . --globals loader --globals lfs --globals io.getchar \ + --globals io.ischar --std lua53