Skip to content

Commit 8096f86

Browse files
committed
Ruby: lower severity of parse error to warning
1 parent ebf0bb8 commit 8096f86

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

ruby/extractor/src/extractor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl<'a> Visitor<'a> {
294294
.diagnostics_writer
295295
.new_entry("parse-error", "Parse error");
296296
&mesg
297-
.severity(diagnostics::Severity::Error)
297+
.severity(diagnostics::Severity::Warning)
298298
.location(self.path, start_line, start_column, end_line, end_column)
299299
.message(message, args);
300300
if status_page {
@@ -405,7 +405,7 @@ impl<'a> Visitor<'a> {
405405
loc,
406406
self.diagnostics_writer
407407
.new_entry("parse-error", "Parse error")
408-
.severity(diagnostics::Severity::Error)
408+
.severity(diagnostics::Severity::Warning)
409409
.location(self.path, start_line, start_column, end_line, end_column)
410410
.message(
411411
"Unknown table type: {}",

ruby/ql/integration-tests/all-platforms/diagnostics/syntax-error/diagnostics.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"markdownMessage": "A parse error occurred. 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.",
1313
"plaintextMessage": "A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.",
14-
"severity": "Error",
14+
"severity": "Warning",
1515
"source": {
1616
"extractorName": "ruby",
1717
"id": "ruby/parse-error",
@@ -34,7 +34,7 @@
3434
},
3535
"markdownMessage": "A parse error occurred (expected `end` symbol). 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.",
3636
"plaintextMessage": "A parse error occurred (expected end symbol). Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis.",
37-
"severity": "Error",
37+
"severity": "Warning",
3838
"source": {
3939
"extractorName": "ruby",
4040
"id": "ruby/parse-error",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The severity of parse errors was reduced to warning (previously error).

ruby/ql/lib/codeql/ruby/Diagnostics.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ class Diagnostic extends @diagnostic {
4747
}
4848

4949
/** A diagnostic relating to a particular error in extracting a file. */
50-
class ExtractionError extends Diagnostic, @diagnostic_error {
50+
class ExtractionError extends Diagnostic {
5151
ExtractionError() { this.getTag() = "parse_error" }
5252
}

0 commit comments

Comments
 (0)