mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
Add consistency query flagging unexpected frontend errors.
This commit is contained in:
16
ql/test/consistency/UnexpectedFrontendErrors.ql
Normal file
16
ql/test/consistency/UnexpectedFrontendErrors.ql
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @name Unexpected frontend error
|
||||
* @description This query produces a list of all errors produced by the Go frontend
|
||||
* during extraction, except for those occurring in files annotated with
|
||||
* "// codeql test: expect frontend errors".
|
||||
* @id go/unexpected-frontend-error
|
||||
*/
|
||||
|
||||
import go
|
||||
|
||||
from Error e
|
||||
where
|
||||
not exists(Comment c | c.getFile() = e.getFile() |
|
||||
c.getText().trim() = "codeql test: expect frontend errors"
|
||||
)
|
||||
select e
|
||||
7
ql/test/consistency/test.go
Normal file
7
ql/test/consistency/test.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
// Example file with a syntax error to demonstrate use of "expect frontend errors" directive
|
||||
|
||||
// codeql test: expect frontend errors
|
||||
|
||||
This is not a valid Go program
|
||||
Reference in New Issue
Block a user