Skip to content

Commit 57a62b8

Browse files
authored
Add notes on using clang-format for style
1 parent 52a2343 commit 57a62b8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

03-Style.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ C++ allows for arbitrary-length identifier names, so there's no reason to be ter
99

1010
are common examples. *snake_case* has the advantage that it can also work with spell checkers, if desired.
1111

12+
## Establishing A Style Guideline
13+
14+
Whatever style guidelines you establish, be sure to implement a `.clang-format` file that specifies the style you expect. While this cannot help with naming, it is particularly important for an open source project to maintain a consistent style.
15+
16+
Every IDE and many editors have support for clang-format built in or easily installable with an add-in.
17+
18+
* VSCode https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
19+
* VisualStudio https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.ClangFormat#review-details
20+
* Resharper++: https://www.jetbrains.com/help/resharper/2017.2/Using_Clang_Format.html
21+
* Vim
22+
* https://github.com/rhysd/vim-clang-format
23+
* https://github.com/chiel92/vim-autoformat
24+
* XCode: https://github.com/travisjeffery/ClangFormat-Xcode
25+
26+
27+
1228
## Common C++ Naming Conventions
1329

1430
* Types start with upper case: `MyClass`.

0 commit comments

Comments
 (0)