Contributing - DigitalHolography/Holovibes GitHub Wiki
Coding standards
1. Code format and style
On Visual Studio Code you can install the extension Clang-format
and enable Format On Save
in preferences.
Install a pre-commit hook with pip install pre-commit
and then use pre-commit install
at the root of the project.
Adhere to the following coding standards to maintain code consistency:
- Use
.clang-format
for formatting. - No brackets in one line ifs
- Follow the naming conventions:
- Classes, Structs, Unions and Enums must be named in CamelCase.
- Class Members, Variables, Namespaces, Functions and Files must be named in snake_case.
- Getters and setters must be named
get_${var}
andset_${var}
respectivly. - Class members' name must end with a
_
(ex:frame_size_
).
- Ensure all header files have the extension
.hh
, source files.cc
, and templated classes.hxx
. - Getters, Setters and inlinable functions must be written in
*.hh
files. - Always document your code !
2. Git convention
- Branch
master
is only used for stable releases. - Branch
dev
is only used for merged features. - Never push trash or generated files.
- Always work on separate branches when developing a new feature or fixing a bug.
- Use pull request when you want to merge your branch into
dev
. - Use
git pull --rebase
if possible to avoids useless merge commits. - Use the React commit convention.
Developing New Features
-
Always create a new branch from
dev
for any new feature or bug fix. -
Commit your changes using the React convention.
-
If your features impact the front or how the user use the application, add a changelog entry:
- Add a new entry in the
CHANGELOG.md
file. - Follow the format:
## [Unreleased]
->## [Version]
.
- Add a new entry in the
-
When done, create a Pull Request:
- Go to the GitHub repository and create a pull request from your feature branch to
dev
. - Add a very clear description.
- Link the pull request to issues you are fixing.
- Go to the GitHub repository and create a pull request from your feature branch to
-
When your pull request is approved by two people ore more you can merge it.
Creating a release
[!NOTE] Bitflow frames grabber and euresys frames grabber SDKs must be installed on the computer when making a release executable or it will not contains the dll required to load the camera.
- Merge all your feature branches on
dev
. - Update
CHANGELOG.md
. - Apply the Benchmark protocol.
- Make a clean build in release mode (
./dev.py clean build -b Release
). - Make sure everything works as intended and run test suite (
./dev.py pytest -b Release
). (ctest
aren't working and are not to be used for now). - Make sure the git repository has no work in progress.
- Run the release script with
./dev.py -b Release release {bump-type}
withbump-type
being eithermajor
,minor
orpatch
if you want to modify either X, Y, or Z of the version number X.Y.Z. - add the updated CMakeLists.txt to git.
- do a
git push --follow-tags
. - Merge master with
dev
.