Skip to content

Commit

Permalink
Makefile: add commit_style target for make
Browse files Browse the repository at this point in the history
It applies 'git clang-format' onto the latest commit.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Jul 21, 2023
1 parent c693e0e commit bc3f183
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ style:
$(VERBOSE) docker run --rm --workdir /src -v $(PWD):/src$(DOCKER_MOUNT_OPTS) clang-format-lint --clang-format-executable /clang-format/clang-format10 \
-r $(SOURCES) $(HEADERS) | grep -v -E '^Processing [0-9]* files:' | patch -s -p1 ||:

.PHONY: commit_style
commit_style:
@echo "COMMIT_STYLE"
$(VERBOSE) git clang-format HEAD^1 > /dev/null

DOCKERFILE := $(shell find $(KTF_ROOT) -type f -name Dockerfile)
DOCKERIMAGE := "ktf:build"
DOCKERUSERFLAGS := --user $(shell id -u):$(shell id -g) $(shell printf -- "--group-add=%q " $(shell id -G))
Expand Down

0 comments on commit bc3f183

Please sign in to comment.