Commit 8ddc30af authored by Lukas Riedel's avatar Lukas Riedel Committed by Santiago Ospina De Los Ríos

Add .clang-format file and vendor clang-format-hook as Git submodule

Use 'Mozilla' style with slight modifications:

* Break before binary operators, except assignment operators.
* Usually break before braces ('Allman' style).
parent bc7b0b05
BasedOnStyle: Mozilla
# Break before braces, except for one-line statements
BreakBeforeBraces: Allman
# Do not break before assignment operators
BreakBeforeBinaryOperators: NonAssignment
......@@ -4,3 +4,6 @@
[submodule "plugins/vendor/googletest"]
path = plugins/vendor/googletest
url =
[submodule "plugins/vendor/clang-format-hooks"]
path = plugins/vendor/clang-format-hooks
url =
......@@ -5,6 +5,9 @@
### Added
* Extended Miller scaling adapter with additional porosity scaling !122
* Coding style tools and instructions.
as Git submodule !203
### Changed
......@@ -68,6 +68,41 @@ templates. Provide information on how your code changes and additions solve the
problem or implement the feature. Make sure that your MR fulfills the the
criteria for being merged.
#### C++ Coding Style
The DORiE repository contains a `.clang-format` file in the top-level directory specifying the desired style for C++ code in DORiE.
We ask developers to use this style when writing new code, ideally by instructing their editor and/or [ClangFormat]( tool to do so.
Every change to C++ files introduced by Git commits should be formatted according to this style.
DORiE vendors [clang-format-hooks]( to automate formatting and avoid committing unformated changes.
It contains a Git pre-commit hook which checks the changes right before committing.
If the changes to not comply to the coding style, the user is shown the suggested style and prompted to apply the changes or abort the commit.
Follow these instructions for registering the hook:
1. Install `clang-format`.
On **macOS**:
brew install clang-format
On **Ubuntu**:
apt install clang-format
2. Register the hook. From the top-level DORiE source directory, execute
./plugins/vendor/clang-format-hooks/git-pre-commit-format install
When running in trouble, consult the [original installation instructions](
Happy coding!
### Releases
Tasks for creating and publishing a release are listed in the `version-rollout`
Subproject commit ac35e705ebf20187b7ff92c29d1411f6a4c8d522
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment