xref: /freebsd/tools/boot/lua-lint.sh (revision f5f40dd63bc7acbb5312b26ac1ea1103c12352a6)
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 --std lua53
21