We aim for a consistent and readable coding style. You do not need to worry about styling if you use the right tools we present in the following. Please also enable pre-commit in your repository to have these check run automatically for you on every commit!
clang-format. It can be added to be automatically run on save in your editor / IDE:
The current style is defined in .clang-format.
black. It can be added to be automatically run on save in your editor / IDE:
black is also run by our
pre-commit-hooks. To run manually:
pre-commit run black --all-files
Use cmake-format. It can be added to be automatically run on save in your editor / IDE:
The current style is defined in
On installation make sure to install with the YAML option:
pip install cmakelang[YAML]
You can run
cmake-format on the full OGS code base by building the following targets:
|Language||Shows formatting||Applies formatting|
This article was written by Lars Bilke. If you are missing something or you find an error please let us know.
Generated with Hugo 0.101.0 in CI job 303998 | Last revision: February 28, 2023
Commit: [pre-commit] Added black check on markdown notebooks. efed3632 | Edit this page on