add backticks around the concrete parse error

This commit is contained in:
erik-krogh
2023-03-28 10:57:13 +02:00
parent 32bab0b8b2
commit e5e20ab42c
2 changed files with 3 additions and 3 deletions

View File

@@ -1236,8 +1236,8 @@ protected DependencyInstallationResult preparePackagesAndDependencies(Set<Path>
if (!extractor.getConfig().isExterns()) seenFiles = true; if (!extractor.getConfig().isExterns()) seenFiles = true;
List<ParseError> errors = loc == null ? Collections.emptyList() : loc.getParseErrors(); List<ParseError> errors = loc == null ? Collections.emptyList() : loc.getParseErrors();
for (ParseError err : errors) { for (ParseError err : errors) {
String msg = "A parse error occurred: " + StringUtil.escapeMarkdown(err.getMessage()) String msg = "A parse error occurred: `" + StringUtil.escapeMarkdown(err.getMessage()).trim()
+ ". Check the syntax of the file. If the file is invalid, correct the error or [exclude](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning) the file from analysis."; + "`. Check the syntax of the file. If the file is invalid, correct the error or [exclude](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning) the file from analysis.";
// file, relative to the source root // file, relative to the source root
String relativeFilePath = null; String relativeFilePath = null;
if (file.startsWith(LGTM_SRC)) { if (file.startsWith(LGTM_SRC)) {

View File

@@ -6,7 +6,7 @@
"startColumn": 4, "startColumn": 4,
"startLine": 1 "startLine": 1
}, },
"markdownMessage": "A parse error occurred: Unexpected token. Check the syntax of the file. If the file is invalid, correct the error or [exclude](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning) the file from analysis.", "markdownMessage": "A parse error occurred: `Unexpected token`. Check the syntax of the file. If the file is invalid, correct the error or [exclude](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning) the file from analysis.",
"severity": "warning", "severity": "warning",
"source": { "source": {
"extractorName": "javascript", "extractorName": "javascript",