aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-03-21 16:30:24 +0100
committerKim Alvefur <zash@zash.se>2018-03-21 16:30:24 +0100
commit1ee365769e9ef1838321fcd8df1f66cc47f114d0 (patch)
tree97041a7b1c361f9246ce210a6ee1845177d08f66 /util
parent963e50958657a1207cbb2c34e2772c4ad7f1a8de (diff)
downloadprosody-1ee365769e9ef1838321fcd8df1f66cc47f114d0.tar.gz
prosody-1ee365769e9ef1838321fcd8df1f66cc47f114d0.zip
util.startup: Ignore various globals being read and written as part of startup [luacheck]
Diffstat (limited to 'util')
-rw-r--r--util/startup.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/util/startup.lua b/util/startup.lua
index bfe04e80..a1677375 100644
--- a/util/startup.lua
+++ b/util/startup.lua
@@ -1,3 +1,5 @@
+-- Ignore the CFG_* variables
+-- luacheck: ignore 113/CFG_CONFIGDIR 113/CFG_SOURCEDIR 113/CFG_DATADIR 113/CFG_PLUGINDIR
local startup = {};
local prosody = { events = require "util.events".new() };
@@ -27,7 +29,7 @@ function startup.read_config()
if file then
file:close();
prosody.config_file = filename;
- CFG_CONFIGDIR = filename:match("^(.*)[\\/][^\\/]*$");
+ CFG_CONFIGDIR = filename:match("^(.*)[\\/][^\\/]*$"); -- luacheck: ignore 111
break;
end
end
@@ -114,7 +116,7 @@ function startup.sandbox_require()
return env;
end
end
- function require(...)
+ function require(...) -- luacheck: ignore 121
local curr_env = getfenv(2);
local curr_env_mt = getmetatable(curr_env);
local _realG_mt = getmetatable(_realG);
@@ -184,6 +186,7 @@ function startup.chdir()
end
function startup.init_global_state()
+ -- luacheck: ignore 121
prosody.bare_sessions = {};
prosody.full_sessions = {};
prosody.hosts = {};
@@ -199,6 +202,7 @@ function startup.init_global_state()
if custom_plugin_paths then
local path_sep = package.config:sub(3,3);
-- path1;path2;path3;defaultpath...
+ -- luacheck: ignore 111
CFG_PLUGINDIR = table.concat(custom_plugin_paths, path_sep)..path_sep..(CFG_PLUGINDIR or "plugins");
end
prosody.paths = { source = CFG_SOURCEDIR, config = CFG_CONFIGDIR or ".",
@@ -459,6 +463,7 @@ function startup.make_dummy_hosts()
-- When running under prosodyctl, we don't want to
-- fully initialize the server, so we populate prosody.hosts
-- with just enough things for most code to work correctly
+ -- luacheck: ignore 122/hosts
prosody.core_post_stanza = function () end; -- TODO: mod_router!
local function make_host(hostname)
return {