@@ -10,7 +10,7 @@ here are many easy things that you can do, like
...
@@ -10,7 +10,7 @@ here are many easy things that you can do, like
If you decide to contribute code please read this contribution guide.
If you decide to contribute code please read this contribution guide.
## Style guide
## Style guide
When contributing code to DuMu<sup>x</sup> please follow the [styleguide](doc/styleguide.md). Your work will enjoy much smoother sailing if stick to it with your changes. DuMu<sup>x</sup> is a pretty large project, and a consistent way of doing things really helps a lot when trying to find your way around the code.
When contributing code to DuMu<sup>x</sup> please follow the [styleguide](doc/styleguide.md). Your work will enjoy much smoother sailing if stick to it with your changes. DuMu<sup>x</sup> is a pretty large project, and a consistent way of doing things really helps a lot when trying to find your way around the code.
* In contrast to the remainder of the coding style guidelines, these code formatting rules are (partially) enforced automatically with a pre-commit hook. Due to the distributed nature of git, this hook can only check your commits once they arrive in the central repository, so it is important to make your local git repository check your commits as well. The dunecontrol script will automatically install such a pre-commit hook for you.
* In contrast to the remainder of the coding style guidelines, these code formatting rules are (partially) enforced automatically with a pre-commit hook. Due to the distributed nature of git, this hook can only check your commits once they arrive in the central repository, so it is important to make your local git repository check your commits as well. The dunecontrol script will automatically install such a pre-commit hook for you.
## C++
## C++
### Documentation
### Documentation
...
@@ -15,71 +14,79 @@
...
@@ -15,71 +14,79 @@
* Please document freely what each part of your code _should_ do. Document assumptions.
* Please document freely what each part of your code _should_ do. Document assumptions.
* All comments/documentation in English.
* All comments/documentation in English.
* We proclaim the Doc-Me dogma, which means whatever you do, please document it at least with
* We proclaim the Doc-Me dogma, which means whatever you do, please document it at least with
```c++
//! \todo Please doc me!
```c++
```
//! \todo Please doc me!
```
* We use doxygen to generate documentation from the source code
* We use doxygen to generate documentation from the source code
```c++
intlineOfCode=1;// Short comment on line of code 1 that will _not_ show in doxygen
```c++
intlineOfCode=2;//!< Short comment on line of code 2 that will show in doxygen
int lineOfCode = 1; // Short comment on line of code 1 that will _not_ show in doxygen
//! Short comment on the following line (line of code 3) that will show in doxygen
int lineOfCode = 2; //!< Short comment on line of code 2 that will show in doxygen
intlineOfCode=3;
//! Short comment on the following line (line of code 3) that will show in doxygen
/*!
int lineOfCode = 3;
* Longer comment on line of code 4
/*!
* with several lines of length
* Longer comment on line of code 4
* that will show in doxygen
* with several lines of length
*/
* that will show in doxygen
intlineOfCode=4;
*/
```
int lineOfCode = 4;
```
* Files always contain the following documentation header before the headerguard
* Files always contain the following documentation header before the headerguard
```c++
/*!
```c++
* \file
/*!
* \ingroup GroupName
* \file
* \brief A short description of the file.
* \ingroup GroupName
*/
* \brief A short description of the file.
#ifndef DUMUX_HEADERGUARD_HH
*/
#define DUMUX_HEADERGUARD_HH
#ifndef DUMUX_HEADERGUARD_HH
```
#define DUMUX_HEADERGUARD_HH
where `GroupName` is a doxygen module group, click [here](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/blob/master/doc/doxygen/modules.txt) for an overview of existing groups.
```
where `GroupName` is a doxygen module group, click [here](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/blob/master/doc/doxygen/modules.txt) for an overview of existing groups.
* Each class should be documented using the following style
* Each class should be documented using the following style
```c++
/*!
```c++
* \ingroup GroupName
/*!
* \brief A short description of the class.
* \ingroup GroupName
*
* \brief A short description of the class.
* Optional detailed description of the class
*
* over several lines.
* Optional detailed description of the class
*
* over several lines.
* \tparam T very short description of the template parameter T
*
*/
* \tparam T very short description of the template parameter T
template<classT>
*/
classMyClass{};
template<class T>
```
class MyClass {};
```
* Each free function and class member function should be documented using the following style
* Each free function and class member function should be documented using the following style
```c++
/*!
```c++
* \brief A short description of the function.
/*!
*
* \brief A short description of the function.
* Optional detailed description of the function
*
* over several lines.
* Optional detailed description of the function
*
* over several lines.
* \tparam paramType Very short description of paramType
*
* \param paramName Very short description of paramName
* \tparam paramType Very short description of paramType
* \return returnName Very short description of returnName
* \param paramName Very short description of paramName
*/
* \return returnName Very short description of returnName