diff options
author | Kim Alvefur <zash@zash.se> | 2017-03-04 20:09:28 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-03-04 20:09:28 +0100 |
commit | e45c5961ac42007aa6c9282afddff91cd1e27124 (patch) | |
tree | c6228dea80fc393abf6eaf11909eca109d0cd30e | |
parent | c723d21b83a0d219f1087459f48c863e38910bcf (diff) | |
download | prosody-e45c5961ac42007aa6c9282afddff91cd1e27124.tar.gz prosody-e45c5961ac42007aa6c9282afddff91cd1e27124.zip |
core: Allow select core modules to mutate some globals (needs luacheck 1.19)
-rw-r--r-- | .luacheckrc | 3 | ||||
-rw-r--r-- | core/loggingmanager.lua | 2 | ||||
-rw-r--r-- | core/rostermanager.lua | 2 | ||||
-rw-r--r-- | core/sessionmanager.lua | 1 |
4 files changed, 5 insertions, 3 deletions
diff --git a/.luacheckrc b/.luacheckrc index 4d7ae76e..0040cfbb 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -10,7 +10,8 @@ ignore = { "411/err", "421/err", "411/ok", "421/ok", "211/_ENV" } max_line_length = 150 files["core/"] = { - ignore = { "122/prosody", "122/hosts" }; + read_globals = { "prosody", "hosts" }; + globals = { "prosody.hosts.?", "hosts.?" }; } files["plugins/"] = { globals = { "module" }; diff --git a/core/loggingmanager.lua b/core/loggingmanager.lua index e3a83817..14305588 100644 --- a/core/loggingmanager.lua +++ b/core/loggingmanager.lua @@ -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 = diff --git a/core/rostermanager.lua b/core/rostermanager.lua index 88bd1e66..dc60ccdf 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -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 diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua index c5b08098..f7f36ae3 100644 --- a/core/sessionmanager.lua +++ b/core/sessionmanager.lua @@ -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; |