Skip to content

Commit 86cc2dc

Browse files
committed
Ruby: Add rb/diagnostics/extraction-warnings so that we don't miss anything we had before.
1 parent 1ea94fa commit 86cc2dc

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @name Extraction warnings
3+
* @description List all extraction warnings for files in the source code directory.
4+
* @kind diagnostic
5+
* @id rb/diagnostics/extraction-warnings
6+
*/
7+
8+
import codeql.ruby.AST
9+
import codeql.ruby.Diagnostics
10+
11+
/** Gets the SARIF severity to associate with a warning. */
12+
int getSeverity() { result = 1 }
13+
14+
from ExtractionWarning warning, File f
15+
where
16+
f = warning.getLocation().getFile() and
17+
exists(f.getRelativePath())
18+
select warning, "Extraction warning in " + f + " with message " + warning.getMessage(),
19+
getSeverity()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| src/not_ruby.rb:5:25:5:26 | A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis. | Extraction warning in src/not_ruby.rb with message A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis. | 1 |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
queries/diagnostics/ExtractionWarnings.ql

0 commit comments

Comments
 (0)