Contributing - DigitalHolography/Holovibes GitHub Wiki

Coding standards

Code format and style

On VS 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:

  • Always document your code.
  • Use the given .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.
  • 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.
  • simple getters, setters and inlinable functions must be written in *.hh files.

Git convention

  • Branch master is only used for stable releases.
  • Branch dev is only used for merged features.
  • Never push trash, generated or dev (small script or test program for example) 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.
  • Review PR.
  • Use git pull --rebase if possible to avoids useless merge commits.
  • Use the React commit convention.

Developing New Features

  1. Create a new branch from dev.

  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.
    • Always add a clear description of what was the issue and what you have changed.
    • 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 an issue

Always add a clear description of the issue, how to reproduce it (don't hesitate to attach screenshot, compute settings or logs) and a possible solution to it.

Always label your issue.

[!NOTE] Keep in mind that unclear issues (no description) are never resolved.

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.