Skip to content

Commit

Permalink
Add .clang-format
Browse files Browse the repository at this point in the history
Also add make format target
  • Loading branch information
zeux committed May 16, 2017
1 parent 1ab49a3 commit c5dbe10
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
UseTab: ForIndentation
TabWidth: 4
IndentWidth: 4
BreakBeforeBraces: Allman
AllowShortIfStatementsOnASingleLine: true
IndentCaseLabels: false
ColumnLimit: 0
PointerAlignment: Left
BreakConstructorInitializersBeforeComma: true
NamespaceIndentation: All
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ all: $(EXECUTABLE)
test: $(EXECUTABLE)
$(EXECUTABLE) demo/bunny.obj

format:
clang-format -i src/*

$(EXECUTABLE): $(OBJECTS)
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@

Expand All @@ -27,4 +30,4 @@ $(BUILD)/%.o: %
clean:
rm -rf $(BUILD)

.PHONY: all clean
.PHONY: all clean format

0 comments on commit c5dbe10

Please sign in to comment.