]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Enforce maximum line length 4711/head
authormoisseev <moiseev@mezonplus.ru>
Sun, 19 Nov 2023 15:31:57 +0000 (18:31 +0300)
committermoisseev <moiseev@mezonplus.ru>
Sun, 19 Nov 2023 15:31:57 +0000 (18:31 +0300)
.eslintrc.json
interface/js/app/config.js
interface/js/app/graph.js
interface/js/app/history.js
interface/js/app/rspamd.js
interface/js/app/stats.js
interface/js/app/symbols.js
interface/js/app/upload.js

index 97ff7c8f6494d34b77de4727ef048505b8141739..a8cc237e09458cb5c16bc459c3ad621313c0955a 100644 (file)
@@ -51,7 +51,7 @@
         "@stylistic/dot-location": ["error", "property"],
         "@stylistic/function-call-argument-newline": "off",
         "@stylistic/indent": ["error", 4, { "SwitchCase": 1 }],
-        "@stylistic/max-len": ["error", { "code": 120 }],
+        "@stylistic/max-len": ["error", { "code": 128 }],
         "@stylistic/max-statements-per-line": ["error", { "max": 2 }],
         "@stylistic/multiline-ternary": ["error", "always-multiline"],
         "@stylistic/newline-per-chained-call": ["error", { "ignoreChainWithDepth": 5 }],
@@ -78,7 +78,6 @@
 
         "@stylistic/function-paren-newline": "off",
         "@stylistic/key-spacing": "off",
-        "@stylistic/max-len": "off",
         "@stylistic/one-var-declaration-per-line": "off"
     }
 }
index d62298693684135248b9e33ad0196375cfc833eb..e0adb365b132d9ae5490ee180de513bfa80c0fa7 100644 (file)
@@ -132,7 +132,8 @@ define(["jquery", "app/rspamd"],
                         }
                         const $tr = $("<tr>").append($td);
 
-                        const $span = $('<span class="map-link" data-bs-toggle="modal" data-bs-target="#modalDialog">' + item.uri + "</span>").data("item", item);
+                        const $span = $('<span class="map-link" data-bs-toggle="modal" data-bs-target="#modalDialog">' +
+                            item.uri + "</span>").data("item", item);
                         $span.wrap("<td>").parent().appendTo($tr);
                         $("<td>" + item.description + "</td>").appendTo($tr);
                         $tr.appendTo($tbody);
@@ -173,8 +174,8 @@ define(["jquery", "app/rspamd"],
                     // Highlighting a large amount of text is unresponsive
                     mode = (new Blob([data[0].data]).size > 5120) ? "basic" : $("input[name=editorMode]:checked").val();
 
-                    $("<" + editor[mode].elt + ' id="editor" class="' + editor[mode].class + '" data-id="' + item.map + '">' +
-                        "</" + editor[mode].elt + ">").appendTo("#modalBody");
+                    $("<" + editor[mode].elt + ' id="editor" class="' + editor[mode].class + '" data-id="' + item.map +
+                        '"></' + editor[mode].elt + ">").appendTo("#modalBody");
 
                     if (editor[mode].codejar) {
                         require(["codejar", "linenumbers", "prism"], function (CodeJar, withLineNumbers, Prism) {
index b7276f1c14ac8821be05b1bfa9a3aee5c058d3bd..154317fd794f104774c77110994adb6491934de0 100644 (file)
@@ -104,7 +104,8 @@ define(["jquery", "app/rspamd", "d3evolution", "d3pie", "d3", "footable"],
                     // Time intervals that don't have data are excluded from average calculation as d3.mean()ignores nulls
                     const avg = d3.mean(curr, function (d) { return d.y; });
                     // To find an integral on the whole time interval we need to convert nulls to zeroes
-                    const value = d3.mean(curr, function (d) { return Number(d.y); }) * timeInterval / scaleFactor ^ 0; // eslint-disable-line no-bitwise
+                    // eslint-disable-next-line no-bitwise
+                    const value = d3.mean(curr, function (d) { return Number(d.y); }) * timeInterval / scaleFactor ^ 0;
                     const yExtents = d3.extent(curr, function (d) { return d.y; });
 
                     total += value;
index 30fa06700b83e31e05be8f383abe623240e8f006..66e94a989c1c031779585151e19160380c874e52 100644 (file)
@@ -390,7 +390,10 @@ define(["jquery", "app/rspamd", "d3", "footable"],
                         style: {"font-size": "11px", "width": 300, "maxWidth": 300},
                         sortValue: function (val) { return Number(val.options.sortValue); }
                     },
-                    {name:"type", title:"Worker type", breakpoints:"xs sm", style:{"font-size":"11px", "width":150, "maxWidth":150}},
+                    {name:"type",
+                        title:"Worker type",
+                        breakpoints:"xs sm",
+                        style:{"font-size":"11px", "width":150, "maxWidth":150}},
                     {name:"pid", title:"PID", breakpoints:"xs sm", style:{"font-size":"11px", "width":110, "maxWidth":110}},
                     {name:"module", title:"Module", style:{"font-size":"11px"}},
                     {name:"id", title:"Internal ID", style:{"font-size":"11px"}},
index 4ad806d767d2f3f68361deb0e8b7ba5786ddacd9..ed732449de3eeb3eb89c474a1110a5ac71ab6f3a 100644 (file)
@@ -548,8 +548,8 @@ function ($, NProgress) {
         // Force options to be an object
         const o = options || {};
         Object.keys(o).forEach(function (option) {
-            if (["complete", "data", "error", "errorMessage", "errorOnceId", "headers", "method", "params", "server", "statusCode",
-                "success"]
+            if (["complete", "data", "error", "errorMessage", "errorOnceId", "headers", "method", "params", "server",
+                "statusCode", "success"]
                 .indexOf(option) < 0) {
                 throw new Error("Unknown option: " + option);
             }
@@ -902,7 +902,10 @@ function ($, NProgress) {
                     let rcpt = {};
                     if (!item.rcpt_mime.length) {
                         rcpt = format_rcpt(true, false);
-                    } else if ($(item.rcpt_mime).not(item.rcpt_smtp).length !== 0 || $(item.rcpt_smtp).not(item.rcpt_mime).length !== 0) {
+                    } else if (
+                        $(item.rcpt_mime).not(item.rcpt_smtp).length !== 0 ||
+                        $(item.rcpt_smtp).not(item.rcpt_mime).length !== 0
+                    ) {
                         rcpt = format_rcpt(true, true);
                     } else {
                         rcpt = format_rcpt(false, true);
index 86386fe56cc89cb2fb8bd8515560557700a46a4d..e6b7bc89759ed72feb2f4201f9c5e2ca03842ed3 100644 (file)
@@ -136,7 +136,9 @@ define(["jquery", "app/rspamd", "d3pie", "d3"],
                             if (max) {
                                 const f = d3.format(".3f");
                                 scan_times = {
-                                    data: "<small>" + f(min) + "/</small>" + f(d3.mean(val.data.scan_times)) + "<small>/" + f(max) + "</small>",
+                                    data: "<small>" + f(min) + "/</small>" +
+                                        f(d3.mean(val.data.scan_times)) +
+                                        "<small>/" + f(max) + "</small>",
                                     title: ' title="min/avg/max"'
                                 };
                             } else {
@@ -150,7 +152,8 @@ define(["jquery", "app/rspamd", "d3pie", "d3"],
                 }
 
                 $("#clusterTable tbody").append('<tr class="' + row_class + '">' +
-                '<td class="align-middle"><input type="radio" class="form-check m-auto" name="clusterName" value="' + key + '"></td>' +
+                '<td class="align-middle"><input type="radio" class="form-check m-auto" name="clusterName" value="' +
+                    key + '"></td>' +
                 "<td>" + key + "</td>" +
                 "<td>" + val.host + "</td>" +
                 '<td class="text-center"><span class="icon"><i class="' + glyph_status + '"></i></span></td>' +
index 7df5a8dfb669cb2396f2f215de60d07164696088..df3d28fad1bc13304aff749b2515626bb2b0f389 100644 (file)
@@ -201,7 +201,11 @@ define(["jquery", "app/rspamd", "footable"],
                             {name:"symbol", title:"Symbol", style:{"font-size":"11px"}},
                             {name:"description", title:"Description", breakpoints:"xs sm", style:{"font-size":"11px"}},
                             {name:"weight", title:"Score", style:{"font-size":"11px"}},
-                            {name:"frequency", title:"Frequency", breakpoints:"xs sm", style:{"font-size":"11px"}, sortValue:function (value) { return Number(value).toFixed(2); }},
+                            {name:"frequency",
+                                title:"Frequency",
+                                breakpoints:"xs sm",
+                                style:{"font-size":"11px"},
+                                sortValue:function (value) { return Number(value).toFixed(2); }},
                             {name:"time", title:"Avg. time", breakpoints:"xs sm", style:{"font-size":"11px"}},
                             {name:"save", title:"Save", style:{"font-size":"11px"}},
                         ],
index 26bb82e8ddc196f673ed51185f64f58b6852f5f6..3800ca23fc1224ea182d75d988ce2ab11d7c5dda 100644 (file)
@@ -256,7 +256,8 @@ define(["jquery", "app/rspamd"],
         });
 
         function enable_disable_scan_btn() {
-            $("#scan button:not(#cleanScanHistory, #scanOptionsToggle)").prop("disabled", ($.trim($("textarea").val()).length === 0));
+            $("#scan button:not(#cleanScanHistory, #scanOptionsToggle)")
+                .prop("disabled", ($.trim($("textarea").val()).length === 0));
         }
         enable_disable_scan_btn();
         $("textarea").on("input", function () {