CI: added luacheck in CI. (#68)

This commit is contained in:
WenMing 2019-06-11 09:38:00 +08:00 committed by GitHub
parent 16e5b64a37
commit 9b901727af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 4 deletions

View File

@ -1 +1,3 @@
std = "ngx_lua"
unused_args = false
redefined = false

View File

@ -16,6 +16,7 @@ addons:
- etcd
- luarocks
- cmake
- lua-check
cache:
directories:
@ -39,4 +40,5 @@ script:
- export PATH=$OPENRESTY_PREFIX/nginx/sbin:$PATH
- sudo service etcd start
- sudo apisix init_etcd
- luacheck -q lua
- make test

View File

@ -12,7 +12,6 @@ local log = require("apisix.core.log")
local _M = {version = 0.1}
local mt = { __index = _M }
local function global_lru(key, version, create_obj_fun, ...)

View File

@ -61,14 +61,14 @@ function class.__meta.__call(cls, ...)
return self
end
function class.def(base, type, cls)
function class.def(base, typ, cls)
base = base or class
local mt = {__metatable=base, __index=base}
for k, v in pairs(base.__meta) do mt[k] = v end
cls = setmetatable(cls or {}, mt)
cls.__index = cls
cls.__metatable = cls
cls.__type = type
cls.__type = typ
cls.__meta = mt
return cls
end

View File

@ -1,5 +1,4 @@
local exporter = require("apisix.plugins.prometheus.exporter")
local core = require("apisix.core")
local plugin_name = "prometheus"