Merge pull request #48 from github/hvitved/ci-check-queries

Check query compilation and formatting in `qltest.yml`
This commit is contained in:
Tom Hvitved
2020-11-24 11:51:54 +01:00
committed by GitHub
2 changed files with 16 additions and 15 deletions

View File

@@ -31,4 +31,7 @@ jobs:
run: env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh
- name: Run QL tests
run: codeql/codeql test run --check-databases --check-unused-labels --search-path "${{ github.workspace }}" --consistency-queries ql/consistency-queries ql/test
- name: Check QL formatting
run: find ql "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 codeql/codeql query format --check-only
- name: Check QL compilation
run: codeql/codeql query compile --check-only --threads=4 --warnings=error --search-path "${{ github.workspace }}" "ql/src" "ql/examples"

View File

@@ -18,20 +18,18 @@ private predicate scopeDefinesParameter(VariableScope scope, string name, Locati
exists(Identifier var |
name = var.getValue() and
location = var.getLocation() and
var in [
scope
.(BlockScope)
.getScopeElement()
.getAFieldOrChild()
.(BlockParameters)
.getAFieldOrChild+(),
scope
.(MethodScope)
.getScopeElement()
.getAFieldOrChild()
.(MethodParameters)
.getAFieldOrChild+()
]
var in [scope
.(BlockScope)
.getScopeElement()
.getAFieldOrChild()
.(BlockParameters)
.getAFieldOrChild+(),
scope
.(MethodScope)
.getScopeElement()
.getAFieldOrChild()
.(MethodParameters)
.getAFieldOrChild+()]
)
}