# HG changeset patch # User Kim Alvefur # Date 1519844786 -3600 # Node ID 4f0f5b49bb0309ffec5ff340004de28c367cd074 # Parent 12a68e0d0ecf40fafd43d1346b7a9eb54d42d85c vairious: Add annotation when an empty environment is set [luacheck] diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/certmanager.lua --- a/core/certmanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/certmanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -55,6 +55,7 @@ }; local _ENV = nil; +-- luacheck: std none -- Global SSL options if not overridden per-host local global_ssl_config = configmanager.get("*", "ssl"); diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/configmanager.lua --- a/core/configmanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/configmanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -24,6 +24,7 @@ local _M = {}; local _ENV = nil; +-- luacheck: std none _M.resolve_relative_path = resolve_relative_path; -- COMPAT diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/hostmanager.lua --- a/core/hostmanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/hostmanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -27,6 +27,7 @@ local setmetatable = setmetatable; local _ENV = nil; +-- luacheck: std none local host_mt = { } function host_mt:__tostring() diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/loggingmanager.lua --- a/core/loggingmanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/loggingmanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -24,6 +24,7 @@ prosody.log = logger.init("general"); local _ENV = nil; +-- luacheck: std none -- The log config used if none specified in the config file (see reload_logging for initialization) local default_logging; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/modulemanager.lua --- a/core/modulemanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/modulemanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -38,6 +38,7 @@ local _G = _G; local _ENV = nil; +-- luacheck: std none local load_modules_for_host, load, unload, reload, get_module, get_items; local get_modules, is_loaded, module_has_method, call_module_method; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/portmanager.lua --- a/core/portmanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/portmanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -15,6 +15,7 @@ local fire_event = prosody.events.fire_event; local _ENV = nil; +-- luacheck: std none --- Config diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/rostermanager.lua --- a/core/rostermanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/rostermanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -23,6 +23,7 @@ local storagemanager = require "core.storagemanager"; local _ENV = nil; +-- luacheck: std none local save_roster; -- forward declaration diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/s2smanager.lua --- a/core/s2smanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/s2smanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -23,6 +23,7 @@ local fire_event = prosody.events.fire_event; local _ENV = nil; +-- luacheck: std none local function new_incoming(conn) local session = { conn = conn, type = "s2sin_unauthed", direction = "incoming", hosts = {} }; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/sessionmanager.lua --- a/core/sessionmanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/sessionmanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -26,6 +26,7 @@ local gettime = require "socket".gettime; local _ENV = nil; +-- luacheck: std none local function new_session(conn) local session = { conn = conn, type = "c2s_unauthed", conntime = gettime() }; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/storagemanager.lua --- a/core/storagemanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/storagemanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -12,6 +12,7 @@ local prosody = prosody; local _ENV = nil; +-- luacheck: std none local olddm = {}; -- maintain old datamanager, for backwards compatibility for k,v in pairs(datamanager) do olddm[k] = v; end diff -r 12a68e0d0ecf -r 4f0f5b49bb03 core/usermanager.lua --- a/core/usermanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/core/usermanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -24,6 +24,7 @@ local default_provider = "internal_plain"; local _ENV = nil; +-- luacheck: std none local function new_null_provider() local function dummy() return nil, "method not implemented"; end; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 net/adns.lua --- a/net/adns.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/net/adns.lua Wed Feb 28 20:06:26 2018 +0100 @@ -17,6 +17,7 @@ local function dummy_send(sock, data, i, j) return (j-i)+1; end local _ENV = nil; +-- luacheck: std none local async_resolver_methods = {}; local async_resolver_mt = { __index = async_resolver_methods }; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 net/connlisteners.lua --- a/net/connlisteners.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/net/connlisteners.lua Wed Feb 28 20:06:26 2018 +0100 @@ -3,6 +3,7 @@ local traceback = debug.traceback; local _ENV = nil; +-- luacheck: std none local function fail() log("error", "Attempt to use legacy connlisteners API. For more info see https://prosody.im/doc/developers/network"); diff -r 12a68e0d0ecf -r 4f0f5b49bb03 net/dns.lua --- a/net/dns.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/net/dns.lua Wed Feb 28 20:06:26 2018 +0100 @@ -73,6 +73,7 @@ -------------------------------------------------- module dns local _ENV = nil; +-- luacheck: std none local dns = {}; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 net/http.lua --- a/net/http.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/net/http.lua Wed Feb 28 20:06:26 2018 +0100 @@ -27,6 +27,7 @@ local log = require "util.logger".init("http"); local _ENV = nil; +-- luacheck: std none local requests = {}; -- Open requests diff -r 12a68e0d0ecf -r 4f0f5b49bb03 net/httpserver.lua --- a/net/httpserver.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/net/httpserver.lua Wed Feb 28 20:06:26 2018 +0100 @@ -3,6 +3,7 @@ local traceback = debug.traceback; local _ENV = nil; +-- luacheck: std none function fail() log("error", "Attempt to use legacy HTTP API. For more info see https://prosody.im/doc/developers/legacy_http"); diff -r 12a68e0d0ecf -r 4f0f5b49bb03 net/server_epoll.lua --- a/net/server_epoll.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/net/server_epoll.lua Wed Feb 28 20:06:26 2018 +0100 @@ -28,6 +28,7 @@ assert(socket.tcp6 and socket.tcp4, "Incompatible LuaSocket version"); local _ENV = nil; +-- luacheck: std none local default_config = { __index = { read_timeout = 900; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/caps.lua --- a/util/caps.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/caps.lua Wed Feb 28 20:06:26 2018 +0100 @@ -13,6 +13,7 @@ local ipairs = ipairs; local _ENV = nil; +-- luacheck: std none local function calculate_hash(disco_info) local identities, features, extensions = {}, {}, {}; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/dataforms.lua --- a/util/dataforms.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/dataforms.lua Wed Feb 28 20:06:26 2018 +0100 @@ -14,6 +14,7 @@ local jid_prep = require "util.jid".prep; local _ENV = nil; +-- luacheck: std none local xmlns_forms = 'jabber:x:data'; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/datamanager.lua --- a/util/datamanager.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/datamanager.lua Wed Feb 28 20:06:26 2018 +0100 @@ -40,6 +40,7 @@ end); local _ENV = nil; +-- luacheck: std none ---- utils ----- local encode, decode, store_encode; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/datetime.lua --- a/util/datetime.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/datetime.lua Wed Feb 28 20:06:26 2018 +0100 @@ -15,6 +15,7 @@ local tonumber = tonumber; local _ENV = nil; +-- luacheck: std none local function date(t) return os_date("!%Y-%m-%d", t); diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/events.lua --- a/util/events.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/events.lua Wed Feb 28 20:06:26 2018 +0100 @@ -15,6 +15,7 @@ local next = next; local _ENV = nil; +-- luacheck: std none local function new() -- Map event name to ordered list of handlers (lazily built): handlers[event_name] = array_of_handler_functions diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/filters.lua --- a/util/filters.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/filters.lua Wed Feb 28 20:06:26 2018 +0100 @@ -9,6 +9,7 @@ local t_insert, t_remove = table.insert, table.remove; local _ENV = nil; +-- luacheck: std none local new_filter_hooks = {}; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/jid.lua --- a/util/jid.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/jid.lua Wed Feb 28 20:06:26 2018 +0100 @@ -25,6 +25,7 @@ for k,v in pairs(escapes) do unescapes[v] = k; end local _ENV = nil; +-- luacheck: std none local function split(jid) if not jid then return; end diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/logger.lua --- a/util/logger.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/logger.lua Wed Feb 28 20:06:26 2018 +0100 @@ -10,6 +10,7 @@ local pairs = pairs; local _ENV = nil; +-- luacheck: std none local level_sinks = {}; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/multitable.lua --- a/util/multitable.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/multitable.lua Wed Feb 28 20:06:26 2018 +0100 @@ -12,6 +12,7 @@ local unpack = table.unpack or unpack; --luacheck: ignore 113 143 local _ENV = nil; +-- luacheck: std none local function get(self, ...) local t = self.data; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sasl.lua --- a/util/sasl.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sasl.lua Wed Feb 28 20:06:26 2018 +0100 @@ -20,6 +20,7 @@ local require = require; local _ENV = nil; +-- luacheck: std none --[[ Authentication Backend Prototypes: diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sasl/anonymous.lua --- a/util/sasl/anonymous.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sasl/anonymous.lua Wed Feb 28 20:06:26 2018 +0100 @@ -15,6 +15,7 @@ local generate_uuid = require "util.uuid".generate; local _ENV = nil; +-- luacheck: std none --========================= --SASL ANONYMOUS according to RFC 4505 diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sasl/digest-md5.lua --- a/util/sasl/digest-md5.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sasl/digest-md5.lua Wed Feb 28 20:06:26 2018 +0100 @@ -26,6 +26,7 @@ local nodeprep = require "util.encodings".stringprep.nodeprep; local _ENV = nil; +-- luacheck: std none --========================= --SASL DIGEST-MD5 according to RFC 2831 diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sasl/external.lua --- a/util/sasl/external.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sasl/external.lua Wed Feb 28 20:06:26 2018 +0100 @@ -1,6 +1,7 @@ local saslprep = require "util.encodings".stringprep.saslprep; local _ENV = nil; +-- luacheck: std none local function external(self, message) message = saslprep(message); diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sasl/plain.lua --- a/util/sasl/plain.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sasl/plain.lua Wed Feb 28 20:06:26 2018 +0100 @@ -17,6 +17,7 @@ local log = require "util.logger".init("sasl"); local _ENV = nil; +-- luacheck: std none -- ================================ -- SASL PLAIN according to RFC 4616 diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sasl/scram.lua --- a/util/sasl/scram.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sasl/scram.lua Wed Feb 28 20:06:26 2018 +0100 @@ -26,6 +26,7 @@ local byte = string.byte; local _ENV = nil; +-- luacheck: std none --========================= --SASL SCRAM-SHA-1 according to RFC 5802 diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sasl_cyrus.lua --- a/util/sasl_cyrus.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sasl_cyrus.lua Wed Feb 28 20:06:26 2018 +0100 @@ -61,6 +61,7 @@ setmetatable(sasl_errstring, { __index = function() return "undefined error!" end }); local _ENV = nil; +-- luacheck: std none local method = {}; method.__index = method; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/serialization.lua --- a/util/serialization.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/serialization.lua Wed Feb 28 20:06:26 2018 +0100 @@ -21,6 +21,7 @@ local envload = require"util.envload".envload; local _ENV = nil; +-- luacheck: std none local indent = function(i) return string_rep("\t", i); diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/set.lua --- a/util/set.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/set.lua Wed Feb 28 20:06:26 2018 +0100 @@ -11,6 +11,7 @@ local t_concat = table.concat; local _ENV = nil; +-- luacheck: std none local set_mt = { __name = "set" }; function set_mt.__call(set, _, k) diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sql.lua --- a/util/sql.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sql.lua Wed Feb 28 20:06:26 2018 +0100 @@ -14,6 +14,7 @@ local build_url = require "socket.url".build; local _ENV = nil; +-- luacheck: std none local column_mt = {}; local table_mt = {}; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/sslconfig.lua --- a/util/sslconfig.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/sslconfig.lua Wed Feb 28 20:06:26 2018 +0100 @@ -8,6 +8,7 @@ local setmetatable = setmetatable; local _ENV = nil; +-- luacheck: std none local handlers = { }; local finalisers = { }; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/stanza.lua --- a/util/stanza.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/stanza.lua Wed Feb 28 20:06:26 2018 +0100 @@ -37,6 +37,7 @@ local xmlns_stanzas = "urn:ietf:params:xml:ns:xmpp-stanzas"; local _ENV = nil; +-- luacheck: std none local stanza_mt = { __name = "stanza" }; stanza_mt.__index = stanza_mt; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/template.lua --- a/util/template.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/template.lua Wed Feb 28 20:06:26 2018 +0100 @@ -10,6 +10,7 @@ local parse_xml = require "util.xml".parse; local _ENV = nil; +-- luacheck: std none local function trim_xml(stanza) for i=#stanza,1,-1 do diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/termcolours.lua --- a/util/termcolours.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/termcolours.lua Wed Feb 28 20:06:26 2018 +0100 @@ -26,6 +26,7 @@ local orig_color = windows and windows.get_consolecolor and windows.get_consolecolor(); local _ENV = nil; +-- luacheck: std none local stylemap = { reset = 0; bright = 1, dim = 2, underscore = 4, blink = 5, reverse = 7, hidden = 8; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/throttle.lua --- a/util/throttle.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/throttle.lua Wed Feb 28 20:06:26 2018 +0100 @@ -3,6 +3,7 @@ local setmetatable = setmetatable; local _ENV = nil; +-- luacheck: std none local throttle = {}; local throttle_mt = { __index = throttle }; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/timer.lua --- a/util/timer.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/timer.lua Wed Feb 28 20:06:26 2018 +0100 @@ -16,6 +16,7 @@ local xpcall = xpcall; local _ENV = nil; +-- luacheck: std none local _add_task = server.add_task; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/watchdog.lua --- a/util/watchdog.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/watchdog.lua Wed Feb 28 20:06:26 2018 +0100 @@ -3,6 +3,7 @@ local os_time = os.time; local _ENV = nil; +-- luacheck: std none local watchdog_methods = {}; local watchdog_mt = { __index = watchdog_methods }; diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/x509.lua --- a/util/x509.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/x509.lua Wed Feb 28 20:06:26 2018 +0100 @@ -25,6 +25,7 @@ local s_format = string.format; local _ENV = nil; +-- luacheck: std none local oid_commonname = "2.5.4.3"; -- [LDAP] 2.3 local oid_subjectaltname = "2.5.29.17"; -- [PKIX] 4.2.1.6 diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/xml.lua --- a/util/xml.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/xml.lua Wed Feb 28 20:06:26 2018 +0100 @@ -5,6 +5,7 @@ local t_remove = table.remove; local _ENV = nil; +-- luacheck: std none local parse_xml = (function() local ns_prefixes = { diff -r 12a68e0d0ecf -r 4f0f5b49bb03 util/xmppstream.lua --- a/util/xmppstream.lua Wed Feb 28 18:12:20 2018 +0100 +++ b/util/xmppstream.lua Wed Feb 28 20:06:26 2018 +0100 @@ -25,6 +25,7 @@ local default_stanza_size_limit = 1024*1024*10; -- 10MB local _ENV = nil; +-- luacheck: std none local new_parser = lxp.new;