diff --git a/src/luacheck/builtin_standards/init.lua b/src/luacheck/builtin_standards/init.lua index 097fee2d..0d06f053 100644 --- a/src/luacheck/builtin_standards/init.lua +++ b/src/luacheck/builtin_standards/init.lua @@ -2,6 +2,9 @@ local love = require "luacheck.builtin_standards.love" local minetest = require "luacheck.builtin_standards.minetest" local playdate = require "luacheck.builtin_standards.playdate" local ngx = require "luacheck.builtin_standards.ngx" +local redis5 = require "luacheck.builtin_standards.redis5" +local redis6 = require "luacheck.builtin_standards.redis6" +local redis7 = require "luacheck.builtin_standards.redis7" local standards = require "luacheck.standards" local builtin_standards = {} @@ -264,6 +267,9 @@ lua_defs.luajit = add_defs(make_min_def("luajit"), { }) lua_defs.ngx_lua = add_defs(lua_defs.luajit, ngx) lua_defs.max = add_defs(lua_defs.lua51c, lua_defs.lua52c, lua_defs.lua53c, lua_defs.lua54c, lua_defs.luajit) +lua_defs.redis5 = add_defs(lua_defs.lua51, redis5) +lua_defs.redis6 = add_defs(lua_defs.redis5, redis6) +lua_defs.redis7 = add_defs(lua_defs.redis6, redis7) for name, def in pairs(lua_defs) do builtin_standards[name] = def_to_std(def) diff --git a/src/luacheck/builtin_standards/redis5.lua b/src/luacheck/builtin_standards/redis5.lua new file mode 100644 index 00000000..4edf0cd4 --- /dev/null +++ b/src/luacheck/builtin_standards/redis5.lua @@ -0,0 +1,68 @@ +local empty = {} + +local redis = { + fields = { + ARGV = { + other_fields = true, + }, + KEYS = { + other_fields = true, + }, + + redis = { + fields = { + call = empty, + pcall = empty, + error_reply = empty, + status_reply = empty, + sha1hex = empty, + log = empty, + set_repl = empty, + replicate_commands = empty, + breakpoint = empty, + debug = empty, + }, + }, + + cjson = { + fields = { + decode = empty, + encode = empty, + }, + }, + + struct = { + fields = { + pack = empty, + unpack = empty, + size = empty, + } + }, + + cmsgpack = { + fields = { + pack = empty, + unpack = empty, + } + }, + + bit = { + fields = { + tobit = empty, + tohex = empty, + bnot = empty, + bor = empty, + band = empty, + bxor = empty, + lshift = empty, + rshift = empty, + arshift = empty, + rol = empty, + ror = empty, + bswap = empty, + } + } + } +} + +return redis diff --git a/src/luacheck/builtin_standards/redis6.lua b/src/luacheck/builtin_standards/redis6.lua new file mode 100644 index 00000000..e145f1bb --- /dev/null +++ b/src/luacheck/builtin_standards/redis6.lua @@ -0,0 +1,14 @@ +local empty = {} + +local redis = { + fields = { + redis = { + fields = { + setresp = empty, + } + + } + } +} + +return redis diff --git a/src/luacheck/builtin_standards/redis7.lua b/src/luacheck/builtin_standards/redis7.lua new file mode 100644 index 00000000..8b453530 --- /dev/null +++ b/src/luacheck/builtin_standards/redis7.lua @@ -0,0 +1,14 @@ +local empty = {} + +local redis = { + fields = { + redis = { + REDIS_VERSION = {}, + REDIS_VERSION_NUM = {}, + acl_check_cmd = empty, + register_function = empty, + } + } +} + +return redis