mirror of
https://github.com/github/codeql.git
synced 2026-02-19 08:23:45 +01:00
move diagnostics queries to match other languages more closely
This commit is contained in:
18
ql/src/queries/diagnostics/ExtractionErrors.ql
Normal file
18
ql/src/queries/diagnostics/ExtractionErrors.ql
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* @name Extraction errors
|
||||
* @description List all extraction errors for files in the source code directory.
|
||||
* @kind diagnostic
|
||||
* @id rb/diagnostics/extraction-errors
|
||||
*/
|
||||
|
||||
import ruby
|
||||
import codeql_ruby.Diagnostics
|
||||
|
||||
/** Gets the SARIF severity to associate an error. */
|
||||
int getSeverity() { result = 2 }
|
||||
|
||||
from ExtractionError error, File f
|
||||
where
|
||||
f = error.getLocation().getFile() and
|
||||
exists(f.getRelativePath())
|
||||
select error, "Extraction failed in " + f + " with error " + error.getMessage(), getSeverity()
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @name Files extracted with errors
|
||||
* @description Lists files that were extracted, but may be incomplete due to
|
||||
* extraction errors.
|
||||
* @kind diagnostic
|
||||
* @id rb/diagnostics/files-extracted-with-errors
|
||||
*/
|
||||
|
||||
import ruby
|
||||
import codeql_ruby.Diagnostics
|
||||
|
||||
from File f
|
||||
where exists(ExtractionError e | e.getLocation().getFile() = f)
|
||||
select f, ""
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @name Successfully extracted files
|
||||
* @description Lists all files that were extracted without encountering an
|
||||
* error in the file.
|
||||
* @description Lists all files in the source code directory that were extracted
|
||||
* without encountering an error in the file.
|
||||
* @kind diagnostic
|
||||
* @id rb/diagnostics/successfully-extracted-files
|
||||
*/
|
||||
@@ -10,5 +10,7 @@ import ruby
|
||||
import codeql_ruby.Diagnostics
|
||||
|
||||
from File f
|
||||
where not exists(ExtractionError e | e.getLocation().getFile() = f)
|
||||
where
|
||||
not exists(ExtractionError e | e.getLocation().getFile() = f) and
|
||||
exists(f.getRelativePath())
|
||||
select f, ""
|
||||
|
||||
Reference in New Issue
Block a user