Skip to content

Commit

Permalink
Split scripts/functions exclusive definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
mcraq committed Aug 29, 2024
1 parent 5d420db commit db9c87e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/luacheck/builtin_standards/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ 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 redis_scripts = require "luacheck.builtin_standards.redis_scripts"
local redis_functions = require "luacheck.builtin_standards.redis_functions"
local standards = require "luacheck.standards"

local builtin_standards = {}
Expand Down Expand Up @@ -270,6 +272,8 @@ lua_defs.max = add_defs(lua_defs.lua51c, lua_defs.lua52c, lua_defs.lua53c, lua_d
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)
lua_defs.redis_scripts = redis_scripts
lua_defs.redis_functions = redis_functions

for name, def in pairs(lua_defs) do
builtin_standards[name] = def_to_std(def)
Expand Down
9 changes: 0 additions & 9 deletions src/luacheck/builtin_standards/redis5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ local empty = {}

local redis = {
fields = {
ARGV = {
other_fields = true,
},
KEYS = {
other_fields = true,
},

redis = {
fields = {
call = empty,
Expand All @@ -19,8 +12,6 @@ local redis = {
log = empty,
set_repl = empty,
replicate_commands = empty,
breakpoint = empty,
debug = empty,
},
},

Expand Down
13 changes: 13 additions & 0 deletions src/luacheck/builtin_standards/redis_functions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local empty = {}

local redis_functions = {
fields = {
redis = {
fields = {
register_function = empty,
},
}
}
}

return redis_functions
20 changes: 20 additions & 0 deletions src/luacheck/builtin_standards/redis_scripts.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local empty = {}

local redis_scripts = {
fields = {
ARGV = {
other_fields = true,
},
KEYS = {
other_fields = true,
},
redis = {
fields = {
breakpoint = empty,
debug = empty,
},
}
}
}

return redis_scripts

0 comments on commit db9c87e

Please sign in to comment.