diff --git a/.github/workflows/clang_format_ci_workflow.yml b/.github/workflows/clang_format_ci_workflow.yml index 4662a9e3..471bfafe 100644 --- a/.github/workflows/clang_format_ci_workflow.yml +++ b/.github/workflows/clang_format_ci_workflow.yml @@ -17,4 +17,4 @@ jobs: uses: actions/checkout@v6 - name: Run clang-format - run: clang-format --dry-run -Werror include/*.h source/*.c include/game/*.h source/game/*.c + run: for file in $(find include source -name '*.[c,h]'); do clang-format --dry-run --Werror $file done diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a867088..dee9973d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -92,10 +92,14 @@ If installed locally and you'd prefer to use it in your shell. You can do the fo ```sh # List warnings -clang-format --dry-run -Werror include/*.h include/game/*.h source/*.c source/game/*.c +for file in $(find include source -name '*.[c,h]'); do + clang-format --dry-run --Werror $file +done # Modify all files inplace -clang-format -i include/*.h include/game/*.h source/*.c source/game/*.c +for file in $(find include source -name '*.[c,h]'); do + clang-format -i $file +done # Or just one clang-format -i include/blind.h diff --git a/Makefile b/Makefile index 9be1dc37..e937d3fa 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,8 @@ LIBTONC := $(DEVKITPRO)/libtonc #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) BUILD := build -SOURCES := source source/game -INCLUDES := include include/game +SOURCES := source source/game source/data_structures +INCLUDES := include include/game include/data_structures DATA := MUSIC := audio GRAPHICS := graphics diff --git a/include/bitset.h b/include/data_structures/bitset.h similarity index 100% rename from include/bitset.h rename to include/data_structures/bitset.h diff --git a/include/list.h b/include/data_structures/list.h similarity index 100% rename from include/list.h rename to include/data_structures/list.h diff --git a/include/pool.h b/include/data_structures/pool.h similarity index 100% rename from include/pool.h rename to include/data_structures/pool.h diff --git a/source/bitset.c b/source/data_structures/bitset.c similarity index 100% rename from source/bitset.c rename to source/data_structures/bitset.c diff --git a/source/list.c b/source/data_structures/list.c similarity index 100% rename from source/list.c rename to source/data_structures/list.c diff --git a/source/pool.c b/source/data_structures/pool.c similarity index 100% rename from source/pool.c rename to source/data_structures/pool.c diff --git a/tests/bitset/Makefile b/tests/bitset/Makefile index a3eac926..955456d0 100644 --- a/tests/bitset/Makefile +++ b/tests/bitset/Makefile @@ -1,9 +1,9 @@ CC := gcc -CFLAGS := -I../../include -I. \ +CFLAGS := -I../../include -I. -I../../include/data_structures \ -g -O3 -std=gnu23 -Wall -Werror SRC := bitset_test.c \ - ../../source/bitset.c + ../../source/data_structures/bitset.c OUT := build/bitset_test $(OUT): $(SRC) | build diff --git a/tests/list/Makefile b/tests/list/Makefile index 3c23e55f..4ecd5123 100644 --- a/tests/list/Makefile +++ b/tests/list/Makefile @@ -1,12 +1,12 @@ CC := gcc -CFLAGS := -I../../include -I. \ +CFLAGS := -I../../include -I../../include/data_structures -I. \ -g -O3 -std=gnu23 -Wall -Werror -DPOOLS_TEST_ENV=yes SRC := list_test.c \ - ../../source/list.c \ - ../../source/pool.c \ - ../../source/bitset.c + ../../source/data_structures/list.c \ + ../../source/data_structures/pool.c \ + ../../source/data_structures/bitset.c OUT := build/list_test $(OUT): $(SRC) | build diff --git a/tests/pool/Makefile b/tests/pool/Makefile index 225ee248..fdaa95a9 100644 --- a/tests/pool/Makefile +++ b/tests/pool/Makefile @@ -1,9 +1,9 @@ CC := gcc -CFLAGS := -I../../include -I. \ +CFLAGS := -I../../include -I../../include/data_structures -I. \ -g -O3 -std=gnu23 -Wall -Werror -DPOOLS_TEST_ENV=yes -SRC := pool_test.c ../../source/pool.c ../../source/bitset.c +SRC := pool_test.c ../../source/data_structures/pool.c ../../source/data_structures/bitset.c OUT := build/pool_test $(OUT): $(SRC) | build