Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.23 KB

CONTRIBUTING.md

File metadata and controls

31 lines (21 loc) · 1.23 KB

Contribution guidelines and standards

C++ coding style

ClangFormat

ClangFormat is a widely-used C++ code formatter. RGL uses ClangFormat 14.0.0 to make the resulting code more consistent and readable.

Changes made to Robotec GPU Lidar should follow the established formatting style defined in the .clang-format file.

Working with clang-format

To install clang-format on Ubuntu 22.04, follow the steps described in the instructions.

To reformat all C/C++ files in the repository, follow these instructions:

find src/ test/ include/ tools/ extensions/ | grep -E '.*\.(c|h|cpp|hpp|cu|cuh)$' | xargs clang-format-14 -i

Git hook

You can configure a pre-commit hook that will prevent you from committing unformatted C/C++ files by:

git config core.hooksPath .githooks

If you use your own git hook, you can alternatively copy ours or overwrite your pre-commit hook:

cat .githooks/pre-commit >> .git/hooks/pre-commit
sudo chmod +x .git/hooks/pre-commit # Ensure executable bit is set, otherwise git will not run it.