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