Changeset

8638:f8f45bbbd8ba

util.startup: Ignore various globals being read and written as part of startup [luacheck]
author Kim Alvefur <zash@zash.se>
date Wed, 21 Mar 2018 16:30:24 +0100
parents 8637:c8368c7c81a1
children 8639:070a77c15f63
files util/startup.lua
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/startup.lua	Wed Mar 21 10:26:29 2018 +0100
+++ b/util/startup.lua	Wed Mar 21 16:30:24 2018 +0100
@@ -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 @@
 		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 @@
 			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 @@
 end
 
 function startup.init_global_state()
+	-- luacheck: ignore 121
 	prosody.bare_sessions = {};
 	prosody.full_sessions = {};
 	prosody.hosts = {};
@@ -199,6 +202,7 @@
 	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 @@
 	-- 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 {