Add Clang Formatting

Signed-off-by: Daniel Henry <iamdanhenry@gmail.com>
This commit is contained in:
2025-08-21 21:11:26 -05:00
parent 8df0ffb7e5
commit 6029f876ac
4 changed files with 23 additions and 6 deletions

20
.clang-format Normal file
View File

@@ -0,0 +1,20 @@
# <project>/.clang-format
BasedOnStyle: LLVM
IndentWidth: 2
TabWidth: 2
UseTab: Never
# Stop collapsing things to one line
AllowShortFunctionsOnASingleLine: None # or 'Empty' if you want only {} allowed
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortBlocksOnASingleLine: false
SortIncludes: true
IncludeBlocks: Merge
IncludeCategories:
- Regex: '^".*"'
Priority: 1
- Regex: '^<.*>'
Priority: 2

1
.gitignore vendored
View File

@@ -1,6 +1,5 @@
.cache
compile_commands.json
.clang-format
build/
obj/

View File

@@ -1,8 +1,7 @@
#include "debug.h"
#include <stdio.h>
#include "chunk.h"
#include "value.h"
#include <stdio.h>
void disassembleChunk(Chunk *chunk, const char *name) {
printf("== %s ==\n", name);

View File

@@ -1,7 +1,6 @@
#include <stdio.h>
#include "memory.h"
#include "value.h"
#include "memory.h"
#include <stdio.h>
void initValueArray(ValueArray *array) {
array->values = NULL;