Resolve "Automatically format generated C++ code using clang-format"
What does this MR do?
Format generated code with clang-format
before writing it into the output file.
Changes:
- Add
clang-format
toinstall_requires
. This installsclang-format
viapip
, making sure it is available within thedune-env
. - Add
project_srcdir
as global option. Populate it withPROJECT_SOURCE_DIR
CMake variable. - Accumulate generated code into single string. Pass this string to
clang-format
and write its output into the file. - Execute
clang-format
in theproject_srcdir
to make it fetch.clang-format
style specifications in that directory. UseMozilla
as fallback style. I ensured that this works in downstream modules as well.
Open Questions
- Fallback style
Mozilla
ok?
Related issues
Closes #177 (closed)
Edited by Lukas Riedel