Uncrustify – source code beautifer

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
OCLintStatic code analysis tool for improving quality and reducing defects
cpplintStatic code checker for C++
UncrustifySource code beautifer
Include What You UseSource analysis tool for C and C++ projects built on Clang
CppcheckStatic analysis tool for C/C++ code
ClangFormatCode formatting tool
Clang-TidyClang-based C++ “linter” tool

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted