-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
47 lines (42 loc) · 1.05 KB
/
.clang-format
File metadata and controls
47 lines (42 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# A .clang-format file to adhere to the Google C++ style guide
# - Google C++ Style Guide: https://google.github.io/styleguide/cppguide.html
# - CLANG-FORMAT STYLE OPTIONS: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
# Author: Munseong Jeong <ryan.m.jeong@hotmail.com>
BasedOnStyle: Google
Language: C
# Sort each #include block separately (if foo.cc includes foo.hpp on the top block, it can be preserved)
IncludeBlocks: Preserve
# Always merge short blocks into a single line
# before:
# while (true) {
# }
# after:
# while (true) {}
#
# Munseong: this rule allows this case
# intended:
# try {
# /* ... */
# } catch {
# return nullptr;
# }
#
# after formatting:
# try {
# /* ... */
# } catch { return nullptr; }
#
# to avoid this case; add a comment like this:
# try {
# /* ... */
# } catch {
# // Munseong: this clause is ...
# return nullptr;
# }
AllowShortBlocksOnASingleLine: Always
# Don't allow short enums on a single line
AllowShortEnumsOnASingleLine: false
# Allow c-style casting style
SpaceAfterCStyleCast: true
ColumnLimit: 150