Skip to content

Commit 4820626

Browse files
committed
Add SyntaxError query
This can be used by autofix, but might also be nice to help find YAML syntax errors 🤷
1 parent ac7b7b7 commit 4820626

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

ql/src/Debug/SyntaxError.ql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @name Syntax error
3+
* @description A piece of code could not be parsed due to syntax errors.
4+
* @kind problem
5+
* @problem.severity recommendation
6+
* @id actions/syntax-error
7+
* @tags reliability
8+
* correctness
9+
* language-features
10+
* debug
11+
* @precision very-high
12+
*/
13+
14+
private import codeql.actions.ast.internal.Yaml
15+
16+
from YamlParseError pe
17+
select pe, pe.getMessage()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| .github/workflows/malformed.yml:7:4:7:4 | expected <block end>, but found '<block sequence start>' | expected <block end>, but found '<block sequence start>' |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Debug/SyntaxError.ql
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
semmle-extractor-options: --tolerate-parse-errors --experimental

0 commit comments

Comments
 (0)