ament_uncrustify
================
Checks the code style of C / C++ source files using `Uncrustify
`_.
Files with the following extensions are being considered:
``.c``, ``.cc``, ``.cpp``, ``.cxx``, ``.h``, ``.hh``, ``.hpp``, ``.hxx``.
How to run the check from the command line?
-------------------------------------------
The command line tool is provided by the package `ament_uncrustify
`_.
Note that ament_uncrustify comes with a command line tool which can automatically reformat the code according to the style guide by calling
.. code:: sh
ament_uncrustify --reformat
How to run the check from within a CMake ament package as part of the tests?
----------------------------------------------------------------------------
``package.xml``:
.. code:: xml
ament_cmake
ament_cmake_uncrustify
``CMakeLists.txt``:
.. code:: cmake
find_package(ament_cmake REQUIRED)
if(BUILD_TESTING)
find_package(ament_cmake_uncrustify REQUIRED)
ament_uncrustify()
endif()
When running multiple linters as part of the CMake tests the documentation of
the package `ament_lint_auto `_ might
contain some useful information.
The documentation of the package `ament_cmake_test
`_ provides more information on testing
in CMake ament packages.