Skip to content

Commit

Permalink
Add .clang-format and format C files
Browse files Browse the repository at this point in the history
Add `.clang-format` file that can be used directly by the clang
formatter or by the Microsoft C/C++ VSCode extension.
Style based on Microsoft default style guide, but update brace and case
indentation settings to match current files better (as well as Go code).

Run formatter on `init\init.c` and `vsockexec\vsockexec.c`.
Changes mostly with brace position, spacing, indentation, and pointer
alignment.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
  • Loading branch information
helsaawy committed Aug 23, 2024
1 parent e7a1be7 commit 0093d5d
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 145 deletions.
11 changes: 11 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Language: Cpp
BasedOnStyle: Microsoft
BreakBeforeBraces: Attach
AllowShortFunctionsOnASingleLine: All
# match Go style
IndentCaseLabels: false
# don't break comments over line limit (needed for CodeQL exceptions)
ReflowComments: false
InsertNewlineAtEOF: true
KeepEmptyLines:
AtEndOfFile: true
Loading

0 comments on commit 0093d5d

Please sign in to comment.