test: check lua code style in all Lua file under apisix/ (#1518)

This commit is contained in:
罗泽轩 2020-04-28 15:53:04 +08:00 committed by GitHub
parent a53b4707fb
commit 06acbe9047
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 9 deletions

View File

@ -17,6 +17,7 @@
local base_prometheus = require("resty.prometheus")
local core = require("apisix.core")
local ipairs = ipairs
local ngx = ngx
local ngx_capture = ngx.location.capture
local re_gmatch = ngx.re.gmatch
local prometheus

View File

@ -17,6 +17,10 @@
local core = require("apisix.core")
local to_hex = require "resty.string".to_hex
local new_span_context = require("opentracing.span_context").new
local ngx = ngx
local string = string
local pairs = pairs
local tonumber = tonumber
local function hex_to_char(c)
return string.char(tonumber(c, 16))

View File

@ -14,6 +14,12 @@
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
local assert = assert
local type = type
local setmetatable = setmetatable
local math = math
local _M = {}
local mt = { __index = _M }

View File

@ -18,6 +18,11 @@ local resty_http = require "resty.http"
local to_hex = require "resty.string".to_hex
local cjson = require "cjson".new()
cjson.encode_number_precision(16)
local assert = assert
local type = type
local setmetatable = setmetatable
local math = math
local tostring = tostring
local _M = {}

View File

@ -16,6 +16,8 @@
--
local core = require("apisix.core")
local balancer = require("ngx.balancer")
local bit = require "bit"
local ngx = ngx
local ngx_exit = ngx.exit
local str_byte = string.byte
local str_sub = string.sub

View File

@ -21,15 +21,7 @@ set -ex
luacheck -q apisix
./utils/lj-releng \
apisix/*.lua \
apisix/admin/*.lua \
apisix/core/*.lua \
apisix/http/*.lua \
apisix/http/router/*.lua \
apisix/plugins/*.lua \
apisix/plugins/grpc-transcode/*.lua \
apisix/plugins/limit-count/*.lua > \
find apisix -name '*.lua' -exec ./utils/lj-releng {} + > \
/tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1)
grep -E "ERROR.*.lua:" /tmp/check.log > /tmp/error.log | true