From 8fef8630fe25e2ceaf8348c19cbc8911a7b1b04c Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 3 Aug 2021 11:14:49 +0200 Subject: [PATCH] Remove the LGTM configuration and inline disable comments (issue 13829) Given that the GitHub Advanced Security workflow now covers everything that LGTM does, but generally faster and with better GitHub-integration, there's no longer much point in also running LGTM separately. As a follow-up to this patch, we should also disable/remove the LGTM-integration from the PDF.js repository. --- lgtm.yml | 9 --------- src/core/file_spec.js | 2 +- test/integration/scripting_spec.js | 2 +- test/webserver.js | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 lgtm.yml diff --git a/lgtm.yml b/lgtm.yml deleted file mode 100644 index be612879a..000000000 --- a/lgtm.yml +++ /dev/null @@ -1,9 +0,0 @@ -path_classifiers: - test: - - exclude: test - - test/resources - -queries: - # Already handled by the "no-unused-vars" ESLint rule. - - exclude: js/unused-local-variable - - exclude: js/useless-assignment-to-local diff --git a/src/core/file_spec.js b/src/core/file_spec.js index 7db874d5b..151a48e7a 100644 --- a/src/core/file_spec.js +++ b/src/core/file_spec.js @@ -66,7 +66,7 @@ class FileSpec { get filename() { if (!this._filename && this.root) { const filename = pickPlatformItem(this.root) || "unnamed"; - this._filename = stringToPDFString(filename) // lgtm [js/double-escaping] + this._filename = stringToPDFString(filename) .replace(/\\\\/g, "\\") .replace(/\\\//g, "/") .replace(/\\/g, "/"); diff --git a/test/integration/scripting_spec.js b/test/integration/scripting_spec.js index 8532cc7ac..31ff21010 100644 --- a/test/integration/scripting_spec.js +++ b/test/integration/scripting_spec.js @@ -22,7 +22,7 @@ describe("Interaction", () => { } await action(); await page.waitForFunction( - `document.querySelector("${selector.replace("\\", "\\\\")}").value !== ""` // lgtm [js/incomplete-sanitization] + `document.querySelector("${selector.replace("\\", "\\\\")}").value !== ""` ); return page.$eval(selector, el => el.value); } diff --git a/test/webserver.js b/test/webserver.js index ccf384716..c2d5b96de 100644 --- a/test/webserver.js +++ b/test/webserver.js @@ -153,7 +153,7 @@ WebServer.prototype = { fileSize = stats.size; var isDir = stats.isDirectory(); if (isDir && !/\/$/.test(pathPart)) { - res.setHeader("Location", pathPart + "/" + urlParts[2]); // lgtm [js/server-side-unvalidated-url-redirection] + res.setHeader("Location", pathPart + "/" + urlParts[2]); res.writeHead(301); res.end("Redirected", "utf8"); return;