Skip to content

Commit 9983c1c

Browse files
committed
C#: Remove generated comment checks in stub files as these are not present in handwritten stubs.
1 parent 964915e commit 9983c1c

File tree

1 file changed

+1
-21
lines changed
  • csharp/ql/lib/semmle/code/csharp

1 file changed

+1
-21
lines changed

csharp/ql/lib/semmle/code/csharp/File.qll

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -197,29 +197,9 @@ class File extends Container, @file {
197197

198198
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
199199

200-
pragma[noinline]
201-
private predicate hasStubHeaderComment() {
202-
exists(CommentLine c |
203-
c.getText() = "This file contains auto-generated code." and
204-
c.getLocation().getFile() = this
205-
)
206-
}
207-
208-
pragma[noinline]
209-
private predicate hasStubComment() {
210-
exists(CommentLine c |
211-
c.getText().regexpMatch("Generated from `.*` in `.*`") and
212-
c.getLocation().getFile() = this
213-
)
214-
}
215-
216200
/** Holds if this file is a QL test stub file. */
217201
pragma[noinline]
218-
private predicate isStub() {
219-
this.hasStubHeaderComment() and
220-
this.hasStubComment() and
221-
this.getAbsolutePath().matches("%resources/stubs/%")
222-
}
202+
private predicate isStub() { this.getAbsolutePath().matches("%resources/stubs/%") }
223203

224204
/** Holds if this file contains source code. */
225205
final predicate fromSource() {

0 commit comments

Comments
 (0)