C#: Remove generated comment checks in stub files as these are not present in handwritten stubs.

This commit is contained in:
Michael Nebel
2022-01-05 10:37:37 +01:00
parent 964915ee2e
commit 9983c1cbfb

View File

@@ -197,29 +197,9 @@ class File extends Container, @file {
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
pragma[noinline]
private predicate hasStubHeaderComment() {
exists(CommentLine c |
c.getText() = "This file contains auto-generated code." and
c.getLocation().getFile() = this
)
}
pragma[noinline]
private predicate hasStubComment() {
exists(CommentLine c |
c.getText().regexpMatch("Generated from `.*` in `.*`") and
c.getLocation().getFile() = this
)
}
/** Holds if this file is a QL test stub file. */
pragma[noinline]
private predicate isStub() {
this.hasStubHeaderComment() and
this.hasStubComment() and
this.getAbsolutePath().matches("%resources/stubs/%")
}
private predicate isStub() { this.getAbsolutePath().matches("%resources/stubs/%") }
/** Holds if this file contains source code. */
final predicate fromSource() {