docs/contribute/styleguide.rst
.. _style_guide:
Open3D style guide ##################
.. code:: bash
conda activate <your-virtual-env>
pip install -r python/requirements_style.txt
Option 1: Run the style checker directly.
.. code:: bash
python util/check_style.py python util/check_style.py --apply
Option 2: Configure the project and run make.
.. code:: bash
mkdir build cd build cmake ..
make check-style make apply-style
cmake --build . --target check-style cmake --build . --target apply-style
Consistent coding style is an important factor of code readability. Some principles:
We generally follow the Google C++ Style Guide <https://google.github.io/styleguide/cppguide.html>_, with a few modifications:
#pragma once for header guard.open3d.std::shared_ptr and std::unique_ptr instead.We also recommend reading the C++ Core Guidelines <https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md>_.
For Python, please use Google style guidelines, as shown here <http://google.github.io/styleguide/pyguide.html>_.