diff --git a/.luacheckrc b/.luacheckrc index 8981e16a5..207f29ebc 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,4 +1,5 @@ std = 'ngx_lua' +globals = { 'ngx' } unused_args = false read_globals = { "coroutine._yield" diff --git a/.travis.yml b/.travis.yml index 3f5cf76bf..8022909ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,12 +37,13 @@ env: - LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH - TEST_NGINX_SLEEP=0.005 - TEST_NGINX_RANDOMIZE=1 + - LUACHECK_VER=0.21.1 matrix: - NGINX_VERSION=1.9.15 - NGINX_VERSION=1.11.2 before_install: - - sudo luarocks install luacheck + - sudo luarocks install luacheck $LUACHECK_VER - luacheck -q . - '! grep -n -P ''(?<=.{80}).+'' --color `find . -name ''*.lua''` || (echo "ERROR: Found Lua source lines exceeding 80 columns." > /dev/stderr; exit 1)' - '! grep -n -P ''\t+'' --color `find . -name ''*.lua''` || (echo "ERROR: Cannot use tabs." > /dev/stderr; exit 1)'