commit e59e7c6: [Minor] Pet luacheck

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Dec 27 18:28:13 UTC 2018


Author: Vsevolod Stakhov
Date: 2018-12-25 07:43:41 +0000
URL: https://github.com/rspamd/rspamd/commit/e59e7c632a6a71c9b4cc0b9cea0e14fad079bb2f

[Minor] Pet luacheck

---
 .luacheckrc                        | 3 +++
 rules/mid.lua                      | 6 ++++--
 rules/regexp/compromised_hosts.lua | 3 ++-
 rules/regexp/headers.lua           | 3 ++-
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/.luacheckrc b/.luacheckrc
index f9ec38d20..4b1078d08 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -68,5 +68,8 @@ files['test/functional/lua/test_coverage.lua'].globals = {
   '__GLOBAL_COVERAGE_WATCHDOG'
 }
 
+files['/**/rules/'].ignore = {'631'}
+files['/**/test/functional/'].ignore = {'631'}
+
 max_string_line_length = 500
 max_comment_line_length = 500
\ No newline at end of file
diff --git a/rules/mid.lua b/rules/mid.lua
index 60df4bd1f..b04a8bb46 100644
--- a/rules/mid.lua
+++ b/rules/mid.lua
@@ -77,7 +77,8 @@ local check_mid_id = rspamd_config:register_symbol({
 rspamd_config:register_virtual_symbol('MID_BARE_IP', 1.0, check_mid_id)
 rspamd_config:set_metric_symbol('MID_BARE_IP', 2.0, 'Message-ID RHS is a bare IP address', 'default', 'Message ID')
 rspamd_config:register_virtual_symbol('MID_RHS_NOT_FQDN', 1.0, check_mid_id)
-rspamd_config:set_metric_symbol('MID_RHS_NOT_FQDN', 0.5, 'Message-ID RHS is not a fully-qualified domain name', 'default', 'Message ID')
+rspamd_config:set_metric_symbol('MID_RHS_NOT_FQDN', 0.5,
+    'Message-ID RHS is not a fully-qualified domain name', 'default', 'Message ID')
 rspamd_config:register_virtual_symbol('MID_MISSING_BRACKETS', 1.0, check_mid_id)
 rspamd_config:set_metric_symbol('MID_MISSING_BRACKETS', 0.5, 'Message-ID is missing <>\'s', 'default', 'Message ID')
 rspamd_config:register_virtual_symbol('MID_RHS_IP_LITERAL', 1.0, check_mid_id)
@@ -85,7 +86,8 @@ rspamd_config:set_metric_symbol('MID_RHS_IP_LITERAL', 0.5, 'Message-ID RHS is an
 rspamd_config:register_virtual_symbol('MID_CONTAINS_FROM', 1.0, check_mid_id)
 rspamd_config:set_metric_symbol('MID_CONTAINS_FROM', 1.0, 'Message-ID contains From address', 'default', 'Message ID')
 rspamd_config:register_virtual_symbol('MID_RHS_MATCH_FROM', 1.0, check_mid_id)
-rspamd_config:set_metric_symbol('MID_RHS_MATCH_FROM', 0.0, 'Message-ID RHS matches From domain', 'default', 'Message ID')
+rspamd_config:set_metric_symbol('MID_RHS_MATCH_FROM', 0.0,
+    'Message-ID RHS matches From domain', 'default', 'Message ID')
 rspamd_config:register_virtual_symbol('MID_CONTAINS_TO', 1.0, check_mid_id)
 rspamd_config:set_metric_symbol('MID_CONTAINS_TO', 1.0, 'Message-ID contains To address', 'default', 'Message ID')
 rspamd_config:register_virtual_symbol('MID_RHS_MATCH_TO', 1.0, check_mid_id)
diff --git a/rules/regexp/compromised_hosts.lua b/rules/regexp/compromised_hosts.lua
index 47af04eec..6ad2e6b93 100644
--- a/rules/regexp/compromised_hosts.lua
+++ b/rules/regexp/compromised_hosts.lua
@@ -140,7 +140,8 @@ reconf['HIDDEN_SOURCE_OBJ'] = {
   group = "compromised_hosts"
 }
 
-local hidden_uri_re = rspamd_regexp.create_cached('/(?!\\/\\.well[-_]known\\/)(?:^\\.[A-Za-z0-9]|\\/\\.[A-Za-z0-9]|\\/\\.\\.\\/)/i')
+local hidden_uri_re = rspamd_regexp.create_cached('/(?!\\/\\.well[-_]known\\/)(?:^\\.[A-Za-z0-9]|\\/'..
+    '\\.[A-Za-z0-9]|\\/\\.\\.\\/)/i')
 rspamd_config.URI_HIDDEN_PATH = {
   callback = function (task)
     local urls = task:get_urls(false)
diff --git a/rules/regexp/headers.lua b/rules/regexp/headers.lua
index a8c6d5a85..b9993f7ce 100644
--- a/rules/regexp/headers.lua
+++ b/rules/regexp/headers.lua
@@ -118,7 +118,8 @@ reconf['MISSING_MID'] = {
 
 -- Received seems to be fake
 reconf['R_RCVD_SPAMBOTS'] = {
-  re = 'Received=/^from \\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\] by [-.\\w+]{5,255}; [SMTWF][a-z][a-z], [\\s\\d]?\\d [JFMAJSOND][a-z][a-z] \\d{4} \\d{2}:\\d{2}:\\d{2} [-+]\\d{4}$/mH',
+  re = 'Received=/^from \\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\] by [-.\\w+]{5,255}; [SMTWF][a-z][a-z],' ..
+      ' [\\s\\d]?\\d [JFMAJSOND][a-z][a-z] \\d{4} \\d{2}:\\d{2}:\\d{2} [-+]\\d{4}$/mH',
   score = 3.0,
   description = 'Spambots signatures in received headers',
   group = 'headers'


More information about the Commits mailing list