commit 7a55c51: [Minor] Pet luacheck
Gregor Dschung
gregor at chkpnt.de
Sun Apr 19 20:28:08 UTC 2020
Author: Gregor Dschung
Date: 2020-04-19 11:13:55 +0200
URL: https://github.com/rspamd/rspamd/commit/7a55c51038fa71b4229c4cfbf3cd14044aeb1bc1 (refs/pull/3343/head)
[Minor] Pet luacheck
---
lualib/lua_selectors/extractors.lua | 3 ++-
lualib/lua_selectors/transforms.lua | 11 +++++++----
src/plugins/lua/force_actions.lua | 2 +-
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua
index 695371e79..c01a07f4b 100644
--- a/lualib/lua_selectors/extractors.lua
+++ b/lualib/lua_selectors/extractors.lua
@@ -423,7 +423,8 @@ The first argument must be header name.]],
return symbol[1],'table'
end
end,
- ['description'] = [[Get specific symbol. The first argument must be the symbol name. Returns the symbol table. See task:get_symbol()]],
+ ['description'] = 'Get specific symbol. The first argument must be the symbol name. ' ..
+ 'Returns the symbol table. See task:get_symbol()',
['args_schema'] = {ts.string}
},
diff --git a/lualib/lua_selectors/transforms.lua b/lualib/lua_selectors/transforms.lua
index 4cfff3654..85a445f67 100644
--- a/lualib/lua_selectors/transforms.lua
+++ b/lualib/lua_selectors/transforms.lua
@@ -413,7 +413,7 @@ Empty string comes the first argument or 'true', non-empty string comes nil]],
end
end,
['description'] = 'Applies mask to IP address.' ..
- ' The first argument is the mask for IPv4 addresses, the second is the mask for IPv6 addresses.',
+ ' The first argument is the mask for IPv4 addresses, the second is the mask for IPv6 addresses.',
['args_schema'] = {(ts.number + ts.string / tonumber),
(ts.number + ts.string / tonumber):is_optional()}
},
@@ -426,13 +426,16 @@ Empty string comes the first argument or 'true', non-empty string comes nil]],
['map_type'] = 'string',
['process'] = function(inp, _, args)
if type(inp) == 'table' then
- return fun.map( function(s) return string.gsub(tostring(s), '[\128-\255]', args[1] or '?') end , inp), 'string_list'
+ return fun.map(
+ function(s)
+ return string.gsub(tostring(s), '[\128-\255]', args[1] or '?')
+ end, inp), 'string_list'
else
return string.gsub(tostring(inp), '[\128-\255]', '?'), 'string'
end
-
end,
- ['description'] = 'Returns the string with all non-ascii bytes replaced with the character given as second argument or `?`',
+ ['description'] = 'Returns the string with all non-ascii bytes replaced with the character ' ..
+ 'given as second argument or `?`',
['args_schema'] = {ts.string:is_optional()}
},
diff --git a/src/plugins/lua/force_actions.lua b/src/plugins/lua/force_actions.lua
index eda87ead0..9654a836e 100644
--- a/src/plugins/lua/force_actions.lua
+++ b/src/plugins/lua/force_actions.lua
@@ -69,7 +69,7 @@ local function gen_cb(expr, act, pool, message, subject, raction, honor, limit,
-- create/reuse selector to extract value for this placeholder
local selector = selector_cache[selector_expr]
if not selector then
- selector_cache[selector_expr] = lua_selectors.create_selector_closure(rspamd_config, selector_expr, '', true)
+ selector_cache[selector_expr] = lua_selectors.create_selector_closure(rspamd_config, selector_expr, '', true)
selector = selector_cache[selector_expr]
if not selector then
rspamd_logger.errx(task, 'could not create selector [%1]', selector_expr)
More information about the Commits
mailing list