From 80c2fcdbb8b31d28929a92e18f60bb22da787549 Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Tue, 10 Nov 2020 09:35:16 -0800 Subject: [PATCH 1/2] Autoformat tests --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9d06e61ca5e..63145f427f6 100644 --- a/Makefile +++ b/Makefile @@ -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),) From 5a9b8a5465b3b82e2a3ba2d8e4795f5ff1a76818 Mon Sep 17 00:00:00 2001 From: Sauyon Lee Date: Tue, 10 Nov 2020 09:35:29 -0800 Subject: [PATCH 2/2] Autoformat --- ql/test/TestUtilities/InlineExpectationsTest.qll | 4 +++- ql/test/library-tests/semmle/go/GoModExpr/GoModExprs.ql | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ql/test/TestUtilities/InlineExpectationsTest.qll b/ql/test/TestUtilities/InlineExpectationsTest.qll index befbde4afc7..e774969bf2f 100644 --- a/ql/test/TestUtilities/InlineExpectationsTest.qll +++ b/ql/test/TestUtilities/InlineExpectationsTest.qll @@ -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 { diff --git a/ql/test/library-tests/semmle/go/GoModExpr/GoModExprs.ql b/ql/test/library-tests/semmle/go/GoModExpr/GoModExprs.ql index cab5795037e..eb6e96cdcd8 100644 --- a/ql/test/library-tests/semmle/go/GoModExpr/GoModExprs.ql +++ b/ql/test/library-tests/semmle/go/GoModExpr/GoModExprs.ql @@ -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