Uncrustify is a source code beautifier for C, C++, C#, Objective-C, D, Java, Pawn and Vala.
This is free and open source software.
Key Features
- Highly configurable – 857 configurable options as of version 0.81.0.
- add/remove spaces:
- sp_before_sparen: Add or remove space before ‘(‘ of ‘if’, ‘for’, ‘switch’, ‘while’, etc.
- sp_compare: Add or remove space around compare operator ‘<‘, ‘>’, ‘==’, etc
- add/remove newlines
- nl_if_brace: Add or remove newline between ‘if’ and ‘{‘.
- nl_brace_while: Add or remove newline between ‘}’ and ‘while’ of ‘do’ statement.
- add/remove blanklines:
- eat_blanks_before_close_brace: Whether to remove blank lines before ‘}’.
- nl_max: The maximum consecutive newlines (3 = 2 blank lines).
- indent code:
- indent_switch_case: indent_switch_case: Spaces to indent ‘case’ from ‘switch’.
- indent_class_colon: Whether to indent the stuff after a leading base class colon.
- align code:
- align_func_params: Align variable definitions in prototypes and functions.
- align_struct_init_span: The span for aligning struct initializer values (0=don’t align).
- modify code:
- mod_full_brace_for: Add or remove braces on single-line ‘for’ statement.
- mod_paren_on_return: Add or remove unnecessary paren on ‘return’ statement.
Website: github.com/uncrustify/uncrustify
Support:
Developer: Many contributors
License: GNU General Public License v2.0
Uncrustify is written in C and C++. Learn C with our recommended free books and free tutorials. Learn C++ with our recommended free books and free tutorials.
Related Software
| C and C++ Linters | |
|---|---|
| OCLint | Static code analysis tool for improving quality and reducing defects |
| cpplint | Static code checker for C++ |
| Uncrustify | Source code beautifer |
| Include What You Use | Source analysis tool for C and C++ projects built on Clang |
| Cppcheck | Static analysis tool for C/C++ code |
| ClangFormat | Code formatting tool |
| Clang-Tidy | Clang-based C++ “linter” tool |
Read our verdict in the software roundup.
| C# Code Formatters | |
|---|---|
| Uncrustify | Highly configurable source code beautifier supporting many languages |
| Artistic Style | Flexible source code indenter and formatter for C, C++, C# and Java |
| CSharpier | Opinionated C# formatting with zero configuration |
| ClangFormat | Automatically formats C, C++, Java and other source code consistently |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.