Skip to content

Unreal Engine Clang-Format configuration and instructions.

License

Notifications You must be signed in to change notification settings

TensorWorks/UE-Clang-Format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Before and After

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

.clang-format file

VS Code

  1. Put the .clang-format file in the root of your project (or the engine root if you are working on the engine itself).
  2. 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

  1. Go to the root of you project, File->Add New Item->ClangFormat File.
  2. Copy+Paste the contents of the .clang-format from this repository into the newly generated .clang-format file.
  3. You can now format files with Ctrl+K+D

Optional: You can enable format on save by installing this extension.

Limitations

  1. Method chaining is not supported by clang-format and offers inconsistent results, especially inside of square brackets ([, ]) such as used extensively by Slate.
  2. Single-line lambdas are incompatible with Allman-style brace wrapping and cannot be supported with the currently available ruleset.

About

Unreal Engine Clang-Format configuration and instructions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •