diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 000000000000..498f04c69bb1 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,39 @@ +std = "ngx_lua" +unused = false +redefined = false +max_line_length = false + + +globals = { + "_KONG", +} + + +not_globals = { + "string.len", + "table.getn", +} + + +ignore = { + "6.", -- ignore whitespace warnings +} + + +exclude_files = { + "spec/fixtures/invalid-module.lua", +} + + +files["kong/plugins/ldap-auth/*.lua"] = { + read_globals = { + "bit.mod", + "string.pack", + "string.unpack", + }, +} + + +files["spec/**/*.lua"] = { + std = "ngx_lua+busted", +} diff --git a/Makefile b/Makefile index 302d77e798ce..ec9328efdec9 100644 --- a/Makefile +++ b/Makefile @@ -19,19 +19,7 @@ dev: install done; lint: - @luacheck -q . \ - --exclude-files 'kong/vendor/**/*.lua' \ - --exclude-files 'spec/fixtures/invalid-module.lua' \ - --std 'ngx_lua+busted' \ - --globals '_KONG' \ - --globals 'ngx' \ - --globals 'assert' \ - --globals 'string.pack' \ - --globals 'string.unpack' \ - --globals 'bit.mod' \ - --no-redefined \ - --no-unused-args \ - --ignore 6.. + @luacheck -q . test: @$(TEST_CMD) spec/01-unit diff --git a/kong/core/globalpatches.lua b/kong/core/globalpatches.lua index dc85bf21c3a3..098702f7de97 100644 --- a/kong/core/globalpatches.lua +++ b/kong/core/globalpatches.lua @@ -200,7 +200,6 @@ return function(options) -- -- This patched method will create a unique seed per worker process, -- using a combination of both time and the worker's pid. - -- luacheck: globals math local util = require "kong.tools.utils" local seeds = {} local randomseed = math.randomseed