core: Allow select core modules to mutate some globals (needs luacheck 1.19)
authorKim Alvefur <zash@zash.se>
Sat, 04 Mar 2017 20:09:28 +0100
changeset 7952 8acc35b5355a
parent 7951 ed99a8e3c260
child 7953 f91e7ec9654e
child 7954 2b91da49285a
core: Allow select core modules to mutate some globals (needs luacheck 1.19)
.luacheckrc
core/loggingmanager.lua
core/rostermanager.lua
core/sessionmanager.lua
--- a/.luacheckrc	Sat Mar 04 20:06:29 2017 +0100
+++ b/.luacheckrc	Sat Mar 04 20:09:28 2017 +0100
@@ -10,7 +10,8 @@
 max_line_length = 150
 
 files["core/"] = {
-	ignore = { "122/prosody", "122/hosts" };
+	read_globals = { "prosody", "hosts" };
+	globals = { "prosody.hosts.?", "hosts.?" };
 }
 files["plugins/"] = {
 	globals = { "module" };
--- a/core/loggingmanager.lua	Sat Mar 04 20:06:29 2017 +0100
+++ b/core/loggingmanager.lua	Sat Mar 04 20:09:28 2017 +0100
@@ -5,7 +5,7 @@
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
-
+-- luacheck: globals log prosody.log
 
 local format = string.format;
 local setmetatable, rawset, pairs, ipairs, type =
--- a/core/rostermanager.lua	Sat Mar 04 20:06:29 2017 +0100
+++ b/core/rostermanager.lua	Sat Mar 04 20:09:28 2017 +0100
@@ -5,7 +5,7 @@
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
-
+-- luacheck: globals prosody.bare_sessions.?.roster
 
 
 
--- a/core/sessionmanager.lua	Sat Mar 04 20:06:29 2017 +0100
+++ b/core/sessionmanager.lua	Sat Mar 04 20:09:28 2017 +0100
@@ -5,6 +5,7 @@
 -- This project is MIT/X11 licensed. Please see the
 -- COPYING file in the source package for more information.
 --
+-- luacheck: globals prosody.full_sessions prosody.bare_sessions
 
 local tostring, setmetatable = tostring, setmetatable;
 local pairs, next= pairs, next;