From 8f7e74068fd3b12b3a8b3600d5e9eb9de52f172c Mon Sep 17 00:00:00 2001 From: Irne Racoonovich Date: Thu, 8 Feb 2024 13:49:59 +0200 Subject: [PATCH] Add .clang-format config and makefile targets --- .clang-format | 14 ++++++++++++++ Makefile | 4 ++++ 2 files changed, 18 insertions(+) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..5909c2d1 --- /dev/null +++ b/.clang-format @@ -0,0 +1,14 @@ +BasedOnStyle: Webkit + +Language: Cpp +AlignAfterOpenBracket: Align +AllowShortEnumsOnASingleLine: true + +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^".+\.(h|hh|hpp|hxx)"$' + Priority: 1 + - Regex: '^<.+\.(h|hh|hpp|hxx)>$' + Priority: 2 + - Regex: '^<[^.]+>$' + Priority: 3 diff --git a/Makefile b/Makefile index 5e245dd6..f341d19a 100644 --- a/Makefile +++ b/Makefile @@ -173,7 +173,11 @@ $(BUILD): clean: @rm -fr $(BUILD) $(TARGET).ovl $(TARGET).nro $(TARGET).nacp $(TARGET).elf +formatcheck: + clang-format --Werror --dry-run source/* +codeformat: + clang-format -i source/* #--------------------------------------------------------------------------------- else .PHONY: all