
Uncrustify is a source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA and it comes under GPL-2.0 license. It is invoked in DDR Tool to generate multiple formats of the final generated code (MISRA).

Used version is <0.70.1> and there are no modifications added.
Versions older than 0.70 do not provide all the necessary features and versions newer than 0.70 are not compatible with RedHat 7 (CentOS 7) as building the uncrustify binary requires higher versions of gcc and libstdc++ library.

It can be executed from command-line using the command:
	uncrustify -c <config.file> -f <input.file> -o <output.file>

Example:
	uncrustify -c mystyle.cfg -f somefile.c -o output_somefile.c
	uncrustify -c mystyle.cfg -f somefile.c > output_somefile.c
	uncrustify -c mystyle.cfg somefile.c
	uncrustify -c mystyle.cfg --no-backup somefile.c

The -c flag selects the configuration file. The -f flag specifies the input file. The -o flag specifies the output file. If flag -f is used without flag -o the output will be send to stdout.

Download location: https://sourceforge.net/projects/uncrustify/files/uncrustify-0.70.1/
- For Windows, pre compiled binary was used
- For Linux, binary was generated with CMake from source files on RedHat 7 (gcc-4.8.5 20150623 (Red Hat 4.8.5-44), libstdc++.so.6.0.19, cmake version 2.8.12.2):
	* Download tar archive from mentioned location
	* Python is an "interpreted high-level programming language for general-purpose programming", for this project it is needed to extend the capabilities of CMake.
	* CMake is a tool that generates build systems (Makefiles, Visual Studio project files, Xcode project files and others).
	* To generate a build system for Uncrustify using CMake, create a build folder and run CMake from it:
		$ mkdir build
		$ cd build
		$ cmake ..
		(Use cmake -G Xcode .. for Xcode)
	* Then use the build tools of your build system (in many cases this will simply be make, but on Windows it could be MSBuild or Visual Studio). Or use CMake to invoke it:
		$ cmake --build .
	* If testing is enabled, CMake generates a test target, which you can build using your build system tools (usually make test). This can also be invoked using CTest:
		$ ctest -V -C Debug
	* There is also an install target, which can be used to install the Uncrustify executable (typically make install).

Configuration file used : style.cfg.txt

Tested on Windows 10, RedHat 7, Ubuntu-16, Ubuntu-18.
It is supported on Windows 10, Redhat 7 (CentOS) and newer, Ubuntu 16 and newer.

More details : https://github.com/uncrustify/uncrustify
