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