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