Open MakisH opened 2 months ago
A possibility which works in pre-commit but not IDEs is to define 2 clang-format hooks and explicitly pass the configuration file to format the OpenFOAM solvers. This way we could use a single clang format file for all openfoam solvers in the repo.
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configuring-style-with-clang-format
I like the idea. If we also distribute the file as a separate repository, we could import it as a git submodule (I will eventually do this in the context of the OpenFOAM SIG RSE).
I like the idea.
I'll try it in #551 and link to the existing clang format in on of the openfoam solver directories.
While we have a central
.clang-format
file for the tutorials, we also have such a file for the OpenFOAM solver in the partitioned heat conduction case. We need this mainly because the default format moves around header inclusions, which breaks OpenFOAM code. This is already a duplicate of the file used in the OpenFOAM adapter, and other PRs are introducing more duplication (such as https://github.com/precice/tutorials/pull/551).We could maybe move the OpenFOAM-specific file to
tools/
for now, and link to it from the various directories.Note that we are also working on a community proposal, which we could maybe one day import.