Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0616040

Browse files
authored
Merge pull request #48 from github/hvitved/ci-check-queries
Check query compilation and formatting in `qltest.yml`
2 parents d5582f3 + eceeb6a commit 0616040

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

.github/workflows/qltest.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ jobs:
3131
run: env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh
3232
- name: Run QL tests
3333
run: codeql/codeql test run --check-databases --check-unused-labels --search-path "${{ github.workspace }}" --consistency-queries ql/consistency-queries ql/test
34-
34+
- name: Check QL formatting
35+
run: find ql "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 codeql/codeql query format --check-only
36+
- name: Check QL compilation
37+
run: codeql/codeql query compile --check-only --threads=4 --warnings=error --search-path "${{ github.workspace }}" "ql/src" "ql/examples"

ql/src/codeql_ruby/Variables.qll

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,18 @@ private predicate scopeDefinesParameter(VariableScope scope, string name, Locati
1818
exists(Identifier var |
1919
name = var.getValue() and
2020
location = var.getLocation() and
21-
var in [
22-
scope
23-
.(BlockScope)
24-
.getScopeElement()
25-
.getAFieldOrChild()
26-
.(BlockParameters)
27-
.getAFieldOrChild+(),
28-
scope
29-
.(MethodScope)
30-
.getScopeElement()
31-
.getAFieldOrChild()
32-
.(MethodParameters)
33-
.getAFieldOrChild+()
34-
]
21+
var in [scope
22+
.(BlockScope)
23+
.getScopeElement()
24+
.getAFieldOrChild()
25+
.(BlockParameters)
26+
.getAFieldOrChild+(),
27+
scope
28+
.(MethodScope)
29+
.getScopeElement()
30+
.getAFieldOrChild()
31+
.(MethodParameters)
32+
.getAFieldOrChild+()]
3533
)
3634
}
3735

0 commit comments

Comments
 (0)