Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 04af08c

Browse files
author
Max Schaefer
committed
Add Make target to autoformat all QL.
Use ```sh make autoformat ``` to format all `.ql` and `.qll` files under `ql/src`. Use ```sh make AUTOFORMAT=--check-only autoformat ``` to check that all `.ql` and `.qll` files under `ql/src` are correctly formatted and fail if they are not.
1 parent 524b11b commit 04af08c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@ EXTRACTOR_PACK_OUT = build/codeql-extractor-go
2020

2121
BINARIES = go-extractor go-tokenizer go-autobuilder go-bootstrap go-gen-dbscheme
2222

23-
.PHONY: tools tools-codeql tools-codeql-full clean \
23+
.PHONY: tools tools-codeql tools-codeql-full clean autoformat \
2424
tools-linux64 tools-osx64 tools-win64
2525

2626
clean:
2727
rm -rf tools/bin tools/linux64 tools/osx64 tools/win64 tools/net tools/opencsv
2828
rm -rf $(EXTRACTOR_PACK_OUT) build/stats build/testdb
2929

30+
AUTOFORMAT=-qq -i
31+
32+
autoformat:
33+
find ql/src -name *.ql -or -name *.qll | xargs codeql query format $(AUTOFORMAT)
34+
3035
tools: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES))) tools/tokenizer.jar
3136

3237
.PHONY: $(addsuffix $(EXE),$(addprefix tools/bin/,$(BINARIES)))

0 commit comments

Comments
 (0)