Contributing - DigitalHolography/Holovibes GitHub Wiki

Coding standards

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} and set_${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. Do not use .cpp or .hpp.
  • For CUDA files, ensure all header files have the extension .cuh and source files .cu. Do not use .cuhxx since it is not a conventionnal name.
  • Getters, Setters and inlinable functions must be written in *.hh files.
  • Always document your code !

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

  1. Always create a new branch from dev for any new feature or bug fix.

  2. Commit your changes using the React convention.

  3. 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].
  4. 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.
  5. 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.

  1. Merge all your feature branches on dev.
  2. Update CHANGELOG.md.
  3. Apply the Benchmark protocol.
  4. Make a clean build in release mode (./dev.py clean build -b Release).
  5. 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).
  6. Make sure the git repository has no work in progress.
  7. Run the release script with ./dev.py -b Release release {bump-type} with bump-type being either major, minor or patch if you want to modify either X, Y, or Z of the version number X.Y.Z.
  8. add the updated CMakeLists.txt to git.
  9. do a git push --follow-tags.
  10. Merge master with dev.