Awesome
Clang Format for Unreal Engine C++
Automatically format your Unreal Engine C++ as per Epic's Coding Standard.
The purpose of this repository is to provide a Clang-Format configuration for Unreal Engine C++ and instructions for how to use it.
Get the .clang-format file
VS Code
- Put the
.clang-format
file in the root of your project (or the engine root if you are working on the engine itself). - As long as you have Microsoft's C++ extension installed in VSCode you can now format with
Shift+Alt+F
. (If not, read here).
Optional: You can enable format on save
for C++ by adding the following to your *.code-workspace
file:
"settings": {
"[c++]": {
"editor.formatOnSave": true
}
},
Visual Studio
- Go to the root of you project,
File->Add New Item->ClangFormat File
. - Copy+Paste the contents of the .clang-format from this repository into the newly generated
.clang-format
file. - You can now format files with
Ctrl+K+D
Optional: You can enable format on save
by installing this extension.
Limitations
- Method chaining is not supported by clang-format and offers inconsistent results, especially inside of square brackets (
[
,]
) such as used extensively by Slate. - Single-line lambdas are incompatible with Allman-style brace wrapping and cannot be supported with the currently available ruleset.