Ruby: Make similar changes to differentiate extraction errors and warnings, and mostly restore original behaviour.

This commit is contained in:
Geoffrey White
2024-10-03 17:27:52 +01:00
parent 4c7ec59306
commit 1ea94faccf
6 changed files with 28 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
private import codeql.Locations
private import codeql.util.FileSystem
private import codeql.ruby.Diagnostics
private module Input implements InputSig {
abstract class ContainerBase extends @container {
@@ -34,3 +35,20 @@ class File extends Container, Impl::File {
/** Holds if this file was extracted from ordinary source code. */
predicate fromSource() { any() }
}
/**
* A successfully extracted file, that is, a file that was extracted and
* contains no extraction errors or warnings.
*/
class SuccessfullyExtractedFile extends File {
SuccessfullyExtractedFile() {
not exists(Diagnostic d |
d.getLocation().getFile() = this and
(
d instanceof ExtractionError
or
d instanceof ExtractionWarning
)
)
}
}