summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Richard <johnny@johnnyrichard.com>2023-04-30 01:55:48 +0200
committerJohnny Richard <johnny@johnnyrichard.com>2023-04-30 01:55:48 +0200
commitde3f8f73810d77f7231ceddfd63b0720493bd437 (patch)
tree39c31e297156a5d1717cf5837367bb5e048dc4f4
parentef07fab261cce781ca750c1288574d4001f14bcf (diff)
make: Add linter-fix target to Makefiles
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
-rw-r--r--Makefile5
-rw-r--r--test/Makefile4
2 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 6152ece..3963be1 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,11 @@ linter: $(SRCS) $(HEADERS)
clang-format --dry-run --Werror $?
$(MAKE) -C test linter
+.PHONY: linter-fix
+linter-fix: $(SRCS) $(HEADERS)
+ clang-format -i $?
+ $(MAKE) -C test linter-fix
+
.PHONY: test
test: $(TARGET)
$(MAKE) -C test
diff --git a/test/Makefile b/test/Makefile
index 9572d0f..1655f06 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -18,6 +18,10 @@ clean:
linter: $(SRCS)
clang-format --dry-run --Werror $?
+.PHONY: linter-fix
+linter-fix: $(SRCS)
+ clang-format -i $?
+
string_view_test: munit.o ../build/string_view.o string_view_test.o
$(CC) $? $(CFLAGS) -o $@