Linting
C++ Linting
To ensure that your C++ code follows our coding conventions and guidelines, run
the clang-tidy
linting tool by following these instructions:
- Open a shell in the docker container, refer to the setup guide for instructions.
- Build the ros2 workspace with the following command:
this will generate the
compile_commands.json
file - run
- Read the output of the command and make sure that no errors were found.
Python Linting
To ensure that your Python code follows our coding conventions and guidelines, run
the ruff
linting tool by following these instructions:
- Open a shell in the docker container, refer to the setup guide for instructions.
- run
- Read the output of the command and make sure that no errors were found.
Automated formatting
Both clang-tidy
and ruff
can format the code so that it follows our rules.
Warning
Not all rules can be enforced automatically and using this functionality is often not enough for the code to be valid.
For ruff
add the --fix
flag:
For clang-tidy
add the --fix
flag: