summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-10-18 00:29:11 +1100
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-10-18 00:29:11 +1100
commit6d0cf58f998d6e2888cac2c628fcddba4a60d9f2 (patch)
treec6c4019c5c965b4cc784738d9079b73a2fad9ce7
parent5a5d2ee4dd757ec7a5fadb75ac629a5e628bb831 (diff)
add format-check make target
-rw-r--r--.github/workflows/continuous-workflow.yml2
-rw-r--r--Makefile10
2 files changed, 10 insertions, 2 deletions
diff --git a/.github/workflows/continuous-workflow.yml b/.github/workflows/continuous-workflow.yml
index f8bfa86..ba204ef 100644
--- a/.github/workflows/continuous-workflow.yml
+++ b/.github/workflows/continuous-workflow.yml
@@ -15,6 +15,6 @@ jobs:
run: |
ls ${{ github.workspace }}
- name: Check formatting
- run: find src/ -iname *.h -o -iname *.c | xargs clang-format --style=file --dry-run --Werror
+ run: make format-check
- name: Compile C code
run: make
diff --git a/Makefile b/Makefile
index afa79ed..8dc73e2 100644
--- a/Makefile
+++ b/Makefile
@@ -92,10 +92,18 @@ cube: $(EXAMPLES_DIR)/cube.c $(SHARED_LIB) $(SHADER_OUT_DIR)/cube.air $(METAL_LI
format:
clang-format -i $(FORMAT_FILES)
-.PHONY: tidy
+.PHONY: format-check
+format-check:
+ clang-format --dry-run -Werror $(FORMAT_FILES)
+
+.PHONY: tidy-fix
tidy:
clang-tidy -fix $(SRCS) $(EXAMPLES_DIR)/*.c -- $(CFLAGS)
+.PHONY: tidy-check
+tidy-check:
+ clang-tidy $(SRCS) $(EXAMPLES_DIR)/*.c -- $(CFLAGS)
+
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)