-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from Countly/format
clang-format integration to format code
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Basic indentation settings | ||
IndentWidth: 2 | ||
TabWidth: 2 | ||
ContinuationIndentWidth: 4 | ||
UseTab: Never | ||
IndentPPDirectives: BeforeHash | ||
|
||
# Code formatting rules | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterClass: true | ||
AfterControlStatement: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
BeforeCatch: true | ||
BeforeElse: true | ||
IndentBraces: false | ||
ColumnLimit: 300 | ||
|
||
# Blank lines | ||
MaxEmptyLinesToKeep: 1 | ||
|
||
# Alignment | ||
AlignConsecutiveAssignments: true | ||
AlignConsecutiveDeclarations: true | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
|
||
# Import statements | ||
SortIncludes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
CDP=$(osascript -e ' | ||
tell application "Xcode" | ||
activate | ||
--wait for Xcode to remove edited flag from filename | ||
delay 0.3 | ||
set last_word_in_main_window to (word -1 of (get name of window 1)) | ||
set current_document to document 1 whose name ends with last_word_in_main_window | ||
set current_document_path to path of current_document | ||
--CDP is assigned last set value: current_document_path | ||
end tell ') | ||
|
||
sleep 0.6 ### during save Xcode stops listening for file changes | ||
/usr/local/bin/clang-format -style=file -i ${CDP} | ||
|
||
# EOF |