Development Guide
Git management
We use the Git Flow approach to maintain a hierarchy and a clean repository.
It means that we have the following branches:
- master is the default working branch
- develop is the development branch, the source branch for every new development
- dev-* are the ongoing development branch
- fix-* fix a bug or solve an issue
To create a new development branch, simply do
# go on the develop branch
git checkout develop
# update your version
git pull
# create a new branch
git checkout -b dev-mynewfeature develop
Additionally, for the commit we use the gitmoji guide to describe your commit purpose. It helps to automatically identify the reason of the commit. Here is a small non-exhaustive list
| Action | Corresponding emoji |
|---|---|
| Solve a regular bug | :bug: |
| Sovle a critical bug | :ambulance: |
| Add documentation / comments / doxygen | :memo: |
| Compilation / makefile | :wrench: |
| Docker | :whale: |
| Refactor | :recycle: |
| Work in Progress | :construction: |
| Cleanup the code | :wastebasket: |
| Refactor the code | :::building_construction::: |
Create issues to keep track of the development and also to discuss any question you might have. You can use the keywords clos(e/es/ed), resolv(e/es/ed) and fix(/es/ed) followed by the issue number to close an issue once merged in the default branch
Style Guide
To ensure a consistent style across murphy, we rely on the Google C++ Style Guide. Additionally, we use two tools to help the formatting:
cpplinttool to detect style errors,clang-formatto help the formatting in VSCode. The file.clang-formatshould be automatically detected and loaded in VSCode, giving you access Immediately to the formatting behavior. You regenerate that file using
There are some exceptions to the style guide as listed below:
typedefdefined types have a postfix:*_t(e.g.real_tfor the real datatype,iface_twhen lopping on the faces, ...)- the macro definitions acting as functions have a prefix
m_, which stands for MURPHY (e.g.m_verb) - the files are names in lowercase with a
.cppand.hppextension, with filenames copying the class it contains (e.g. classGridingrid.cpp) - callback functions used to interface with
p4eststart withcback_