mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
C#: Remove generated comment checks in stub files as these are not present in handwritten stubs.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user