commit 22604a2: [Minor] Apply luacheck suggestions

Vsevolod Stakhov vsevolod at rspamd.com
Sun Dec 4 19:49:03 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-12-04 19:48:43 +0000
URL: https://github.com/rspamd/rspamd/commit/22604a259063b4eeaa9498c0ccd2a3f953467c9e (HEAD -> master)

[Minor] Apply luacheck suggestions

---
 test/functional/lua/hashes.lua | 2 +-
 utils/sa_trivial_convert.lua   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/functional/lua/hashes.lua b/test/functional/lua/hashes.lua
index f02e01c4e..7a1728b55 100644
--- a/test/functional/lua/hashes.lua
+++ b/test/functional/lua/hashes.lua
@@ -59,7 +59,7 @@ rspamd_config:register_symbol({
         h:reset()
       end
       h:update(t['str'])
-      if not (h:hex() == t['hex']) then
+      if h:hex() ~= t['hex'] then
         t['error'] = 'sum mismatch: ' .. h:hex()
         table.insert(worry, logger.slog('%1', t))
       end
diff --git a/utils/sa_trivial_convert.lua b/utils/sa_trivial_convert.lua
index 56a01adfa..2ea53bed1 100644
--- a/utils/sa_trivial_convert.lua
+++ b/utils/sa_trivial_convert.lua
@@ -99,7 +99,7 @@ local function handle_header_def(hline, cur_rule)
         end
     end
 
-    cur_rule['ordinary'] = ordinary and (not (#hdr_params > 1))
+    cur_rule['ordinary'] = ordinary and #hdr_params <= 1
     cur_rule['header'] = hdr_params
   end
 end
@@ -435,7 +435,7 @@ mmap_conf:close()
 rspamd_logger.messagex('stored multimap conf in %s', 'auto_multimap.conf')
 
 local sa_remain = io.open('auto_sa.conf', 'w')
-fun.each(function(l) 
+fun.each(function(l)
   sa_remain:write(l)
   sa_remain:write('\n')
 end, fun.filter(function(l) return not string.match(l, '^%s+$') end, complicated))


More information about the Commits mailing list