xref: /freebsd/tools/boot/lua-lint.sh (revision 56b17de1e8360fe131d425de20b5e75ff3ea897c)
1#!/bin/sh
2
3# Run linter on the lua scripts in stand/lua. luacheck, available in ports as
4# devel/lua-luacheck, must be installed as a dependency of this script.
5
6die() {
7    echo $*
8    exit 1
9}
10
11LUACHECK=$(which luacheck)
12
13[ ! -z "${LUACHECK}" ] && [ -e "${LUACHECK}" ] || \
14	die "You must have luacheck installed and in your PATH"
15
16cd $(make -V SRCTOP)/stand
17${LUACHECK} . --globals loader --globals lfs --globals io.getchar \
18	--globals io.ischar --globals printc --globals cli_execute \
19	--globals cli_execute_unparsed --globals try_include \
20	--globals pager --globals gfx --globals hash --std lua53
21