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:
cpplint
tool to detect style errors,clang-format
to help the formatting in VSCode. The file.clang-format
should 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:
typedef
defined types have a postfix:*_t
(e.g.real_t
for the real datatype,iface_t
when 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
.cpp
and.hpp
extension, with filenames copying the class it contains (e.g. classGrid
ingrid.cpp
) - callback functions used to interface with
p4est
start withcback_