Merge pull request #400 from sauyon/autoformat

Autoformat tests
This commit is contained in:
Chris Smowton
2020-11-11 09:51:50 +00:00
committed by GitHub
3 changed files with 8 additions and 4 deletions

View File

@@ -30,11 +30,11 @@ clean:
DATAFLOW_BRANCH=master
autoformat:
find ql/src -name "*.ql" -or -name "*.qll" | xargs codeql query format -qq -i
find ql -name "*.ql" -or -name "*.qll" | xargs codeql query format -qq -i
git ls-files | grep '\.go$$' | grep -v ^vendor/ | xargs grep -L "//\s*autoformat-ignore" | xargs gofmt -w
check-formatting:
find ql/src -name "*.ql" -or -name "*.qll" | xargs codeql query format --check-only
find ql -name "*.ql" -or -name "*.qll" | xargs codeql query format --check-only
test -z "$$(git ls-files | grep '\.go$$' | grep -v ^vendor/ | xargs grep -L "//\s*autoformat-ignore" | xargs gofmt -l)"
ifeq ($(QHELP_OUT_DIR),)

View File

@@ -242,7 +242,9 @@ abstract private class Expectation extends FailureLocatable {
override string toString() { result = comment.toString() }
override predicate hasLocation(string file, int line) { comment.hasLocationInfo(file, line, _, _, _) }
override predicate hasLocation(string file, int line) {
comment.hasLocationInfo(file, line, _, _, _)
}
}
private class ValidExpectation extends Expectation, TValidExpectation {

View File

@@ -61,7 +61,9 @@ predicate repmetadata(Locatable l, string mod, string dep, string dver, string r
)
}
query predicate missingReplace(string mod, string dep, string dver, string rep, string rver, int line) {
query predicate missingReplace(
string mod, string dep, string dver, string rep, string rver, int line
) {
exists(Locatable l | repmetadata(l, mod, dep, dver, rep, rver) |
l.hasLocationInfo(_, line, _, _, _)
) and