vairious: Add annotation when an empty environment is set [luacheck]

This commit is contained in:
Kim Alvefur 2018-02-28 20:06:26 +01:00
parent 8e377a8d55
commit 43b814a83b
46 changed files with 46 additions and 0 deletions

View file

@ -55,6 +55,7 @@ local luasec_has = softreq"ssl.config" or {
};
local _ENV = nil;
-- luacheck: std none
-- Global SSL options if not overridden per-host
local global_ssl_config = configmanager.get("*", "ssl");

View file

@ -24,6 +24,7 @@ local nameprep = encodings and encodings.stringprep.nameprep or function (host)
local _M = {};
local _ENV = nil;
-- luacheck: std none
_M.resolve_relative_path = resolve_relative_path; -- COMPAT

View file

@ -27,6 +27,7 @@ local tostring, type = tostring, type;
local setmetatable = setmetatable;
local _ENV = nil;
-- luacheck: std none
local host_mt = { }
function host_mt:__tostring()

View file

@ -24,6 +24,7 @@ _G.log = logger.init("general");
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;

View file

@ -38,6 +38,7 @@ local component_inheritable_modules = {"tls", "saslauth", "dialback", "iq", "s2s
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;

View file

@ -15,6 +15,7 @@ local prosody = prosody;
local fire_event = prosody.events.fire_event;
local _ENV = nil;
-- luacheck: std none
--- Config

View file

@ -23,6 +23,7 @@ local st = require "util.stanza";
local storagemanager = require "core.storagemanager";
local _ENV = nil;
-- luacheck: std none
local save_roster; -- forward declaration

View file

@ -23,6 +23,7 @@ local incoming_s2s = incoming_s2s;
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 = {} };

View file

@ -26,6 +26,7 @@ local initialize_filters = require "util.filters".initialize;
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() };

View file

@ -12,6 +12,7 @@ local log = require "util.logger".init("storagemanager");
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

View file

@ -24,6 +24,7 @@ local setmetatable = setmetatable;
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;

View file

@ -17,6 +17,7 @@ local setmetatable = setmetatable;
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 };

View file

@ -3,6 +3,7 @@ local log = require "util.logger".init("net.connlisteners");
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");

View file

@ -73,6 +73,7 @@ local default_timeout = 15;
-------------------------------------------------- module dns
local _ENV = nil;
-- luacheck: std none
local dns = {};

View file

@ -27,6 +27,7 @@ local error = error
local log = require "util.logger".init("http");
local _ENV = nil;
-- luacheck: std none
local requests = {}; -- Open requests

View file

@ -3,6 +3,7 @@ local log = require "util.logger".init("net.httpserver");
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");

View file

@ -28,6 +28,7 @@ local _SOCKETINVALID = socket._SOCKETINVALID or -1;
assert(socket.tcp6 and socket.tcp4, "Incompatible LuaSocket version");
local _ENV = nil;
-- luacheck: std none
local default_config = { __index = {
read_timeout = 900;

View file

@ -13,6 +13,7 @@ local t_insert, t_sort, t_concat = table.insert, table.sort, table.concat;
local ipairs = ipairs;
local _ENV = nil;
-- luacheck: std none
local function calculate_hash(disco_info)
local identities, features, extensions = {}, {}, {};

View file

@ -14,6 +14,7 @@ local st = require "util.stanza";
local jid_prep = require "util.jid".prep;
local _ENV = nil;
-- luacheck: std none
local xmlns_forms = 'jabber:x:data';

View file

@ -40,6 +40,7 @@ pcall(function()
end);
local _ENV = nil;
-- luacheck: std none
---- utils -----
local encode, decode, store_encode;

View file

@ -15,6 +15,7 @@ local os_difftime = os.difftime;
local tonumber = tonumber;
local _ENV = nil;
-- luacheck: std none
local function date(t)
return os_date("!%Y-%m-%d", t);

View file

@ -15,6 +15,7 @@ local setmetatable = setmetatable;
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

View file

@ -9,6 +9,7 @@
local t_insert, t_remove = table.insert, table.remove;
local _ENV = nil;
-- luacheck: std none
local new_filter_hooks = {};

View file

@ -25,6 +25,7 @@ local unescapes = {};
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

View file

@ -10,6 +10,7 @@
local pairs = pairs;
local _ENV = nil;
-- luacheck: std none
local level_sinks = {};

View file

@ -12,6 +12,7 @@ local pairs, next, type = pairs, next, type;
local unpack = table.unpack or unpack; --luacheck: ignore 113 143
local _ENV = nil;
-- luacheck: std none
local function get(self, ...)
local t = self.data;

View file

@ -20,6 +20,7 @@ local assert = assert;
local require = require;
local _ENV = nil;
-- luacheck: std none
--[[
Authentication Backend Prototypes:

View file

@ -15,6 +15,7 @@
local generate_uuid = require "util.uuid".generate;
local _ENV = nil;
-- luacheck: std none
--=========================
--SASL ANONYMOUS according to RFC 4505

View file

@ -26,6 +26,7 @@ local generate_uuid = require "util.uuid".generate;
local nodeprep = require "util.encodings".stringprep.nodeprep;
local _ENV = nil;
-- luacheck: std none
--=========================
--SASL DIGEST-MD5 according to RFC 2831

View file

@ -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);

View file

@ -17,6 +17,7 @@ local nodeprep = require "util.encodings".stringprep.nodeprep;
local log = require "util.logger".init("sasl");
local _ENV = nil;
-- luacheck: std none
-- ================================
-- SASL PLAIN according to RFC 4616

View file

@ -26,6 +26,7 @@ local char = string.char;
local byte = string.byte;
local _ENV = nil;
-- luacheck: std none
--=========================
--SASL SCRAM-SHA-1 according to RFC 5802

View file

@ -61,6 +61,7 @@ local sasl_errstring = {
setmetatable(sasl_errstring, { __index = function() return "undefined error!" end });
local _ENV = nil;
-- luacheck: std none
local method = {};
method.__index = method;

View file

@ -21,6 +21,7 @@ local log = require "util.logger".init("serialization");
local envload = require"util.envload".envload;
local _ENV = nil;
-- luacheck: std none
local indent = function(i)
return string_rep("\t", i);

View file

@ -11,6 +11,7 @@ local ipairs, pairs, setmetatable, next, tostring =
local t_concat = table.concat;
local _ENV = nil;
-- luacheck: std none
local set_mt = { __name = "set" };
function set_mt.__call(set, _, k)

View file

@ -14,6 +14,7 @@ DBI.Drivers();
local build_url = require "socket.url".build;
local _ENV = nil;
-- luacheck: std none
local column_mt = {};
local table_mt = {};

View file

@ -8,6 +8,7 @@ local t_insert = table.insert;
local setmetatable = setmetatable;
local _ENV = nil;
-- luacheck: std none
local handlers = { };
local finalisers = { };

View file

@ -37,6 +37,7 @@ end
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;

View file

@ -10,6 +10,7 @@ local t_remove = table.remove;
local parse_xml = require "util.xml".parse;
local _ENV = nil;
-- luacheck: std none
local function trim_xml(stanza)
for i=#stanza,1,-1 do

View file

@ -26,6 +26,7 @@ end
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;

View file

@ -3,6 +3,7 @@ local gettime = require "util.time".now
local setmetatable = setmetatable;
local _ENV = nil;
-- luacheck: std none
local throttle = {};
local throttle_mt = { __index = throttle };

View file

@ -16,6 +16,7 @@ local tostring = tostring;
local xpcall = xpcall;
local _ENV = nil;
-- luacheck: std none
local _add_task = server.add_task;

View file

@ -3,6 +3,7 @@ local setmetatable = setmetatable;
local os_time = os.time;
local _ENV = nil;
-- luacheck: std none
local watchdog_methods = {};
local watchdog_mt = { __index = watchdog_methods };

View file

@ -25,6 +25,7 @@ local log = require "util.logger".init("x509");
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

View file

@ -5,6 +5,7 @@ local t_insert = table.insert;
local t_remove = table.remove;
local _ENV = nil;
-- luacheck: std none
local parse_xml = (function()
local ns_prefixes = {

View file

@ -25,6 +25,7 @@ local lxp_supports_bytecount = not not lxp.new({}).getcurrentbytecount;
local default_stanza_size_limit = 1024*1024*10; -- 10MB
local _ENV = nil;
-- luacheck: std none
local new_parser = lxp.new;